@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
197 lines (196 loc) • 8.04 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/features/devices/#devices):
*
* > Every piece of hardware which is installed within a site or rack exists in NetBox as a device. Devices are measured in rack units (U) and can be half depth or full depth. A device may have a height of 0U: These devices do not consume vertical rack space and cannot be assigned to a particular rack unit. A common example of a 0U device is a vertically-mounted PDU.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.dcim.Site("test", {name: "%[1]s"});
* const testDeviceRole = new netbox.dcim.DeviceRole("test", {
* name: "%[1]s",
* colorHex: "123456",
* });
* const testManufacturer = new netbox.dcim.Manufacturer("test", {name: "test"});
* const testDeviceType = new netbox.dcim.DeviceType("test", {
* model: "test",
* manufacturerId: testManufacturer.id,
* });
* const testDevice = new netbox.dcim.Device("test", {
* name: "%[1]s",
* deviceTypeId: testDeviceType.id,
* roleId: testDeviceRole.id,
* siteId: test.id,
* localContextData: JSON.stringify({
* setting_a: "Some Setting",
* setting_b: 42,
* }),
* });
* ```
*/
export declare class Device extends pulumi.CustomResource {
/**
* Get an existing Device resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DeviceState, opts?: pulumi.CustomResourceOptions): Device;
/**
* Returns true if the given object is an instance of Device. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Device;
readonly assetTag: pulumi.Output<string | undefined>;
readonly clusterId: pulumi.Output<number | undefined>;
readonly comments: pulumi.Output<string | undefined>;
readonly configTemplateId: pulumi.Output<number | undefined>;
readonly customFields: pulumi.Output<{
[key: string]: string;
} | undefined>;
readonly description: pulumi.Output<string | undefined>;
readonly deviceTypeId: pulumi.Output<number>;
/**
* This is best managed through the use of `jsonencode` and a map of settings.
*/
readonly localContextData: pulumi.Output<string | undefined>;
readonly locationId: pulumi.Output<number | undefined>;
readonly name: pulumi.Output<string>;
readonly platformId: pulumi.Output<number | undefined>;
readonly primaryIpv4: pulumi.Output<number>;
readonly primaryIpv6: pulumi.Output<number>;
/**
* Valid values are `front` and `rear`. Required when `rackPosition` is set.
*/
readonly rackFace: pulumi.Output<string | undefined>;
readonly rackId: pulumi.Output<number | undefined>;
readonly rackPosition: pulumi.Output<number | undefined>;
readonly roleId: pulumi.Output<number>;
readonly serial: pulumi.Output<string | undefined>;
readonly siteId: pulumi.Output<number>;
/**
* Valid values are `offline`, `active`, `planned`, `staged`, `failed` and `inventory`. Defaults to `active`.
*/
readonly status: pulumi.Output<string | undefined>;
readonly tags: pulumi.Output<string[] | undefined>;
readonly tenantId: pulumi.Output<number | undefined>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
readonly virtualChassisId: pulumi.Output<number | undefined>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
readonly virtualChassisMaster: pulumi.Output<boolean | undefined>;
readonly virtualChassisPosition: pulumi.Output<number | undefined>;
readonly virtualChassisPriority: pulumi.Output<number | undefined>;
/**
* Create a Device resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DeviceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Device resources.
*/
export interface DeviceState {
assetTag?: pulumi.Input<string>;
clusterId?: pulumi.Input<number>;
comments?: pulumi.Input<string>;
configTemplateId?: pulumi.Input<number>;
customFields?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
description?: pulumi.Input<string>;
deviceTypeId?: pulumi.Input<number>;
/**
* This is best managed through the use of `jsonencode` and a map of settings.
*/
localContextData?: pulumi.Input<string>;
locationId?: pulumi.Input<number>;
name?: pulumi.Input<string>;
platformId?: pulumi.Input<number>;
primaryIpv4?: pulumi.Input<number>;
primaryIpv6?: pulumi.Input<number>;
/**
* Valid values are `front` and `rear`. Required when `rackPosition` is set.
*/
rackFace?: pulumi.Input<string>;
rackId?: pulumi.Input<number>;
rackPosition?: pulumi.Input<number>;
roleId?: pulumi.Input<number>;
serial?: pulumi.Input<string>;
siteId?: pulumi.Input<number>;
/**
* Valid values are `offline`, `active`, `planned`, `staged`, `failed` and `inventory`. Defaults to `active`.
*/
status?: pulumi.Input<string>;
tags?: pulumi.Input<pulumi.Input<string>[]>;
tenantId?: pulumi.Input<number>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
virtualChassisId?: pulumi.Input<number>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
virtualChassisMaster?: pulumi.Input<boolean>;
virtualChassisPosition?: pulumi.Input<number>;
virtualChassisPriority?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a Device resource.
*/
export interface DeviceArgs {
assetTag?: pulumi.Input<string>;
clusterId?: pulumi.Input<number>;
comments?: pulumi.Input<string>;
configTemplateId?: pulumi.Input<number>;
customFields?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
description?: pulumi.Input<string>;
deviceTypeId: pulumi.Input<number>;
/**
* This is best managed through the use of `jsonencode` and a map of settings.
*/
localContextData?: pulumi.Input<string>;
locationId?: pulumi.Input<number>;
name?: pulumi.Input<string>;
platformId?: pulumi.Input<number>;
/**
* Valid values are `front` and `rear`. Required when `rackPosition` is set.
*/
rackFace?: pulumi.Input<string>;
rackId?: pulumi.Input<number>;
rackPosition?: pulumi.Input<number>;
roleId: pulumi.Input<number>;
serial?: pulumi.Input<string>;
siteId: pulumi.Input<number>;
/**
* Valid values are `offline`, `active`, `planned`, `staged`, `failed` and `inventory`. Defaults to `active`.
*/
status?: pulumi.Input<string>;
tags?: pulumi.Input<pulumi.Input<string>[]>;
tenantId?: pulumi.Input<number>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
virtualChassisId?: pulumi.Input<number>;
/**
* Required when `virtualChassisMaster` and `virtualChassisId` is set.
*/
virtualChassisMaster?: pulumi.Input<boolean>;
virtualChassisPosition?: pulumi.Input<number>;
virtualChassisPriority?: pulumi.Input<number>;
}