1. Packages
  2. Netbox Provider
  3. API Docs
  4. InterfaceTemplate
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.InterfaceTemplate

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    From the official documentation:

    A template for a network interface that will be created on all instantiations of the parent device type. See the interface documentation for more detail.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const testManufacturer = new netbox.Manufacturer("testManufacturer", {});
    const testDeviceType = new netbox.DeviceType("testDeviceType", {
        model: "test-model",
        slug: "test-model",
        partNumber: "test-part-number",
        manufacturerId: testManufacturer.manufacturerId,
    });
    const testInterfaceTemplate = new netbox.InterfaceTemplate("testInterfaceTemplate", {
        description: "eth0 description",
        label: "eth0 label",
        deviceTypeId: testDeviceType.deviceTypeId,
        type: "100base-tx",
        mgmtOnly: true,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_manufacturer = netbox.Manufacturer("testManufacturer")
    test_device_type = netbox.DeviceType("testDeviceType",
        model="test-model",
        slug="test-model",
        part_number="test-part-number",
        manufacturer_id=test_manufacturer.manufacturer_id)
    test_interface_template = netbox.InterfaceTemplate("testInterfaceTemplate",
        description="eth0 description",
        label="eth0 label",
        device_type_id=test_device_type.device_type_id,
        type="100base-tx",
        mgmt_only=True)
    
    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 {
    		testManufacturer, err := netbox.NewManufacturer(ctx, "testManufacturer", nil)
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "testDeviceType", &netbox.DeviceTypeArgs{
    			Model:          pulumi.String("test-model"),
    			Slug:           pulumi.String("test-model"),
    			PartNumber:     pulumi.String("test-part-number"),
    			ManufacturerId: testManufacturer.ManufacturerId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewInterfaceTemplate(ctx, "testInterfaceTemplate", &netbox.InterfaceTemplateArgs{
    			Description:  pulumi.String("eth0 description"),
    			Label:        pulumi.String("eth0 label"),
    			DeviceTypeId: testDeviceType.DeviceTypeId,
    			Type:         pulumi.String("100base-tx"),
    			MgmtOnly:     pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        var testManufacturer = new Netbox.Manufacturer("testManufacturer");
    
        var testDeviceType = new Netbox.DeviceType("testDeviceType", new()
        {
            Model = "test-model",
            Slug = "test-model",
            PartNumber = "test-part-number",
            ManufacturerId = testManufacturer.ManufacturerId,
        });
    
        var testInterfaceTemplate = new Netbox.InterfaceTemplate("testInterfaceTemplate", new()
        {
            Description = "eth0 description",
            Label = "eth0 label",
            DeviceTypeId = testDeviceType.DeviceTypeId,
            Type = "100base-tx",
            MgmtOnly = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Manufacturer;
    import com.pulumi.netbox.DeviceType;
    import com.pulumi.netbox.DeviceTypeArgs;
    import com.pulumi.netbox.InterfaceTemplate;
    import com.pulumi.netbox.InterfaceTemplateArgs;
    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 testManufacturer = new Manufacturer("testManufacturer");
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .model("test-model")
                .slug("test-model")
                .partNumber("test-part-number")
                .manufacturerId(testManufacturer.manufacturerId())
                .build());
    
            var testInterfaceTemplate = new InterfaceTemplate("testInterfaceTemplate", InterfaceTemplateArgs.builder()
                .description("eth0 description")
                .label("eth0 label")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .type("100base-tx")
                .mgmtOnly(true)
                .build());
    
        }
    }
    
    resources:
      testManufacturer:
        type: netbox:Manufacturer
      testDeviceType:
        type: netbox:DeviceType
        properties:
          model: test-model
          slug: test-model
          partNumber: test-part-number
          manufacturerId: ${testManufacturer.manufacturerId}
      testInterfaceTemplate:
        type: netbox:InterfaceTemplate
        properties:
          description: eth0 description
          label: eth0 label
          deviceTypeId: ${testDeviceType.deviceTypeId}
          type: 100base-tx
          mgmtOnly: true
    

    Create InterfaceTemplate Resource

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

    Constructor syntax

    new InterfaceTemplate(name: string, args: InterfaceTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def InterfaceTemplate(resource_name: str,
                          args: InterfaceTemplateArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def InterfaceTemplate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          type: Optional[str] = None,
                          description: Optional[str] = None,
                          device_type_id: Optional[float] = None,
                          interface_template_id: Optional[str] = None,
                          label: Optional[str] = None,
                          mgmt_only: Optional[bool] = None,
                          module_type_id: Optional[float] = None,
                          name: Optional[str] = None)
    func NewInterfaceTemplate(ctx *Context, name string, args InterfaceTemplateArgs, opts ...ResourceOption) (*InterfaceTemplate, error)
    public InterfaceTemplate(string name, InterfaceTemplateArgs args, CustomResourceOptions? opts = null)
    public InterfaceTemplate(String name, InterfaceTemplateArgs args)
    public InterfaceTemplate(String name, InterfaceTemplateArgs args, CustomResourceOptions options)
    
    type: netbox:InterfaceTemplate
    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 InterfaceTemplateArgs
    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 InterfaceTemplateArgs
    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 InterfaceTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InterfaceTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InterfaceTemplateArgs
    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 interfaceTemplateResource = new Netbox.InterfaceTemplate("interfaceTemplateResource", new()
    {
        Type = "string",
        Description = "string",
        DeviceTypeId = 0,
        InterfaceTemplateId = "string",
        Label = "string",
        MgmtOnly = false,
        ModuleTypeId = 0,
        Name = "string",
    });
    
    example, err := netbox.NewInterfaceTemplate(ctx, "interfaceTemplateResource", &netbox.InterfaceTemplateArgs{
    	Type:                pulumi.String("string"),
    	Description:         pulumi.String("string"),
    	DeviceTypeId:        pulumi.Float64(0),
    	InterfaceTemplateId: pulumi.String("string"),
    	Label:               pulumi.String("string"),
    	MgmtOnly:            pulumi.Bool(false),
    	ModuleTypeId:        pulumi.Float64(0),
    	Name:                pulumi.String("string"),
    })
    
    var interfaceTemplateResource = new InterfaceTemplate("interfaceTemplateResource", InterfaceTemplateArgs.builder()
        .type("string")
        .description("string")
        .deviceTypeId(0)
        .interfaceTemplateId("string")
        .label("string")
        .mgmtOnly(false)
        .moduleTypeId(0)
        .name("string")
        .build());
    
    interface_template_resource = netbox.InterfaceTemplate("interfaceTemplateResource",
        type="string",
        description="string",
        device_type_id=0,
        interface_template_id="string",
        label="string",
        mgmt_only=False,
        module_type_id=0,
        name="string")
    
    const interfaceTemplateResource = new netbox.InterfaceTemplate("interfaceTemplateResource", {
        type: "string",
        description: "string",
        deviceTypeId: 0,
        interfaceTemplateId: "string",
        label: "string",
        mgmtOnly: false,
        moduleTypeId: 0,
        name: "string",
    });
    
    type: netbox:InterfaceTemplate
    properties:
        description: string
        deviceTypeId: 0
        interfaceTemplateId: string
        label: string
        mgmtOnly: false
        moduleTypeId: 0
        name: string
        type: string
    

    InterfaceTemplate 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 InterfaceTemplate resource accepts the following input properties:

    Type string
    Description string
    DeviceTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    InterfaceTemplateId string
    The ID of this resource.
    Label string
    MgmtOnly bool
    ModuleTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    Description string
    DeviceTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    InterfaceTemplateId string
    The ID of this resource.
    Label string
    MgmtOnly bool
    ModuleTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    type String
    description String
    deviceTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId String
    The ID of this resource.
    label String
    mgmtOnly Boolean
    moduleTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type string
    description string
    deviceTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId string
    The ID of this resource.
    label string
    mgmtOnly boolean
    moduleTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type str
    description str
    device_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    interface_template_id str
    The ID of this resource.
    label str
    mgmt_only bool
    module_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    name str
    type String
    description String
    deviceTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId String
    The ID of this resource.
    label String
    mgmtOnly Boolean
    moduleTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    name String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the InterfaceTemplate 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 InterfaceTemplate Resource

    Get an existing InterfaceTemplate 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?: InterfaceTemplateState, opts?: CustomResourceOptions): InterfaceTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            device_type_id: Optional[float] = None,
            interface_template_id: Optional[str] = None,
            label: Optional[str] = None,
            mgmt_only: Optional[bool] = None,
            module_type_id: Optional[float] = None,
            name: Optional[str] = None,
            type: Optional[str] = None) -> InterfaceTemplate
    func GetInterfaceTemplate(ctx *Context, name string, id IDInput, state *InterfaceTemplateState, opts ...ResourceOption) (*InterfaceTemplate, error)
    public static InterfaceTemplate Get(string name, Input<string> id, InterfaceTemplateState? state, CustomResourceOptions? opts = null)
    public static InterfaceTemplate get(String name, Output<String> id, InterfaceTemplateState state, CustomResourceOptions options)
    resources:  _:    type: netbox:InterfaceTemplate    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.
    The following state arguments are supported:
    Description string
    DeviceTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    InterfaceTemplateId string
    The ID of this resource.
    Label string
    MgmtOnly bool
    ModuleTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    Description string
    DeviceTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    InterfaceTemplateId string
    The ID of this resource.
    Label string
    MgmtOnly bool
    ModuleTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    description String
    deviceTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId String
    The ID of this resource.
    label String
    mgmtOnly Boolean
    moduleTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String
    description string
    deviceTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId string
    The ID of this resource.
    label string
    mgmtOnly boolean
    moduleTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type string
    description str
    device_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    interface_template_id str
    The ID of this resource.
    label str
    mgmt_only bool
    module_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    name str
    type str
    description String
    deviceTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    interfaceTemplateId String
    The ID of this resource.
    label String
    mgmtOnly Boolean
    moduleTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger