netbox.ModuleType
Explore with Pulumi AI
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:
- Manufacturer
Id double - Model string
- Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Module
Type stringId - The ID of this resource.
- Part
Number string - List<string>
- Weight double
- Weight
Unit string - One of [kg, g, lb, oz]. Required when
weight
is set.
- Manufacturer
Id float64 - Model string
- Comments string
- Custom
Fields map[string]string - Description string
- Module
Type stringId - The ID of this resource.
- Part
Number string - []string
- Weight float64
- Weight
Unit string - One of [kg, g, lb, oz]. Required when
weight
is set.
- manufacturer
Id Double - model String
- comments String
- custom
Fields Map<String,String> - description String
- module
Type StringId - The ID of this resource.
- part
Number String - List<String>
- weight Double
- weight
Unit String - One of [kg, g, lb, oz]. Required when
weight
is set.
- manufacturer
Id number - model string
- comments string
- custom
Fields {[key: string]: string} - description string
- module
Type stringId - The ID of this resource.
- part
Number string - string[]
- weight number
- weight
Unit 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_ strid - The ID of this resource.
- part_
number str - Sequence[str]
- weight float
- weight_
unit str - One of [kg, g, lb, oz]. Required when
weight
is set.
- manufacturer
Id Number - model String
- comments String
- custom
Fields Map<String> - description String
- module
Type StringId - The ID of this resource.
- part
Number String - List<String>
- weight Number
- weight
Unit 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.
- Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Manufacturer
Id double - Model string
- Module
Type stringId - The ID of this resource.
- Part
Number string - List<string>
- Weight double
- Weight
Unit string - One of [kg, g, lb, oz]. Required when
weight
is set.
- Comments string
- Custom
Fields map[string]string - Description string
- Manufacturer
Id float64 - Model string
- Module
Type stringId - The ID of this resource.
- Part
Number string - []string
- Weight float64
- Weight
Unit string - One of [kg, g, lb, oz]. Required when
weight
is set.
- comments String
- custom
Fields Map<String,String> - description String
- manufacturer
Id Double - model String
- module
Type StringId - The ID of this resource.
- part
Number String - List<String>
- weight Double
- weight
Unit String - One of [kg, g, lb, oz]. Required when
weight
is set.
- comments string
- custom
Fields {[key: string]: string} - description string
- manufacturer
Id number - model string
- module
Type stringId - The ID of this resource.
- part
Number string - string[]
- weight number
- weight
Unit 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_ strid - The ID of this resource.
- part_
number str - Sequence[str]
- weight float
- weight_
unit str - One of [kg, g, lb, oz]. Required when
weight
is set.
- comments String
- custom
Fields Map<String> - description String
- manufacturer
Id Number - model String
- module
Type StringId - The ID of this resource.
- part
Number String - List<String>
- weight Number
- weight
Unit 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.