1. Packages
  2. Linode Provider
  3. API Docs
  4. getNodebalancers
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

linode.getNodebalancers

Explore with Pulumi AI

linode logo
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

    Provides information about Linode NodeBalancers that match a set of filters. For more information, see the Linode APIv4 docs.

    Example Usage

    The following example shows how one might use this data source to access information about a Linode NodeBalancer.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const specific-nodebalancers = linode.getNodebalancers({
        filters: [
            {
                name: "label",
                values: ["my-nodebalancer"],
            },
            {
                name: "region",
                values: ["us-iad"],
            },
        ],
    });
    export const nodebalancerId = specific_nodebalancers.then(specific_nodebalancers => specific_nodebalancers.nodebalancers?.[0]?.id);
    
    import pulumi
    import pulumi_linode as linode
    
    specific_nodebalancers = linode.get_nodebalancers(filters=[
        {
            "name": "label",
            "values": ["my-nodebalancer"],
        },
        {
            "name": "region",
            "values": ["us-iad"],
        },
    ])
    pulumi.export("nodebalancerId", specific_nodebalancers.nodebalancers[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		specific_nodebalancers, err := linode.GetNodebalancers(ctx, &linode.GetNodebalancersArgs{
    			Filters: []linode.GetNodebalancersFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-nodebalancer",
    					},
    				},
    				{
    					Name: "region",
    					Values: []string{
    						"us-iad",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("nodebalancerId", specific_nodebalancers.Nodebalancers[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var specific_nodebalancers = Linode.GetNodebalancers.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetNodebalancersFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-nodebalancer",
                    },
                },
                new Linode.Inputs.GetNodebalancersFilterInputArgs
                {
                    Name = "region",
                    Values = new[]
                    {
                        "us-iad",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["nodebalancerId"] = specific_nodebalancers.Apply(specific_nodebalancers => specific_nodebalancers.Apply(getNodebalancersResult => getNodebalancersResult.Nodebalancers[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetNodebalancersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var specific-nodebalancers = LinodeFunctions.getNodebalancers(GetNodebalancersArgs.builder()
                .filters(            
                    GetNodebalancersFilterArgs.builder()
                        .name("label")
                        .values("my-nodebalancer")
                        .build(),
                    GetNodebalancersFilterArgs.builder()
                        .name("region")
                        .values("us-iad")
                        .build())
                .build());
    
            ctx.export("nodebalancerId", specific_nodebalancers.nodebalancers()[0].id());
        }
    }
    
    variables:
      specific-nodebalancers:
        fn::invoke:
          Function: linode:getNodebalancers
          Arguments:
            filters:
              - name: label
                values:
                  - my-nodebalancer
              - name: region
                values:
                  - us-iad
    outputs:
      nodebalancerId: ${["specific-nodebalancers"].nodebalancers[0].id}
    

    Filterable Fields

    • label

    • tags

    • ipv4

    • ipv6

    • hostname

    • region

    • client_conn_throttle

    Using getNodebalancers

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNodebalancers(args: GetNodebalancersArgs, opts?: InvokeOptions): Promise<GetNodebalancersResult>
    function getNodebalancersOutput(args: GetNodebalancersOutputArgs, opts?: InvokeOptions): Output<GetNodebalancersResult>
    def get_nodebalancers(filters: Optional[Sequence[GetNodebalancersFilter]] = None,
                          nodebalancers: Optional[Sequence[GetNodebalancersNodebalancer]] = None,
                          order: Optional[str] = None,
                          order_by: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetNodebalancersResult
    def get_nodebalancers_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetNodebalancersFilterArgs]]]] = None,
                          nodebalancers: Optional[pulumi.Input[Sequence[pulumi.Input[GetNodebalancersNodebalancerArgs]]]] = None,
                          order: Optional[pulumi.Input[str]] = None,
                          order_by: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetNodebalancersResult]
    func GetNodebalancers(ctx *Context, args *GetNodebalancersArgs, opts ...InvokeOption) (*GetNodebalancersResult, error)
    func GetNodebalancersOutput(ctx *Context, args *GetNodebalancersOutputArgs, opts ...InvokeOption) GetNodebalancersResultOutput

    > Note: This function is named GetNodebalancers in the Go SDK.

    public static class GetNodebalancers 
    {
        public static Task<GetNodebalancersResult> InvokeAsync(GetNodebalancersArgs args, InvokeOptions? opts = null)
        public static Output<GetNodebalancersResult> Invoke(GetNodebalancersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNodebalancersResult> getNodebalancers(GetNodebalancersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getNodebalancers:getNodebalancers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetNodebalancersFilter>
    Nodebalancers List<GetNodebalancersNodebalancer>
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Filters []GetNodebalancersFilter
    Nodebalancers []GetNodebalancersNodebalancer
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    filters List<GetNodebalancersFilter>
    nodebalancers List<GetNodebalancersNodebalancer>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    filters GetNodebalancersFilter[]
    nodebalancers GetNodebalancersNodebalancer[]
    order string
    The order in which results should be returned. (asc, desc; default asc)
    orderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    filters Sequence[GetNodebalancersFilter]
    nodebalancers Sequence[GetNodebalancersNodebalancer]
    order str
    The order in which results should be returned. (asc, desc; default asc)
    order_by str
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    filters List<Property Map>
    nodebalancers List<Property Map>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.

    getNodebalancers Result

    The following output properties are available:

    id String
    The Linode NodeBalancer's unique ID
    filters List<Property Map>
    nodebalancers List<Property Map>
    order String
    orderBy String

    Supporting Types

    GetNodebalancersFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetNodebalancersNodebalancer

    ClientConnThrottle int
    Throttle connections per second (0-20)
    Created string
    When this Linode NodeBalancer was created
    Hostname string
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    Id int
    The Linode NodeBalancer's unique ID
    Ipv4 string
    The Public IPv4 Address of this NodeBalancer
    Ipv6 string
    The Public IPv6 Address of this NodeBalancer
    Label string
    The label of the Linode NodeBalancer
    Region string
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    Tags List<string>
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Transfers List<GetNodebalancersNodebalancerTransfer>
    Information about the amount of transfer this NodeBalancer has had so far this month.
    Updated string
    When this Linode NodeBalancer was last updated
    ClientConnThrottle int
    Throttle connections per second (0-20)
    Created string
    When this Linode NodeBalancer was created
    Hostname string
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    Id int
    The Linode NodeBalancer's unique ID
    Ipv4 string
    The Public IPv4 Address of this NodeBalancer
    Ipv6 string
    The Public IPv6 Address of this NodeBalancer
    Label string
    The label of the Linode NodeBalancer
    Region string
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    Tags []string
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Transfers []GetNodebalancersNodebalancerTransfer
    Information about the amount of transfer this NodeBalancer has had so far this month.
    Updated string
    When this Linode NodeBalancer was last updated
    clientConnThrottle Integer
    Throttle connections per second (0-20)
    created String
    When this Linode NodeBalancer was created
    hostname String
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    id Integer
    The Linode NodeBalancer's unique ID
    ipv4 String
    The Public IPv4 Address of this NodeBalancer
    ipv6 String
    The Public IPv6 Address of this NodeBalancer
    label String
    The label of the Linode NodeBalancer
    region String
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    tags List<String>
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    transfers List<GetNodebalancersNodebalancerTransfer>
    Information about the amount of transfer this NodeBalancer has had so far this month.
    updated String
    When this Linode NodeBalancer was last updated
    clientConnThrottle number
    Throttle connections per second (0-20)
    created string
    When this Linode NodeBalancer was created
    hostname string
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    id number
    The Linode NodeBalancer's unique ID
    ipv4 string
    The Public IPv4 Address of this NodeBalancer
    ipv6 string
    The Public IPv6 Address of this NodeBalancer
    label string
    The label of the Linode NodeBalancer
    region string
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    tags string[]
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    transfers GetNodebalancersNodebalancerTransfer[]
    Information about the amount of transfer this NodeBalancer has had so far this month.
    updated string
    When this Linode NodeBalancer was last updated
    client_conn_throttle int
    Throttle connections per second (0-20)
    created str
    When this Linode NodeBalancer was created
    hostname str
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    id int
    The Linode NodeBalancer's unique ID
    ipv4 str
    The Public IPv4 Address of this NodeBalancer
    ipv6 str
    The Public IPv6 Address of this NodeBalancer
    label str
    The label of the Linode NodeBalancer
    region str
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    tags Sequence[str]
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    transfers Sequence[GetNodebalancersNodebalancerTransfer]
    Information about the amount of transfer this NodeBalancer has had so far this month.
    updated str
    When this Linode NodeBalancer was last updated
    clientConnThrottle Number
    Throttle connections per second (0-20)
    created String
    When this Linode NodeBalancer was created
    hostname String
    This NodeBalancer's hostname, ending with .ip.linodeusercontent.com
    id Number
    The Linode NodeBalancer's unique ID
    ipv4 String
    The Public IPv4 Address of this NodeBalancer
    ipv6 String
    The Public IPv6 Address of this NodeBalancer
    label String
    The label of the Linode NodeBalancer
    region String
    The Region where this Linode NodeBalancer is located. NodeBalancers only support backends in the same Region.
    tags List<String>
    A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    transfers List<Property Map>
    Information about the amount of transfer this NodeBalancer has had so far this month.
    updated String
    When this Linode NodeBalancer was last updated

    GetNodebalancersNodebalancerTransfer

    In double
    The total transfer, in MB, used by this NodeBalancer for the current month
    Out double
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    Total double
    The total outbound transfer, in MB, used for this NodeBalancer for the current month
    In float64
    The total transfer, in MB, used by this NodeBalancer for the current month
    Out float64
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    Total float64
    The total outbound transfer, in MB, used for this NodeBalancer for the current month
    in Double
    The total transfer, in MB, used by this NodeBalancer for the current month
    out Double
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    total Double
    The total outbound transfer, in MB, used for this NodeBalancer for the current month
    in number
    The total transfer, in MB, used by this NodeBalancer for the current month
    out number
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    total number
    The total outbound transfer, in MB, used for this NodeBalancer for the current month
    in_ float
    The total transfer, in MB, used by this NodeBalancer for the current month
    out float
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    total float
    The total outbound transfer, in MB, used for this NodeBalancer for the current month
    in Number
    The total transfer, in MB, used by this NodeBalancer for the current month
    out Number
    The total inbound transfer, in MB, used for this NodeBalancer for the current month
    total Number
    The total outbound transfer, in MB, used for this NodeBalancer for the current month

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi