1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. getRouter
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

openstack.networking.getRouter

Explore with Pulumi AI

openstack logo
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

    Use this data source to get the ID of an available OpenStack router.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const router = openstack.networking.getRouter({
        name: "router_1",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    router = openstack.networking.get_router(name="router_1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networking.LookupRouter(ctx, &networking.LookupRouterArgs{
    			Name: pulumi.StringRef("router_1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var router = OpenStack.Networking.GetRouter.Invoke(new()
        {
            Name = "router_1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.networking.NetworkingFunctions;
    import com.pulumi.openstack.networking.inputs.GetRouterArgs;
    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 router = NetworkingFunctions.getRouter(GetRouterArgs.builder()
                .name("router_1")
                .build());
    
        }
    }
    
    variables:
      router:
        fn::invoke:
          Function: openstack:networking:getRouter
          Arguments:
            name: router_1
    

    Using getRouter

    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 getRouter(args: GetRouterArgs, opts?: InvokeOptions): Promise<GetRouterResult>
    function getRouterOutput(args: GetRouterOutputArgs, opts?: InvokeOptions): Output<GetRouterResult>
    def get_router(admin_state_up: Optional[bool] = None,
                   description: Optional[str] = None,
                   distributed: Optional[bool] = None,
                   enable_snat: Optional[bool] = None,
                   name: Optional[str] = None,
                   region: Optional[str] = None,
                   router_id: Optional[str] = None,
                   status: Optional[str] = None,
                   tags: Optional[Sequence[str]] = None,
                   tenant_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRouterResult
    def get_router_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
                   description: Optional[pulumi.Input[str]] = None,
                   distributed: Optional[pulumi.Input[bool]] = None,
                   enable_snat: Optional[pulumi.Input[bool]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   region: Optional[pulumi.Input[str]] = None,
                   router_id: Optional[pulumi.Input[str]] = None,
                   status: Optional[pulumi.Input[str]] = None,
                   tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   tenant_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetRouterResult]
    func LookupRouter(ctx *Context, args *LookupRouterArgs, opts ...InvokeOption) (*LookupRouterResult, error)
    func LookupRouterOutput(ctx *Context, args *LookupRouterOutputArgs, opts ...InvokeOption) LookupRouterResultOutput

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

    public static class GetRouter 
    {
        public static Task<GetRouterResult> InvokeAsync(GetRouterArgs args, InvokeOptions? opts = null)
        public static Output<GetRouterResult> Invoke(GetRouterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRouterResult> getRouter(GetRouterArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:networking/getRouter:getRouter
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AdminStateUp bool
    Administrative up/down status for the router (must be "true" or "false" if provided).
    Description string
    Human-readable description of the router.
    Distributed bool
    Indicates whether or not to get a distributed router.
    EnableSnat bool
    The value that points out if the Source NAT is enabled on the router.
    Name string
    The name of the router.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    RouterId string
    The UUID of the router resource.
    Status string
    The status of the router (ACTIVE/DOWN).
    Tags List<string>
    The list of router tags to filter.
    TenantId string
    The owner of the router.
    AdminStateUp bool
    Administrative up/down status for the router (must be "true" or "false" if provided).
    Description string
    Human-readable description of the router.
    Distributed bool
    Indicates whether or not to get a distributed router.
    EnableSnat bool
    The value that points out if the Source NAT is enabled on the router.
    Name string
    The name of the router.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    RouterId string
    The UUID of the router resource.
    Status string
    The status of the router (ACTIVE/DOWN).
    Tags []string
    The list of router tags to filter.
    TenantId string
    The owner of the router.
    adminStateUp Boolean
    Administrative up/down status for the router (must be "true" or "false" if provided).
    description String
    Human-readable description of the router.
    distributed Boolean
    Indicates whether or not to get a distributed router.
    enableSnat Boolean
    The value that points out if the Source NAT is enabled on the router.
    name String
    The name of the router.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    routerId String
    The UUID of the router resource.
    status String
    The status of the router (ACTIVE/DOWN).
    tags List<String>
    The list of router tags to filter.
    tenantId String
    The owner of the router.
    adminStateUp boolean
    Administrative up/down status for the router (must be "true" or "false" if provided).
    description string
    Human-readable description of the router.
    distributed boolean
    Indicates whether or not to get a distributed router.
    enableSnat boolean
    The value that points out if the Source NAT is enabled on the router.
    name string
    The name of the router.
    region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    routerId string
    The UUID of the router resource.
    status string
    The status of the router (ACTIVE/DOWN).
    tags string[]
    The list of router tags to filter.
    tenantId string
    The owner of the router.
    admin_state_up bool
    Administrative up/down status for the router (must be "true" or "false" if provided).
    description str
    Human-readable description of the router.
    distributed bool
    Indicates whether or not to get a distributed router.
    enable_snat bool
    The value that points out if the Source NAT is enabled on the router.
    name str
    The name of the router.
    region str
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    router_id str
    The UUID of the router resource.
    status str
    The status of the router (ACTIVE/DOWN).
    tags Sequence[str]
    The list of router tags to filter.
    tenant_id str
    The owner of the router.
    adminStateUp Boolean
    Administrative up/down status for the router (must be "true" or "false" if provided).
    description String
    Human-readable description of the router.
    distributed Boolean
    Indicates whether or not to get a distributed router.
    enableSnat Boolean
    The value that points out if the Source NAT is enabled on the router.
    name String
    The name of the router.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve router ids. If omitted, the region argument of the provider is used.
    routerId String
    The UUID of the router resource.
    status String
    The status of the router (ACTIVE/DOWN).
    tags List<String>
    The list of router tags to filter.
    tenantId String
    The owner of the router.

    getRouter Result

    The following output properties are available:

    AllTags List<string>
    The set of string tags applied on the router.
    AvailabilityZoneHints List<string>
    The availability zone that is used to make router resources highly available.
    EnableSnat bool
    The value that points out if the Source NAT is enabled on the router.
    ExternalFixedIps List<Pulumi.OpenStack.Networking.Outputs.GetRouterExternalFixedIp>
    The external fixed IPs of the router.
    ExternalNetworkId string
    The network UUID of an external gateway for the router.
    Id string
    The provider-assigned unique ID for this managed resource.
    AdminStateUp bool
    Description string
    Distributed bool
    Name string
    Region string
    RouterId string
    Status string
    Tags List<string>
    TenantId string
    AllTags []string
    The set of string tags applied on the router.
    AvailabilityZoneHints []string
    The availability zone that is used to make router resources highly available.
    EnableSnat bool
    The value that points out if the Source NAT is enabled on the router.
    ExternalFixedIps []GetRouterExternalFixedIp
    The external fixed IPs of the router.
    ExternalNetworkId string
    The network UUID of an external gateway for the router.
    Id string
    The provider-assigned unique ID for this managed resource.
    AdminStateUp bool
    Description string
    Distributed bool
    Name string
    Region string
    RouterId string
    Status string
    Tags []string
    TenantId string
    allTags List<String>
    The set of string tags applied on the router.
    availabilityZoneHints List<String>
    The availability zone that is used to make router resources highly available.
    enableSnat Boolean
    The value that points out if the Source NAT is enabled on the router.
    externalFixedIps List<GetRouterExternalFixedIp>
    The external fixed IPs of the router.
    externalNetworkId String
    The network UUID of an external gateway for the router.
    id String
    The provider-assigned unique ID for this managed resource.
    adminStateUp Boolean
    description String
    distributed Boolean
    name String
    region String
    routerId String
    status String
    tags List<String>
    tenantId String
    allTags string[]
    The set of string tags applied on the router.
    availabilityZoneHints string[]
    The availability zone that is used to make router resources highly available.
    enableSnat boolean
    The value that points out if the Source NAT is enabled on the router.
    externalFixedIps GetRouterExternalFixedIp[]
    The external fixed IPs of the router.
    externalNetworkId string
    The network UUID of an external gateway for the router.
    id string
    The provider-assigned unique ID for this managed resource.
    adminStateUp boolean
    description string
    distributed boolean
    name string
    region string
    routerId string
    status string
    tags string[]
    tenantId string
    all_tags Sequence[str]
    The set of string tags applied on the router.
    availability_zone_hints Sequence[str]
    The availability zone that is used to make router resources highly available.
    enable_snat bool
    The value that points out if the Source NAT is enabled on the router.
    external_fixed_ips Sequence[GetRouterExternalFixedIp]
    The external fixed IPs of the router.
    external_network_id str
    The network UUID of an external gateway for the router.
    id str
    The provider-assigned unique ID for this managed resource.
    admin_state_up bool
    description str
    distributed bool
    name str
    region str
    router_id str
    status str
    tags Sequence[str]
    tenant_id str
    allTags List<String>
    The set of string tags applied on the router.
    availabilityZoneHints List<String>
    The availability zone that is used to make router resources highly available.
    enableSnat Boolean
    The value that points out if the Source NAT is enabled on the router.
    externalFixedIps List<Property Map>
    The external fixed IPs of the router.
    externalNetworkId String
    The network UUID of an external gateway for the router.
    id String
    The provider-assigned unique ID for this managed resource.
    adminStateUp Boolean
    description String
    distributed Boolean
    name String
    region String
    routerId String
    status String
    tags List<String>
    tenantId String

    Supporting Types

    GetRouterExternalFixedIp

    IpAddress string
    The IP address to set on the router.
    SubnetId string
    Subnet in which the fixed IP belongs to.
    IpAddress string
    The IP address to set on the router.
    SubnetId string
    Subnet in which the fixed IP belongs to.
    ipAddress String
    The IP address to set on the router.
    subnetId String
    Subnet in which the fixed IP belongs to.
    ipAddress string
    The IP address to set on the router.
    subnetId string
    Subnet in which the fixed IP belongs to.
    ip_address str
    The IP address to set on the router.
    subnet_id str
    Subnet in which the fixed IP belongs to.
    ipAddress String
    The IP address to set on the router.
    subnetId String
    Subnet in which the fixed IP belongs to.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi