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

netbox.DeviceType

Explore with Pulumi AI

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

    From the official documentation:

    A device type represents a particular make and model of hardware that exists in the real world. Device types define the physical attributes of a device (rack height and depth) and its individual components (console, power, network interfaces, and so on).

    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",
        partNumber: "123",
        manufacturerId: testManufacturer.manufacturerId,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_manufacturer = netbox.Manufacturer("testManufacturer")
    test_device_type = netbox.DeviceType("testDeviceType",
        model="test",
        part_number="123",
        manufacturer_id=test_manufacturer.manufacturer_id)
    
    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
    		}
    		_, err = netbox.NewDeviceType(ctx, "testDeviceType", &netbox.DeviceTypeArgs{
    			Model:          pulumi.String("test"),
    			PartNumber:     pulumi.String("123"),
    			ManufacturerId: testManufacturer.ManufacturerId,
    		})
    		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",
            PartNumber = "123",
            ManufacturerId = testManufacturer.ManufacturerId,
        });
    
    });
    
    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 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")
                .partNumber("123")
                .manufacturerId(testManufacturer.manufacturerId())
                .build());
    
        }
    }
    
    resources:
      testManufacturer:
        type: netbox:Manufacturer
      testDeviceType:
        type: netbox:DeviceType
        properties:
          model: test
          partNumber: '123'
          manufacturerId: ${testManufacturer.manufacturerId}
    

    Create DeviceType Resource

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

    Constructor syntax

    new DeviceType(name: string, args: DeviceTypeArgs, opts?: CustomResourceOptions);
    @overload
    def DeviceType(resource_name: str,
                   args: DeviceTypeArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeviceType(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   manufacturer_id: Optional[float] = None,
                   model: Optional[str] = None,
                   device_type_id: Optional[str] = None,
                   is_full_depth: Optional[bool] = None,
                   part_number: Optional[str] = None,
                   slug: Optional[str] = None,
                   tags: Optional[Sequence[str]] = None,
                   u_height: Optional[float] = None)
    func NewDeviceType(ctx *Context, name string, args DeviceTypeArgs, opts ...ResourceOption) (*DeviceType, error)
    public DeviceType(string name, DeviceTypeArgs args, CustomResourceOptions? opts = null)
    public DeviceType(String name, DeviceTypeArgs args)
    public DeviceType(String name, DeviceTypeArgs args, CustomResourceOptions options)
    
    type: netbox:DeviceType
    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 DeviceTypeArgs
    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 DeviceTypeArgs
    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 DeviceTypeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeviceTypeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeviceTypeArgs
    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 deviceTypeResource = new Netbox.DeviceType("deviceTypeResource", new()
    {
        ManufacturerId = 0,
        Model = "string",
        DeviceTypeId = "string",
        IsFullDepth = false,
        PartNumber = "string",
        Slug = "string",
        Tags = new[]
        {
            "string",
        },
        UHeight = 0,
    });
    
    example, err := netbox.NewDeviceType(ctx, "deviceTypeResource", &netbox.DeviceTypeArgs{
    	ManufacturerId: pulumi.Float64(0),
    	Model:          pulumi.String("string"),
    	DeviceTypeId:   pulumi.String("string"),
    	IsFullDepth:    pulumi.Bool(false),
    	PartNumber:     pulumi.String("string"),
    	Slug:           pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UHeight: pulumi.Float64(0),
    })
    
    var deviceTypeResource = new DeviceType("deviceTypeResource", DeviceTypeArgs.builder()
        .manufacturerId(0)
        .model("string")
        .deviceTypeId("string")
        .isFullDepth(false)
        .partNumber("string")
        .slug("string")
        .tags("string")
        .uHeight(0)
        .build());
    
    device_type_resource = netbox.DeviceType("deviceTypeResource",
        manufacturer_id=0,
        model="string",
        device_type_id="string",
        is_full_depth=False,
        part_number="string",
        slug="string",
        tags=["string"],
        u_height=0)
    
    const deviceTypeResource = new netbox.DeviceType("deviceTypeResource", {
        manufacturerId: 0,
        model: "string",
        deviceTypeId: "string",
        isFullDepth: false,
        partNumber: "string",
        slug: "string",
        tags: ["string"],
        uHeight: 0,
    });
    
    type: netbox:DeviceType
    properties:
        deviceTypeId: string
        isFullDepth: false
        manufacturerId: 0
        model: string
        partNumber: string
        slug: string
        tags:
            - string
        uHeight: 0
    

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

    ManufacturerId double
    Model string
    DeviceTypeId string
    The ID of this resource.
    IsFullDepth bool
    PartNumber string
    Slug string
    Tags List<string>
    UHeight double
    Defaults to 1.0.
    ManufacturerId float64
    Model string
    DeviceTypeId string
    The ID of this resource.
    IsFullDepth bool
    PartNumber string
    Slug string
    Tags []string
    UHeight float64
    Defaults to 1.0.
    manufacturerId Double
    model String
    deviceTypeId String
    The ID of this resource.
    isFullDepth Boolean
    partNumber String
    slug String
    tags List<String>
    uHeight Double
    Defaults to 1.0.
    manufacturerId number
    model string
    deviceTypeId string
    The ID of this resource.
    isFullDepth boolean
    partNumber string
    slug string
    tags string[]
    uHeight number
    Defaults to 1.0.
    manufacturer_id float
    model str
    device_type_id str
    The ID of this resource.
    is_full_depth bool
    part_number str
    slug str
    tags Sequence[str]
    u_height float
    Defaults to 1.0.
    manufacturerId Number
    model String
    deviceTypeId String
    The ID of this resource.
    isFullDepth Boolean
    partNumber String
    slug String
    tags List<String>
    uHeight Number
    Defaults to 1.0.

    Outputs

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

    Get an existing DeviceType 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?: DeviceTypeState, opts?: CustomResourceOptions): DeviceType
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            device_type_id: Optional[str] = None,
            is_full_depth: Optional[bool] = None,
            manufacturer_id: Optional[float] = None,
            model: Optional[str] = None,
            part_number: Optional[str] = None,
            slug: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            u_height: Optional[float] = None) -> DeviceType
    func GetDeviceType(ctx *Context, name string, id IDInput, state *DeviceTypeState, opts ...ResourceOption) (*DeviceType, error)
    public static DeviceType Get(string name, Input<string> id, DeviceTypeState? state, CustomResourceOptions? opts = null)
    public static DeviceType get(String name, Output<String> id, DeviceTypeState state, CustomResourceOptions options)
    resources:  _:    type: netbox:DeviceType    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:
    DeviceTypeId string
    The ID of this resource.
    IsFullDepth bool
    ManufacturerId double
    Model string
    PartNumber string
    Slug string
    Tags List<string>
    UHeight double
    Defaults to 1.0.
    DeviceTypeId string
    The ID of this resource.
    IsFullDepth bool
    ManufacturerId float64
    Model string
    PartNumber string
    Slug string
    Tags []string
    UHeight float64
    Defaults to 1.0.
    deviceTypeId String
    The ID of this resource.
    isFullDepth Boolean
    manufacturerId Double
    model String
    partNumber String
    slug String
    tags List<String>
    uHeight Double
    Defaults to 1.0.
    deviceTypeId string
    The ID of this resource.
    isFullDepth boolean
    manufacturerId number
    model string
    partNumber string
    slug string
    tags string[]
    uHeight number
    Defaults to 1.0.
    device_type_id str
    The ID of this resource.
    is_full_depth bool
    manufacturer_id float
    model str
    part_number str
    slug str
    tags Sequence[str]
    u_height float
    Defaults to 1.0.
    deviceTypeId String
    The ID of this resource.
    isFullDepth Boolean
    manufacturerId Number
    model String
    partNumber String
    slug String
    tags List<String>
    uHeight Number
    Defaults to 1.0.

    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