netbox.DeviceInterface
Explore with Pulumi AI
From the official documentation:
Interfaces in NetBox represent network interfaces used to exchange data with connected devices. On modern networks, these are most commonly Ethernet, but other types are supported as well. IP addresses and VLANs can be assigned to interfaces.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
// Assumes a device with ID 123 exists
const test = new netbox.DeviceInterface("test", {
deviceId: 123,
type: "1000base-t",
});
import pulumi
import pulumi_netbox as netbox
# Assumes a device with ID 123 exists
test = netbox.DeviceInterface("test",
device_id=123,
type="1000base-t")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Assumes a device with ID 123 exists
_, err := netbox.NewDeviceInterface(ctx, "test", &netbox.DeviceInterfaceArgs{
DeviceId: pulumi.Float64(123),
Type: pulumi.String("1000base-t"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
// Assumes a device with ID 123 exists
var test = new Netbox.DeviceInterface("test", new()
{
DeviceId = 123,
Type = "1000base-t",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.DeviceInterface;
import com.pulumi.netbox.DeviceInterfaceArgs;
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) {
// Assumes a device with ID 123 exists
var test = new DeviceInterface("test", DeviceInterfaceArgs.builder()
.deviceId(123)
.type("1000base-t")
.build());
}
}
resources:
# Assumes a device with ID 123 exists
test:
type: netbox:DeviceInterface
properties:
deviceId: 123
type: 1000base-t
Create DeviceInterface Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DeviceInterface(name: string, args: DeviceInterfaceArgs, opts?: CustomResourceOptions);
@overload
def DeviceInterface(resource_name: str,
args: DeviceInterfaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DeviceInterface(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
device_id: Optional[float] = None,
mode: Optional[str] = None,
mtu: Optional[float] = None,
label: Optional[str] = None,
lag_device_interface_id: Optional[float] = None,
mac_address: Optional[str] = None,
mgmtonly: Optional[bool] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
parent_device_interface_id: Optional[float] = None,
speed: Optional[float] = None,
tagged_vlans: Optional[Sequence[float]] = None,
tags: Optional[Sequence[str]] = None,
device_interface_id: Optional[str] = None,
untagged_vlan: Optional[float] = None)
func NewDeviceInterface(ctx *Context, name string, args DeviceInterfaceArgs, opts ...ResourceOption) (*DeviceInterface, error)
public DeviceInterface(string name, DeviceInterfaceArgs args, CustomResourceOptions? opts = null)
public DeviceInterface(String name, DeviceInterfaceArgs args)
public DeviceInterface(String name, DeviceInterfaceArgs args, CustomResourceOptions options)
type: netbox:DeviceInterface
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DeviceInterfaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DeviceInterfaceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DeviceInterfaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeviceInterfaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DeviceInterfaceArgs
- 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 deviceInterfaceResource = new Netbox.DeviceInterface("deviceInterfaceResource", new()
{
Type = "string",
DeviceId = 0,
Mode = "string",
Mtu = 0,
Label = "string",
LagDeviceInterfaceId = 0,
MacAddress = "string",
Mgmtonly = false,
Description = "string",
Enabled = false,
Name = "string",
ParentDeviceInterfaceId = 0,
Speed = 0,
TaggedVlans = new[]
{
0,
},
Tags = new[]
{
"string",
},
DeviceInterfaceId = "string",
UntaggedVlan = 0,
});
example, err := netbox.NewDeviceInterface(ctx, "deviceInterfaceResource", &netbox.DeviceInterfaceArgs{
Type: pulumi.String("string"),
DeviceId: pulumi.Float64(0),
Mode: pulumi.String("string"),
Mtu: pulumi.Float64(0),
Label: pulumi.String("string"),
LagDeviceInterfaceId: pulumi.Float64(0),
MacAddress: pulumi.String("string"),
Mgmtonly: pulumi.Bool(false),
Description: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
ParentDeviceInterfaceId: pulumi.Float64(0),
Speed: pulumi.Float64(0),
TaggedVlans: pulumi.Float64Array{
pulumi.Float64(0),
},
Tags: pulumi.StringArray{
pulumi.String("string"),
},
DeviceInterfaceId: pulumi.String("string"),
UntaggedVlan: pulumi.Float64(0),
})
var deviceInterfaceResource = new DeviceInterface("deviceInterfaceResource", DeviceInterfaceArgs.builder()
.type("string")
.deviceId(0)
.mode("string")
.mtu(0)
.label("string")
.lagDeviceInterfaceId(0)
.macAddress("string")
.mgmtonly(false)
.description("string")
.enabled(false)
.name("string")
.parentDeviceInterfaceId(0)
.speed(0)
.taggedVlans(0)
.tags("string")
.deviceInterfaceId("string")
.untaggedVlan(0)
.build());
device_interface_resource = netbox.DeviceInterface("deviceInterfaceResource",
type="string",
device_id=0,
mode="string",
mtu=0,
label="string",
lag_device_interface_id=0,
mac_address="string",
mgmtonly=False,
description="string",
enabled=False,
name="string",
parent_device_interface_id=0,
speed=0,
tagged_vlans=[0],
tags=["string"],
device_interface_id="string",
untagged_vlan=0)
const deviceInterfaceResource = new netbox.DeviceInterface("deviceInterfaceResource", {
type: "string",
deviceId: 0,
mode: "string",
mtu: 0,
label: "string",
lagDeviceInterfaceId: 0,
macAddress: "string",
mgmtonly: false,
description: "string",
enabled: false,
name: "string",
parentDeviceInterfaceId: 0,
speed: 0,
taggedVlans: [0],
tags: ["string"],
deviceInterfaceId: "string",
untaggedVlan: 0,
});
type: netbox:DeviceInterface
properties:
description: string
deviceId: 0
deviceInterfaceId: string
enabled: false
label: string
lagDeviceInterfaceId: 0
macAddress: string
mgmtonly: false
mode: string
mtu: 0
name: string
parentDeviceInterfaceId: 0
speed: 0
taggedVlans:
- 0
tags:
- string
type: string
untaggedVlan: 0
DeviceInterface 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 DeviceInterface resource accepts the following input properties:
- Device
Id double - Type string
- Description string
- Device
Interface stringId - The ID of this resource.
- Enabled bool
- Defaults to
true
. - Label string
- Lag
Device doubleInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- Mac
Address string - Mgmtonly bool
- Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu double
- Name string
- Parent
Device doubleInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- Speed double
- Tagged
Vlans List<double> - List<string>
- Untagged
Vlan double
- Device
Id float64 - Type string
- Description string
- Device
Interface stringId - The ID of this resource.
- Enabled bool
- Defaults to
true
. - Label string
- Lag
Device float64Interface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- Mac
Address string - Mgmtonly bool
- Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu float64
- Name string
- Parent
Device float64Interface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- Speed float64
- Tagged
Vlans []float64 - []string
- Untagged
Vlan float64
- device
Id Double - type String
- description String
- device
Interface StringId - The ID of this resource.
- enabled Boolean
- Defaults to
true
. - label String
- lag
Device DoubleInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address String - mgmtonly Boolean
- mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Double
- name String
- parent
Device DoubleInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed Double
- tagged
Vlans List<Double> - List<String>
- untagged
Vlan Double
- device
Id number - type string
- description string
- device
Interface stringId - The ID of this resource.
- enabled boolean
- Defaults to
true
. - label string
- lag
Device numberInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address string - mgmtonly boolean
- mode string
- Valid values are
access
,tagged
andtagged-all
. - mtu number
- name string
- parent
Device numberInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed number
- tagged
Vlans number[] - string[]
- untagged
Vlan number
- device_
id float - type str
- description str
- device_
interface_ strid - The ID of this resource.
- enabled bool
- Defaults to
true
. - label str
- lag_
device_ floatinterface_ id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac_
address str - mgmtonly bool
- mode str
- Valid values are
access
,tagged
andtagged-all
. - mtu float
- name str
- parent_
device_ floatinterface_ id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed float
- tagged_
vlans Sequence[float] - Sequence[str]
- untagged_
vlan float
- device
Id Number - type String
- description String
- device
Interface StringId - The ID of this resource.
- enabled Boolean
- Defaults to
true
. - label String
- lag
Device NumberInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address String - mgmtonly Boolean
- mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Number
- name String
- parent
Device NumberInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed Number
- tagged
Vlans List<Number> - List<String>
- untagged
Vlan Number
Outputs
All input properties are implicitly available as output properties. Additionally, the DeviceInterface 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 DeviceInterface Resource
Get an existing DeviceInterface 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?: DeviceInterfaceState, opts?: CustomResourceOptions): DeviceInterface
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
device_id: Optional[float] = None,
device_interface_id: Optional[str] = None,
enabled: Optional[bool] = None,
label: Optional[str] = None,
lag_device_interface_id: Optional[float] = None,
mac_address: Optional[str] = None,
mgmtonly: Optional[bool] = None,
mode: Optional[str] = None,
mtu: Optional[float] = None,
name: Optional[str] = None,
parent_device_interface_id: Optional[float] = None,
speed: Optional[float] = None,
tagged_vlans: Optional[Sequence[float]] = None,
tags: Optional[Sequence[str]] = None,
type: Optional[str] = None,
untagged_vlan: Optional[float] = None) -> DeviceInterface
func GetDeviceInterface(ctx *Context, name string, id IDInput, state *DeviceInterfaceState, opts ...ResourceOption) (*DeviceInterface, error)
public static DeviceInterface Get(string name, Input<string> id, DeviceInterfaceState? state, CustomResourceOptions? opts = null)
public static DeviceInterface get(String name, Output<String> id, DeviceInterfaceState state, CustomResourceOptions options)
resources: _: type: netbox:DeviceInterface get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Description string
- Device
Id double - Device
Interface stringId - The ID of this resource.
- Enabled bool
- Defaults to
true
. - Label string
- Lag
Device doubleInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- Mac
Address string - Mgmtonly bool
- Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu double
- Name string
- Parent
Device doubleInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- Speed double
- Tagged
Vlans List<double> - List<string>
- Type string
- Untagged
Vlan double
- Description string
- Device
Id float64 - Device
Interface stringId - The ID of this resource.
- Enabled bool
- Defaults to
true
. - Label string
- Lag
Device float64Interface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- Mac
Address string - Mgmtonly bool
- Mode string
- Valid values are
access
,tagged
andtagged-all
. - Mtu float64
- Name string
- Parent
Device float64Interface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- Speed float64
- Tagged
Vlans []float64 - []string
- Type string
- Untagged
Vlan float64
- description String
- device
Id Double - device
Interface StringId - The ID of this resource.
- enabled Boolean
- Defaults to
true
. - label String
- lag
Device DoubleInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address String - mgmtonly Boolean
- mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Double
- name String
- parent
Device DoubleInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed Double
- tagged
Vlans List<Double> - List<String>
- type String
- untagged
Vlan Double
- description string
- device
Id number - device
Interface stringId - The ID of this resource.
- enabled boolean
- Defaults to
true
. - label string
- lag
Device numberInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address string - mgmtonly boolean
- mode string
- Valid values are
access
,tagged
andtagged-all
. - mtu number
- name string
- parent
Device numberInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed number
- tagged
Vlans number[] - string[]
- type string
- untagged
Vlan number
- description str
- device_
id float - device_
interface_ strid - The ID of this resource.
- enabled bool
- Defaults to
true
. - label str
- lag_
device_ floatinterface_ id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac_
address str - mgmtonly bool
- mode str
- Valid values are
access
,tagged
andtagged-all
. - mtu float
- name str
- parent_
device_ floatinterface_ id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed float
- tagged_
vlans Sequence[float] - Sequence[str]
- type str
- untagged_
vlan float
- description String
- device
Id Number - device
Interface StringId - The ID of this resource.
- enabled Boolean
- Defaults to
true
. - label String
- lag
Device NumberInterface Id - If this device is a member of a LAG group, you can reference the LAG interface here.
- mac
Address String - mgmtonly Boolean
- mode String
- Valid values are
access
,tagged
andtagged-all
. - mtu Number
- name String
- parent
Device NumberInterface Id - The netboxdeviceinterface id of the parent interface. Useful if this interface is a logical interface.
- speed Number
- tagged
Vlans List<Number> - List<String>
- type String
- untagged
Vlan Number
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.