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

netbox.ModuleType

Explore with Pulumi AI

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

    From the official documentation:

    A module type represents a specific make and model of hardware component which is installable within a device’s module bay and has its own child components. For example, consider a chassis-based switch or router with a number of field-replaceable line cards. Each line card has its own model number and includes a certain set of components such as interfaces. Each module type may have a manufacturer, model number, and part number assigned to it.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const testManufacturer = new netbox.Manufacturer("testManufacturer", {});
    const testModuleType = new netbox.ModuleType("testModuleType", {
        manufacturerId: testManufacturer.manufacturerId,
        model: "Networking",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_manufacturer = netbox.Manufacturer("testManufacturer")
    test_module_type = netbox.ModuleType("testModuleType",
        manufacturer_id=test_manufacturer.manufacturer_id,
        model="Networking")
    
    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.NewModuleType(ctx, "testModuleType", &netbox.ModuleTypeArgs{
    			ManufacturerId: testManufacturer.ManufacturerId,
    			Model:          pulumi.String("Networking"),
    		})
    		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 testModuleType = new Netbox.ModuleType("testModuleType", new()
        {
            ManufacturerId = testManufacturer.ManufacturerId,
            Model = "Networking",
        });
    
    });
    
    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.ModuleType;
    import com.pulumi.netbox.ModuleTypeArgs;
    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 testModuleType = new ModuleType("testModuleType", ModuleTypeArgs.builder()
                .manufacturerId(testManufacturer.manufacturerId())
                .model("Networking")
                .build());
    
        }
    }
    
    resources:
      testManufacturer:
        type: netbox:Manufacturer
      testModuleType:
        type: netbox:ModuleType
        properties:
          manufacturerId: ${testManufacturer.manufacturerId}
          model: Networking
    

    Create ModuleType Resource

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

    Constructor syntax

    new ModuleType(name: string, args: ModuleTypeArgs, opts?: CustomResourceOptions);
    @overload
    def ModuleType(resource_name: str,
                   args: ModuleTypeArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ModuleType(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   manufacturer_id: Optional[float] = None,
                   model: Optional[str] = None,
                   comments: Optional[str] = None,
                   custom_fields: Optional[Mapping[str, str]] = None,
                   description: Optional[str] = None,
                   module_type_id: Optional[str] = None,
                   part_number: Optional[str] = None,
                   tags: Optional[Sequence[str]] = None,
                   weight: Optional[float] = None,
                   weight_unit: Optional[str] = None)
    func NewModuleType(ctx *Context, name string, args ModuleTypeArgs, opts ...ResourceOption) (*ModuleType, error)
    public ModuleType(string name, ModuleTypeArgs args, CustomResourceOptions? opts = null)
    public ModuleType(String name, ModuleTypeArgs args)
    public ModuleType(String name, ModuleTypeArgs args, CustomResourceOptions options)
    
    type: netbox:ModuleType
    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 ModuleTypeArgs
    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 ModuleTypeArgs
    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 ModuleTypeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ModuleTypeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ModuleTypeArgs
    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 moduleTypeResource = new Netbox.ModuleType("moduleTypeResource", new()
    {
        ManufacturerId = 0,
        Model = "string",
        Comments = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        ModuleTypeId = "string",
        PartNumber = "string",
        Tags = new[]
        {
            "string",
        },
        Weight = 0,
        WeightUnit = "string",
    });
    
    example, err := netbox.NewModuleType(ctx, "moduleTypeResource", &netbox.ModuleTypeArgs{
    	ManufacturerId: pulumi.Float64(0),
    	Model:          pulumi.String("string"),
    	Comments:       pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:  pulumi.String("string"),
    	ModuleTypeId: pulumi.String("string"),
    	PartNumber:   pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Weight:     pulumi.Float64(0),
    	WeightUnit: pulumi.String("string"),
    })
    
    var moduleTypeResource = new ModuleType("moduleTypeResource", ModuleTypeArgs.builder()
        .manufacturerId(0)
        .model("string")
        .comments("string")
        .customFields(Map.of("string", "string"))
        .description("string")
        .moduleTypeId("string")
        .partNumber("string")
        .tags("string")
        .weight(0)
        .weightUnit("string")
        .build());
    
    module_type_resource = netbox.ModuleType("moduleTypeResource",
        manufacturer_id=0,
        model="string",
        comments="string",
        custom_fields={
            "string": "string",
        },
        description="string",
        module_type_id="string",
        part_number="string",
        tags=["string"],
        weight=0,
        weight_unit="string")
    
    const moduleTypeResource = new netbox.ModuleType("moduleTypeResource", {
        manufacturerId: 0,
        model: "string",
        comments: "string",
        customFields: {
            string: "string",
        },
        description: "string",
        moduleTypeId: "string",
        partNumber: "string",
        tags: ["string"],
        weight: 0,
        weightUnit: "string",
    });
    
    type: netbox:ModuleType
    properties:
        comments: string
        customFields:
            string: string
        description: string
        manufacturerId: 0
        model: string
        moduleTypeId: string
        partNumber: string
        tags:
            - string
        weight: 0
        weightUnit: string
    

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

    ManufacturerId double
    Model string
    Comments string
    CustomFields Dictionary<string, string>
    Description string
    ModuleTypeId string
    The ID of this resource.
    PartNumber string
    Tags List<string>
    Weight double
    WeightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    ManufacturerId float64
    Model string
    Comments string
    CustomFields map[string]string
    Description string
    ModuleTypeId string
    The ID of this resource.
    PartNumber string
    Tags []string
    Weight float64
    WeightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    manufacturerId Double
    model String
    comments String
    customFields Map<String,String>
    description String
    moduleTypeId String
    The ID of this resource.
    partNumber String
    tags List<String>
    weight Double
    weightUnit String
    One of [kg, g, lb, oz]. Required when weight is set.
    manufacturerId number
    model string
    comments string
    customFields {[key: string]: string}
    description string
    moduleTypeId string
    The ID of this resource.
    partNumber string
    tags string[]
    weight number
    weightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    manufacturer_id float
    model str
    comments str
    custom_fields Mapping[str, str]
    description str
    module_type_id str
    The ID of this resource.
    part_number str
    tags Sequence[str]
    weight float
    weight_unit str
    One of [kg, g, lb, oz]. Required when weight is set.
    manufacturerId Number
    model String
    comments String
    customFields Map<String>
    description String
    moduleTypeId String
    The ID of this resource.
    partNumber String
    tags List<String>
    weight Number
    weightUnit String
    One of [kg, g, lb, oz]. Required when weight is set.

    Outputs

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

    Get an existing ModuleType 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?: ModuleTypeState, opts?: CustomResourceOptions): ModuleType
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comments: Optional[str] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            manufacturer_id: Optional[float] = None,
            model: Optional[str] = None,
            module_type_id: Optional[str] = None,
            part_number: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            weight: Optional[float] = None,
            weight_unit: Optional[str] = None) -> ModuleType
    func GetModuleType(ctx *Context, name string, id IDInput, state *ModuleTypeState, opts ...ResourceOption) (*ModuleType, error)
    public static ModuleType Get(string name, Input<string> id, ModuleTypeState? state, CustomResourceOptions? opts = null)
    public static ModuleType get(String name, Output<String> id, ModuleTypeState state, CustomResourceOptions options)
    resources:  _:    type: netbox:ModuleType    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:
    Comments string
    CustomFields Dictionary<string, string>
    Description string
    ManufacturerId double
    Model string
    ModuleTypeId string
    The ID of this resource.
    PartNumber string
    Tags List<string>
    Weight double
    WeightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    Comments string
    CustomFields map[string]string
    Description string
    ManufacturerId float64
    Model string
    ModuleTypeId string
    The ID of this resource.
    PartNumber string
    Tags []string
    Weight float64
    WeightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    comments String
    customFields Map<String,String>
    description String
    manufacturerId Double
    model String
    moduleTypeId String
    The ID of this resource.
    partNumber String
    tags List<String>
    weight Double
    weightUnit String
    One of [kg, g, lb, oz]. Required when weight is set.
    comments string
    customFields {[key: string]: string}
    description string
    manufacturerId number
    model string
    moduleTypeId string
    The ID of this resource.
    partNumber string
    tags string[]
    weight number
    weightUnit string
    One of [kg, g, lb, oz]. Required when weight is set.
    comments str
    custom_fields Mapping[str, str]
    description str
    manufacturer_id float
    model str
    module_type_id str
    The ID of this resource.
    part_number str
    tags Sequence[str]
    weight float
    weight_unit str
    One of [kg, g, lb, oz]. Required when weight is set.
    comments String
    customFields Map<String>
    description String
    manufacturerId Number
    model String
    moduleTypeId String
    The ID of this resource.
    partNumber String
    tags List<String>
    weight Number
    weightUnit String
    One of [kg, g, lb, oz]. Required when weight is set.

    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