1. Packages
  2. Cisco IOS XE Resource Provider
  3. API Docs
  4. getInterfaceSwitchport
Cisco IOS XE v0.0.1 published on Friday, Sep 22, 2023 by lbrlabs

iosxe.getInterfaceSwitchport

Explore with Pulumi AI

iosxe logo
Cisco IOS XE v0.0.1 published on Friday, Sep 22, 2023 by lbrlabs

    This data source can read the Interface Switchport configuration.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Iosxe = Pulumi.Iosxe;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Iosxe.GetInterfaceSwitchport.Invoke(new()
        {
            Name = "1/0/3",
            Type = "GigabitEthernet",
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-iosxe/sdk/go/iosxe"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iosxe.LookupInterfaceSwitchport(ctx, &iosxe.LookupInterfaceSwitchportArgs{
    			Name: "1/0/3",
    			Type: "GigabitEthernet",
    		}, 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.iosxe.IosxeFunctions;
    import com.pulumi.iosxe.inputs.GetInterfaceSwitchportArgs;
    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 = IosxeFunctions.getInterfaceSwitchport(GetInterfaceSwitchportArgs.builder()
                .name("1/0/3")
                .type("GigabitEthernet")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_iosxe as iosxe
    
    example = iosxe.get_interface_switchport(name="1/0/3",
        type="GigabitEthernet")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as iosxe from "@pulumi/iosxe";
    
    const example = iosxe.getInterfaceSwitchport({
        name: "1/0/3",
        type: "GigabitEthernet",
    });
    
    variables:
      example:
        fn::invoke:
          Function: iosxe:getInterfaceSwitchport
          Arguments:
            name: 1/0/3
            type: GigabitEthernet
    

    Using getInterfaceSwitchport

    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 getInterfaceSwitchport(args: GetInterfaceSwitchportArgs, opts?: InvokeOptions): Promise<GetInterfaceSwitchportResult>
    function getInterfaceSwitchportOutput(args: GetInterfaceSwitchportOutputArgs, opts?: InvokeOptions): Output<GetInterfaceSwitchportResult>
    def get_interface_switchport(device: Optional[str] = None,
                                 name: Optional[str] = None,
                                 type: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetInterfaceSwitchportResult
    def get_interface_switchport_output(device: Optional[pulumi.Input[str]] = None,
                                 name: Optional[pulumi.Input[str]] = None,
                                 type: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetInterfaceSwitchportResult]
    func LookupInterfaceSwitchport(ctx *Context, args *LookupInterfaceSwitchportArgs, opts ...InvokeOption) (*LookupInterfaceSwitchportResult, error)
    func LookupInterfaceSwitchportOutput(ctx *Context, args *LookupInterfaceSwitchportOutputArgs, opts ...InvokeOption) LookupInterfaceSwitchportResultOutput

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

    public static class GetInterfaceSwitchport 
    {
        public static Task<GetInterfaceSwitchportResult> InvokeAsync(GetInterfaceSwitchportArgs args, InvokeOptions? opts = null)
        public static Output<GetInterfaceSwitchportResult> Invoke(GetInterfaceSwitchportInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInterfaceSwitchportResult> getInterfaceSwitchport(GetInterfaceSwitchportArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: iosxe:index/getInterfaceSwitchport:getInterfaceSwitchport
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Type string
    Interface type
    Device string
    A device name from the provider configuration.
    Name string
    Type string
    Interface type
    Device string
    A device name from the provider configuration.
    name String
    type String
    Interface type
    device String
    A device name from the provider configuration.
    name string
    type string
    Interface type
    device string
    A device name from the provider configuration.
    name str
    type str
    Interface type
    device str
    A device name from the provider configuration.
    name String
    type String
    Interface type
    device String
    A device name from the provider configuration.

    getInterfaceSwitchport Result

    The following output properties are available:

    AccessVlan string
    Host bool
    Set port host
    Id string
    The path of the retrieved object.
    ModeAccess bool
    Set trunking mode to ACCESS unconditionally
    ModeDot1qTunnel bool
    set trunking mode to TUNNEL unconditionally
    ModePrivateVlanHost bool
    Set the mode to private-vlan host
    ModePrivateVlanPromiscuous bool
    Set the mode to private-vlan promiscuous
    ModePrivateVlanTrunk bool
    Set the mode to private-vlan trunk
    ModeTrunk bool
    Set trunking mode to TRUNK unconditionally
    Name string
    Nonegotiate bool
    Device will not engage in negotiation protocol on this interface
    TrunkAllowedVlans string
    TrunkAllowedVlansNone bool
    no VLANs
    TrunkNativeVlan int
    TrunkNativeVlanTag bool
    Type string
    Interface type
    Device string
    A device name from the provider configuration.
    AccessVlan string
    Host bool
    Set port host
    Id string
    The path of the retrieved object.
    ModeAccess bool
    Set trunking mode to ACCESS unconditionally
    ModeDot1qTunnel bool
    set trunking mode to TUNNEL unconditionally
    ModePrivateVlanHost bool
    Set the mode to private-vlan host
    ModePrivateVlanPromiscuous bool
    Set the mode to private-vlan promiscuous
    ModePrivateVlanTrunk bool
    Set the mode to private-vlan trunk
    ModeTrunk bool
    Set trunking mode to TRUNK unconditionally
    Name string
    Nonegotiate bool
    Device will not engage in negotiation protocol on this interface
    TrunkAllowedVlans string
    TrunkAllowedVlansNone bool
    no VLANs
    TrunkNativeVlan int
    TrunkNativeVlanTag bool
    Type string
    Interface type
    Device string
    A device name from the provider configuration.
    accessVlan String
    host Boolean
    Set port host
    id String
    The path of the retrieved object.
    modeAccess Boolean
    Set trunking mode to ACCESS unconditionally
    modeDot1qTunnel Boolean
    set trunking mode to TUNNEL unconditionally
    modePrivateVlanHost Boolean
    Set the mode to private-vlan host
    modePrivateVlanPromiscuous Boolean
    Set the mode to private-vlan promiscuous
    modePrivateVlanTrunk Boolean
    Set the mode to private-vlan trunk
    modeTrunk Boolean
    Set trunking mode to TRUNK unconditionally
    name String
    nonegotiate Boolean
    Device will not engage in negotiation protocol on this interface
    trunkAllowedVlans String
    trunkAllowedVlansNone Boolean
    no VLANs
    trunkNativeVlan Integer
    trunkNativeVlanTag Boolean
    type String
    Interface type
    device String
    A device name from the provider configuration.
    accessVlan string
    host boolean
    Set port host
    id string
    The path of the retrieved object.
    modeAccess boolean
    Set trunking mode to ACCESS unconditionally
    modeDot1qTunnel boolean
    set trunking mode to TUNNEL unconditionally
    modePrivateVlanHost boolean
    Set the mode to private-vlan host
    modePrivateVlanPromiscuous boolean
    Set the mode to private-vlan promiscuous
    modePrivateVlanTrunk boolean
    Set the mode to private-vlan trunk
    modeTrunk boolean
    Set trunking mode to TRUNK unconditionally
    name string
    nonegotiate boolean
    Device will not engage in negotiation protocol on this interface
    trunkAllowedVlans string
    trunkAllowedVlansNone boolean
    no VLANs
    trunkNativeVlan number
    trunkNativeVlanTag boolean
    type string
    Interface type
    device string
    A device name from the provider configuration.
    access_vlan str
    host bool
    Set port host
    id str
    The path of the retrieved object.
    mode_access bool
    Set trunking mode to ACCESS unconditionally
    mode_dot1q_tunnel bool
    set trunking mode to TUNNEL unconditionally
    mode_private_vlan_host bool
    Set the mode to private-vlan host
    mode_private_vlan_promiscuous bool
    Set the mode to private-vlan promiscuous
    mode_private_vlan_trunk bool
    Set the mode to private-vlan trunk
    mode_trunk bool
    Set trunking mode to TRUNK unconditionally
    name str
    nonegotiate bool
    Device will not engage in negotiation protocol on this interface
    trunk_allowed_vlans str
    trunk_allowed_vlans_none bool
    no VLANs
    trunk_native_vlan int
    trunk_native_vlan_tag bool
    type str
    Interface type
    device str
    A device name from the provider configuration.
    accessVlan String
    host Boolean
    Set port host
    id String
    The path of the retrieved object.
    modeAccess Boolean
    Set trunking mode to ACCESS unconditionally
    modeDot1qTunnel Boolean
    set trunking mode to TUNNEL unconditionally
    modePrivateVlanHost Boolean
    Set the mode to private-vlan host
    modePrivateVlanPromiscuous Boolean
    Set the mode to private-vlan promiscuous
    modePrivateVlanTrunk Boolean
    Set the mode to private-vlan trunk
    modeTrunk Boolean
    Set trunking mode to TRUNK unconditionally
    name String
    nonegotiate Boolean
    Device will not engage in negotiation protocol on this interface
    trunkAllowedVlans String
    trunkAllowedVlansNone Boolean
    no VLANs
    trunkNativeVlan Number
    trunkNativeVlanTag Boolean
    type String
    Interface type
    device String
    A device name from the provider configuration.

    Package Details

    Repository
    iosxe lbrlabs/pulumi-iosxe
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the iosxe Terraform Provider.
    iosxe logo
    Cisco IOS XE v0.0.1 published on Friday, Sep 22, 2023 by lbrlabs