netbox.DeviceBayTemplate
Explore with Pulumi AI
From the official documentation:
A template for a device bay that will be created on all instantiations of the parent device type.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const exampleManufacturer = new netbox.Manufacturer("exampleManufacturer", {});
const exampleDeviceType = new netbox.DeviceType("exampleDeviceType", {
model: "example_device_model",
slug: "example_device_slug",
partNumber: "example_part_number",
manufacturerId: exampleManufacturer.manufacturerId,
subdeviceRole: "parent",
});
const exampleDeviceBayTemplate = new netbox.DeviceBayTemplate("exampleDeviceBayTemplate", {deviceTypeId: exampleDeviceType.deviceTypeId});
import pulumi
import pulumi_netbox as netbox
example_manufacturer = netbox.Manufacturer("exampleManufacturer")
example_device_type = netbox.DeviceType("exampleDeviceType",
model="example_device_model",
slug="example_device_slug",
part_number="example_part_number",
manufacturer_id=example_manufacturer.manufacturer_id,
subdevice_role="parent")
example_device_bay_template = netbox.DeviceBayTemplate("exampleDeviceBayTemplate", device_type_id=example_device_type.device_type_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v5/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleManufacturer, err := netbox.NewManufacturer(ctx, "exampleManufacturer", nil)
if err != nil {
return err
}
exampleDeviceType, err := netbox.NewDeviceType(ctx, "exampleDeviceType", &netbox.DeviceTypeArgs{
Model: pulumi.String("example_device_model"),
Slug: pulumi.String("example_device_slug"),
PartNumber: pulumi.String("example_part_number"),
ManufacturerId: exampleManufacturer.ManufacturerId,
SubdeviceRole: pulumi.String("parent"),
})
if err != nil {
return err
}
_, err = netbox.NewDeviceBayTemplate(ctx, "exampleDeviceBayTemplate", &netbox.DeviceBayTemplateArgs{
DeviceTypeId: exampleDeviceType.DeviceTypeId,
})
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 exampleManufacturer = new Netbox.Manufacturer("exampleManufacturer");
var exampleDeviceType = new Netbox.DeviceType("exampleDeviceType", new()
{
Model = "example_device_model",
Slug = "example_device_slug",
PartNumber = "example_part_number",
ManufacturerId = exampleManufacturer.ManufacturerId,
SubdeviceRole = "parent",
});
var exampleDeviceBayTemplate = new Netbox.DeviceBayTemplate("exampleDeviceBayTemplate", new()
{
DeviceTypeId = exampleDeviceType.DeviceTypeId,
});
});
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.DeviceBayTemplate;
import com.pulumi.netbox.DeviceBayTemplateArgs;
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 exampleManufacturer = new Manufacturer("exampleManufacturer");
var exampleDeviceType = new DeviceType("exampleDeviceType", DeviceTypeArgs.builder()
.model("example_device_model")
.slug("example_device_slug")
.partNumber("example_part_number")
.manufacturerId(exampleManufacturer.manufacturerId())
.subdeviceRole("parent")
.build());
var exampleDeviceBayTemplate = new DeviceBayTemplate("exampleDeviceBayTemplate", DeviceBayTemplateArgs.builder()
.deviceTypeId(exampleDeviceType.deviceTypeId())
.build());
}
}
resources:
exampleManufacturer:
type: netbox:Manufacturer
exampleDeviceType:
type: netbox:DeviceType
properties:
model: example_device_model
slug: example_device_slug
partNumber: example_part_number
manufacturerId: ${exampleManufacturer.manufacturerId}
subdeviceRole: parent
exampleDeviceBayTemplate:
type: netbox:DeviceBayTemplate
properties:
deviceTypeId: ${exampleDeviceType.deviceTypeId}
Create DeviceBayTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DeviceBayTemplate(name: string, args: DeviceBayTemplateArgs, opts?: CustomResourceOptions);
@overload
def DeviceBayTemplate(resource_name: str,
args: DeviceBayTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DeviceBayTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
device_type_id: Optional[float] = None,
description: Optional[str] = None,
device_bay_template_id: Optional[str] = None,
label: Optional[str] = None,
name: Optional[str] = None)
func NewDeviceBayTemplate(ctx *Context, name string, args DeviceBayTemplateArgs, opts ...ResourceOption) (*DeviceBayTemplate, error)
public DeviceBayTemplate(string name, DeviceBayTemplateArgs args, CustomResourceOptions? opts = null)
public DeviceBayTemplate(String name, DeviceBayTemplateArgs args)
public DeviceBayTemplate(String name, DeviceBayTemplateArgs args, CustomResourceOptions options)
type: netbox:DeviceBayTemplate
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 DeviceBayTemplateArgs
- 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 DeviceBayTemplateArgs
- 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 DeviceBayTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeviceBayTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DeviceBayTemplateArgs
- 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 deviceBayTemplateResource = new Netbox.DeviceBayTemplate("deviceBayTemplateResource", new()
{
DeviceTypeId = 0,
Description = "string",
DeviceBayTemplateId = "string",
Label = "string",
Name = "string",
});
example, err := netbox.NewDeviceBayTemplate(ctx, "deviceBayTemplateResource", &netbox.DeviceBayTemplateArgs{
DeviceTypeId: pulumi.Float64(0),
Description: pulumi.String("string"),
DeviceBayTemplateId: pulumi.String("string"),
Label: pulumi.String("string"),
Name: pulumi.String("string"),
})
var deviceBayTemplateResource = new DeviceBayTemplate("deviceBayTemplateResource", DeviceBayTemplateArgs.builder()
.deviceTypeId(0.0)
.description("string")
.deviceBayTemplateId("string")
.label("string")
.name("string")
.build());
device_bay_template_resource = netbox.DeviceBayTemplate("deviceBayTemplateResource",
device_type_id=0,
description="string",
device_bay_template_id="string",
label="string",
name="string")
const deviceBayTemplateResource = new netbox.DeviceBayTemplate("deviceBayTemplateResource", {
deviceTypeId: 0,
description: "string",
deviceBayTemplateId: "string",
label: "string",
name: "string",
});
type: netbox:DeviceBayTemplate
properties:
description: string
deviceBayTemplateId: string
deviceTypeId: 0
label: string
name: string
DeviceBayTemplate 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 DeviceBayTemplate resource accepts the following input properties:
- Device
Type doubleId - Description string
- Device
Bay stringTemplate Id - The ID of this resource.
- Label string
- Name string
- Device
Type float64Id - Description string
- Device
Bay stringTemplate Id - The ID of this resource.
- Label string
- Name string
- device
Type DoubleId - description String
- device
Bay StringTemplate Id - The ID of this resource.
- label String
- name String
- device
Type numberId - description string
- device
Bay stringTemplate Id - The ID of this resource.
- label string
- name string
- device_
type_ floatid - description str
- device_
bay_ strtemplate_ id - The ID of this resource.
- label str
- name str
- device
Type NumberId - description String
- device
Bay StringTemplate Id - The ID of this resource.
- label String
- name String
Outputs
All input properties are implicitly available as output properties. Additionally, the DeviceBayTemplate 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 DeviceBayTemplate Resource
Get an existing DeviceBayTemplate 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?: DeviceBayTemplateState, opts?: CustomResourceOptions): DeviceBayTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
device_bay_template_id: Optional[str] = None,
device_type_id: Optional[float] = None,
label: Optional[str] = None,
name: Optional[str] = None) -> DeviceBayTemplate
func GetDeviceBayTemplate(ctx *Context, name string, id IDInput, state *DeviceBayTemplateState, opts ...ResourceOption) (*DeviceBayTemplate, error)
public static DeviceBayTemplate Get(string name, Input<string> id, DeviceBayTemplateState? state, CustomResourceOptions? opts = null)
public static DeviceBayTemplate get(String name, Output<String> id, DeviceBayTemplateState state, CustomResourceOptions options)
resources: _: type: netbox:DeviceBayTemplate 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
Bay stringTemplate Id - The ID of this resource.
- Device
Type doubleId - Label string
- Name string
- Description string
- Device
Bay stringTemplate Id - The ID of this resource.
- Device
Type float64Id - Label string
- Name string
- description String
- device
Bay StringTemplate Id - The ID of this resource.
- device
Type DoubleId - label String
- name String
- description string
- device
Bay stringTemplate Id - The ID of this resource.
- device
Type numberId - label string
- name string
- description str
- device_
bay_ strtemplate_ id - The ID of this resource.
- device_
type_ floatid - label str
- name str
- description String
- device
Bay StringTemplate Id - The ID of this resource.
- device
Type NumberId - label String
- name String
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.