1. Packages
  2. Cisco NX OS Resource Provider
  3. API Docs
  4. getIpv4StaticRoute
Cisco NX-OS v0.0.2 published on Friday, Sep 29, 2023 by lbrlabs

nxos.getIpv4StaticRoute

Explore with Pulumi AI

nxos logo
Cisco NX-OS v0.0.2 published on Friday, Sep 29, 2023 by lbrlabs

    This data source can read an IPv4 static route.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nxos = Pulumi.Nxos;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Nxos.GetIpv4StaticRoute.Invoke(new()
        {
            Prefix = "1.1.1.0/24",
            VrfName = "default",
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-nxos/sdk/go/nxos"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nxos.LookupIpv4StaticRoute(ctx, &nxos.LookupIpv4StaticRouteArgs{
    			Prefix:  "1.1.1.0/24",
    			VrfName: "default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nxos.NxosFunctions;
    import com.pulumi.nxos.inputs.GetIpv4StaticRouteArgs;
    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 example = NxosFunctions.getIpv4StaticRoute(GetIpv4StaticRouteArgs.builder()
                .prefix("1.1.1.0/24")
                .vrfName("default")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_nxos as nxos
    
    example = nxos.get_ipv4_static_route(prefix="1.1.1.0/24",
        vrf_name="default")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as nxos from "@pulumi/nxos";
    
    const example = nxos.getIpv4StaticRoute({
        prefix: "1.1.1.0/24",
        vrfName: "default",
    });
    
    variables:
      example:
        fn::invoke:
          Function: nxos:getIpv4StaticRoute
          Arguments:
            prefix: 1.1.1.0/24
            vrfName: default
    

    Using getIpv4StaticRoute

    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 getIpv4StaticRoute(args: GetIpv4StaticRouteArgs, opts?: InvokeOptions): Promise<GetIpv4StaticRouteResult>
    function getIpv4StaticRouteOutput(args: GetIpv4StaticRouteOutputArgs, opts?: InvokeOptions): Output<GetIpv4StaticRouteResult>
    def get_ipv4_static_route(device: Optional[str] = None,
                              prefix: Optional[str] = None,
                              vrf_name: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetIpv4StaticRouteResult
    def get_ipv4_static_route_output(device: Optional[pulumi.Input[str]] = None,
                              prefix: Optional[pulumi.Input[str]] = None,
                              vrf_name: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetIpv4StaticRouteResult]
    func LookupIpv4StaticRoute(ctx *Context, args *LookupIpv4StaticRouteArgs, opts ...InvokeOption) (*LookupIpv4StaticRouteResult, error)
    func LookupIpv4StaticRouteOutput(ctx *Context, args *LookupIpv4StaticRouteOutputArgs, opts ...InvokeOption) LookupIpv4StaticRouteResultOutput

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

    public static class GetIpv4StaticRoute 
    {
        public static Task<GetIpv4StaticRouteResult> InvokeAsync(GetIpv4StaticRouteArgs args, InvokeOptions? opts = null)
        public static Output<GetIpv4StaticRouteResult> Invoke(GetIpv4StaticRouteInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIpv4StaticRouteResult> getIpv4StaticRoute(GetIpv4StaticRouteArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: nxos:index/getIpv4StaticRoute:getIpv4StaticRoute
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Prefix string
    Prefix.
    VrfName string
    VRF name.
    Device string
    A device name from the provider configuration.
    Prefix string
    Prefix.
    VrfName string
    VRF name.
    Device string
    A device name from the provider configuration.
    prefix String
    Prefix.
    vrfName String
    VRF name.
    device String
    A device name from the provider configuration.
    prefix string
    Prefix.
    vrfName string
    VRF name.
    device string
    A device name from the provider configuration.
    prefix str
    Prefix.
    vrf_name str
    VRF name.
    device str
    A device name from the provider configuration.
    prefix String
    Prefix.
    vrfName String
    VRF name.
    device String
    A device name from the provider configuration.

    getIpv4StaticRoute Result

    The following output properties are available:

    Id string
    The distinguished name of the object.
    NextHops List<Lbrlabs.PulumiPackage.Nxos.Outputs.GetIpv4StaticRouteNextHop>
    List of next hops.
    Prefix string
    Prefix.
    VrfName string
    VRF name.
    Device string
    A device name from the provider configuration.
    Id string
    The distinguished name of the object.
    NextHops []GetIpv4StaticRouteNextHop
    List of next hops.
    Prefix string
    Prefix.
    VrfName string
    VRF name.
    Device string
    A device name from the provider configuration.
    id String
    The distinguished name of the object.
    nextHops List<GetIpv4StaticRouteNextHop>
    List of next hops.
    prefix String
    Prefix.
    vrfName String
    VRF name.
    device String
    A device name from the provider configuration.
    id string
    The distinguished name of the object.
    nextHops GetIpv4StaticRouteNextHop[]
    List of next hops.
    prefix string
    Prefix.
    vrfName string
    VRF name.
    device string
    A device name from the provider configuration.
    id str
    The distinguished name of the object.
    next_hops Sequence[GetIpv4StaticRouteNextHop]
    List of next hops.
    prefix str
    Prefix.
    vrf_name str
    VRF name.
    device str
    A device name from the provider configuration.
    id String
    The distinguished name of the object.
    nextHops List<Property Map>
    List of next hops.
    prefix String
    Prefix.
    vrfName String
    VRF name.
    device String
    A device name from the provider configuration.

    Supporting Types

    GetIpv4StaticRouteNextHop

    Address string
    Nexthop address.
    Description string
    Description.
    InterfaceId string
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    Object int
    Object to be tracked.
    Preference int
    Route preference.
    Tag int
    Tag value.
    VrfName string
    Nexthop VRF.
    Address string
    Nexthop address.
    Description string
    Description.
    InterfaceId string
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    Object int
    Object to be tracked.
    Preference int
    Route preference.
    Tag int
    Tag value.
    VrfName string
    Nexthop VRF.
    address String
    Nexthop address.
    description String
    Description.
    interfaceId String
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    object Integer
    Object to be tracked.
    preference Integer
    Route preference.
    tag Integer
    Tag value.
    vrfName String
    Nexthop VRF.
    address string
    Nexthop address.
    description string
    Description.
    interfaceId string
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    object number
    Object to be tracked.
    preference number
    Route preference.
    tag number
    Tag value.
    vrfName string
    Nexthop VRF.
    address str
    Nexthop address.
    description str
    Description.
    interface_id str
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    object int
    Object to be tracked.
    preference int
    Route preference.
    tag int
    Tag value.
    vrf_name str
    Nexthop VRF.
    address String
    Nexthop address.
    description String
    Description.
    interfaceId String
    Must match first field in the output of show intf brief or unspecified. Example: eth1/1 or vlan100.
    object Number
    Object to be tracked.
    preference Number
    Route preference.
    tag Number
    Tag value.
    vrfName String
    Nexthop VRF.

    Package Details

    Repository
    nxos lbrlabs/pulumi-nxos
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nxos Terraform Provider.
    nxos logo
    Cisco NX-OS v0.0.2 published on Friday, Sep 29, 2023 by lbrlabs