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

nxos.SpanningTreeInterface

Explore with Pulumi AI

This resource can manage the Spanning Tree interface configuration.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nxos = Lbrlabs.PulumiPackage.Nxos;

return await Deployment.RunAsync(() => 
{
    var example = new Nxos.SpanningTreeInterface("example", new()
    {
        AdminState = "enabled",
        BpduFilter = "enable",
        BpduGuard = "enable",
        Cost = 100,
        Guard = "root",
        InterfaceId = "eth1/9",
        LinkType = "p2p",
        Mode = "edge",
        Priority = 200,
    });

});
Copy
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.NewSpanningTreeInterface(ctx, "example", &nxos.SpanningTreeInterfaceArgs{
			AdminState:  pulumi.String("enabled"),
			BpduFilter:  pulumi.String("enable"),
			BpduGuard:   pulumi.String("enable"),
			Cost:        pulumi.Int(100),
			Guard:       pulumi.String("root"),
			InterfaceId: pulumi.String("eth1/9"),
			LinkType:    pulumi.String("p2p"),
			Mode:        pulumi.String("edge"),
			Priority:    pulumi.Int(200),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nxos.SpanningTreeInterface;
import com.pulumi.nxos.SpanningTreeInterfaceArgs;
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) {
        var example = new SpanningTreeInterface("example", SpanningTreeInterfaceArgs.builder()        
            .adminState("enabled")
            .bpduFilter("enable")
            .bpduGuard("enable")
            .cost(100)
            .guard("root")
            .interfaceId("eth1/9")
            .linkType("p2p")
            .mode("edge")
            .priority(200)
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as nxos from "@lbrlabs/pulumi-nxos";

const example = new nxos.SpanningTreeInterface("example", {
    adminState: "enabled",
    bpduFilter: "enable",
    bpduGuard: "enable",
    cost: 100,
    guard: "root",
    interfaceId: "eth1/9",
    linkType: "p2p",
    mode: "edge",
    priority: 200,
});
Copy
import pulumi
import lbrlabs_pulumi_nxos as nxos

example = nxos.SpanningTreeInterface("example",
    admin_state="enabled",
    bpdu_filter="enable",
    bpdu_guard="enable",
    cost=100,
    guard="root",
    interface_id="eth1/9",
    link_type="p2p",
    mode="edge",
    priority=200)
Copy
resources:
  example:
    type: nxos:SpanningTreeInterface
    properties:
      adminState: enabled
      bpduFilter: enable
      bpduGuard: enable
      cost: 100
      guard: root
      interfaceId: eth1/9
      linkType: p2p
      mode: edge
      priority: 200
Copy

Create SpanningTreeInterface Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SpanningTreeInterface(name: string, args: SpanningTreeInterfaceArgs, opts?: CustomResourceOptions);
@overload
def SpanningTreeInterface(resource_name: str,
                          args: SpanningTreeInterfaceArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def SpanningTreeInterface(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          interface_id: Optional[str] = None,
                          admin_state: Optional[str] = None,
                          bpdu_filter: Optional[str] = None,
                          bpdu_guard: Optional[str] = None,
                          cost: Optional[int] = None,
                          device: Optional[str] = None,
                          guard: Optional[str] = None,
                          link_type: Optional[str] = None,
                          mode: Optional[str] = None,
                          priority: Optional[int] = None)
func NewSpanningTreeInterface(ctx *Context, name string, args SpanningTreeInterfaceArgs, opts ...ResourceOption) (*SpanningTreeInterface, error)
public SpanningTreeInterface(string name, SpanningTreeInterfaceArgs args, CustomResourceOptions? opts = null)
public SpanningTreeInterface(String name, SpanningTreeInterfaceArgs args)
public SpanningTreeInterface(String name, SpanningTreeInterfaceArgs args, CustomResourceOptions options)
type: nxos:SpanningTreeInterface
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SpanningTreeInterfaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SpanningTreeInterfaceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SpanningTreeInterfaceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SpanningTreeInterfaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SpanningTreeInterfaceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var spanningTreeInterfaceResource = new Nxos.SpanningTreeInterface("spanningTreeInterfaceResource", new()
{
    InterfaceId = "string",
    AdminState = "string",
    BpduFilter = "string",
    BpduGuard = "string",
    Cost = 0,
    Device = "string",
    Guard = "string",
    LinkType = "string",
    Mode = "string",
    Priority = 0,
});
Copy
example, err := nxos.NewSpanningTreeInterface(ctx, "spanningTreeInterfaceResource", &nxos.SpanningTreeInterfaceArgs{
	InterfaceId: pulumi.String("string"),
	AdminState:  pulumi.String("string"),
	BpduFilter:  pulumi.String("string"),
	BpduGuard:   pulumi.String("string"),
	Cost:        pulumi.Int(0),
	Device:      pulumi.String("string"),
	Guard:       pulumi.String("string"),
	LinkType:    pulumi.String("string"),
	Mode:        pulumi.String("string"),
	Priority:    pulumi.Int(0),
})
Copy
var spanningTreeInterfaceResource = new SpanningTreeInterface("spanningTreeInterfaceResource", SpanningTreeInterfaceArgs.builder()
    .interfaceId("string")
    .adminState("string")
    .bpduFilter("string")
    .bpduGuard("string")
    .cost(0)
    .device("string")
    .guard("string")
    .linkType("string")
    .mode("string")
    .priority(0)
    .build());
Copy
spanning_tree_interface_resource = nxos.SpanningTreeInterface("spanningTreeInterfaceResource",
    interface_id="string",
    admin_state="string",
    bpdu_filter="string",
    bpdu_guard="string",
    cost=0,
    device="string",
    guard="string",
    link_type="string",
    mode="string",
    priority=0)
Copy
const spanningTreeInterfaceResource = new nxos.SpanningTreeInterface("spanningTreeInterfaceResource", {
    interfaceId: "string",
    adminState: "string",
    bpduFilter: "string",
    bpduGuard: "string",
    cost: 0,
    device: "string",
    guard: "string",
    linkType: "string",
    mode: "string",
    priority: 0,
});
Copy
type: nxos:SpanningTreeInterface
properties:
    adminState: string
    bpduFilter: string
    bpduGuard: string
    cost: 0
    device: string
    guard: string
    interfaceId: string
    linkType: string
    mode: string
    priority: 0
Copy

SpanningTreeInterface Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SpanningTreeInterface resource accepts the following input properties:

InterfaceId This property is required. string
Must match first field in the output of show intf brief. Example: eth1/1.
AdminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
BpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
BpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
Cost int
Port path cost. - Range: 0-200000000 - Default value: 0
Device string
A device name from the provider configuration.
Guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
LinkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
Mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
Priority int
Port priority. - Range: 0-224 - Default value: 128
InterfaceId This property is required. string
Must match first field in the output of show intf brief. Example: eth1/1.
AdminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
BpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
BpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
Cost int
Port path cost. - Range: 0-200000000 - Default value: 0
Device string
A device name from the provider configuration.
Guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
LinkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
Mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
Priority int
Port priority. - Range: 0-224 - Default value: 128
interfaceId This property is required. String
Must match first field in the output of show intf brief. Example: eth1/1.
adminState String
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter String
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard String
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost Integer
Port path cost. - Range: 0-200000000 - Default value: 0
device String
A device name from the provider configuration.
guard String
Guard mode. - Choices: default, root, loop, none - Default value: default
linkType String
Link type. - Choices: auto, p2p, shared - Default value: auto
mode String
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority Integer
Port priority. - Range: 0-224 - Default value: 128
interfaceId This property is required. string
Must match first field in the output of show intf brief. Example: eth1/1.
adminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost number
Port path cost. - Range: 0-200000000 - Default value: 0
device string
A device name from the provider configuration.
guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
linkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority number
Port priority. - Range: 0-224 - Default value: 128
interface_id This property is required. str
Must match first field in the output of show intf brief. Example: eth1/1.
admin_state str
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpdu_filter str
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpdu_guard str
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost int
Port path cost. - Range: 0-200000000 - Default value: 0
device str
A device name from the provider configuration.
guard str
Guard mode. - Choices: default, root, loop, none - Default value: default
link_type str
Link type. - Choices: auto, p2p, shared - Default value: auto
mode str
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority int
Port priority. - Range: 0-224 - Default value: 128
interfaceId This property is required. String
Must match first field in the output of show intf brief. Example: eth1/1.
adminState String
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter String
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard String
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost Number
Port path cost. - Range: 0-200000000 - Default value: 0
device String
A device name from the provider configuration.
guard String
Guard mode. - Choices: default, root, loop, none - Default value: default
linkType String
Link type. - Choices: auto, p2p, shared - Default value: auto
mode String
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority Number
Port priority. - Range: 0-224 - Default value: 128

Outputs

All input properties are implicitly available as output properties. Additionally, the SpanningTreeInterface resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SpanningTreeInterface Resource

Get an existing SpanningTreeInterface resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SpanningTreeInterfaceState, opts?: CustomResourceOptions): SpanningTreeInterface
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        admin_state: Optional[str] = None,
        bpdu_filter: Optional[str] = None,
        bpdu_guard: Optional[str] = None,
        cost: Optional[int] = None,
        device: Optional[str] = None,
        guard: Optional[str] = None,
        interface_id: Optional[str] = None,
        link_type: Optional[str] = None,
        mode: Optional[str] = None,
        priority: Optional[int] = None) -> SpanningTreeInterface
func GetSpanningTreeInterface(ctx *Context, name string, id IDInput, state *SpanningTreeInterfaceState, opts ...ResourceOption) (*SpanningTreeInterface, error)
public static SpanningTreeInterface Get(string name, Input<string> id, SpanningTreeInterfaceState? state, CustomResourceOptions? opts = null)
public static SpanningTreeInterface get(String name, Output<String> id, SpanningTreeInterfaceState state, CustomResourceOptions options)
resources:  _:    type: nxos:SpanningTreeInterface    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AdminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
BpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
BpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
Cost int
Port path cost. - Range: 0-200000000 - Default value: 0
Device string
A device name from the provider configuration.
Guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
InterfaceId string
Must match first field in the output of show intf brief. Example: eth1/1.
LinkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
Mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
Priority int
Port priority. - Range: 0-224 - Default value: 128
AdminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
BpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
BpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
Cost int
Port path cost. - Range: 0-200000000 - Default value: 0
Device string
A device name from the provider configuration.
Guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
InterfaceId string
Must match first field in the output of show intf brief. Example: eth1/1.
LinkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
Mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
Priority int
Port priority. - Range: 0-224 - Default value: 128
adminState String
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter String
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard String
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost Integer
Port path cost. - Range: 0-200000000 - Default value: 0
device String
A device name from the provider configuration.
guard String
Guard mode. - Choices: default, root, loop, none - Default value: default
interfaceId String
Must match first field in the output of show intf brief. Example: eth1/1.
linkType String
Link type. - Choices: auto, p2p, shared - Default value: auto
mode String
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority Integer
Port priority. - Range: 0-224 - Default value: 128
adminState string
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter string
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard string
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost number
Port path cost. - Range: 0-200000000 - Default value: 0
device string
A device name from the provider configuration.
guard string
Guard mode. - Choices: default, root, loop, none - Default value: default
interfaceId string
Must match first field in the output of show intf brief. Example: eth1/1.
linkType string
Link type. - Choices: auto, p2p, shared - Default value: auto
mode string
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority number
Port priority. - Range: 0-224 - Default value: 128
admin_state str
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpdu_filter str
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpdu_guard str
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost int
Port path cost. - Range: 0-200000000 - Default value: 0
device str
A device name from the provider configuration.
guard str
Guard mode. - Choices: default, root, loop, none - Default value: default
interface_id str
Must match first field in the output of show intf brief. Example: eth1/1.
link_type str
Link type. - Choices: auto, p2p, shared - Default value: auto
mode str
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority int
Port priority. - Range: 0-224 - Default value: 128
adminState String
The administrative state of the object or policy. - Choices: enabled, disabled - Default value: enabled
bpduFilter String
BPDU filter mode. - Choices: default, enable, disable - Default value: default
bpduGuard String
BPDU guard mode. - Choices: default, enable, disable - Default value: default
cost Number
Port path cost. - Range: 0-200000000 - Default value: 0
device String
A device name from the provider configuration.
guard String
Guard mode. - Choices: default, root, loop, none - Default value: default
interfaceId String
Must match first field in the output of show intf brief. Example: eth1/1.
linkType String
Link type. - Choices: auto, p2p, shared - Default value: auto
mode String
Port mode. - Choices: default, edge, network, normal, trunk - Default value: default
priority Number
Port priority. - Range: 0-224 - Default value: 128

Import

 $ pulumi import nxos:index/spanningTreeInterface:SpanningTreeInterface example "sys/stp/inst/if-[eth1/9]"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
nxos lbrlabs/pulumi-nxos
License
Apache-2.0
Notes
This Pulumi package is based on the nxos Terraform Provider.