UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

88 lines 4.18 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceType = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/device-types/#device-types_1): * * > 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const test = new netbox.dcim.Manufacturer("test", {name: "test"}); * const testDeviceType = new netbox.dcim.DeviceType("test", { * model: "test", * partNumber: "123", * manufacturerId: test.id, * }); * ``` */ class DeviceType extends pulumi.CustomResource { /** * Get an existing DeviceType 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, id, state, opts) { return new DeviceType(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DeviceType. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === DeviceType.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["isFullDepth"] = state ? state.isFullDepth : undefined; resourceInputs["manufacturerId"] = state ? state.manufacturerId : undefined; resourceInputs["model"] = state ? state.model : undefined; resourceInputs["partNumber"] = state ? state.partNumber : undefined; resourceInputs["slug"] = state ? state.slug : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAlls"] = state ? state.tagsAlls : undefined; resourceInputs["uHeight"] = state ? state.uHeight : undefined; } else { const args = argsOrState; if ((!args || args.manufacturerId === undefined) && !opts.urn) { throw new Error("Missing required property 'manufacturerId'"); } if ((!args || args.model === undefined) && !opts.urn) { throw new Error("Missing required property 'model'"); } resourceInputs["isFullDepth"] = args ? args.isFullDepth : undefined; resourceInputs["manufacturerId"] = args ? args.manufacturerId : undefined; resourceInputs["model"] = args ? args.model : undefined; resourceInputs["partNumber"] = args ? args.partNumber : undefined; resourceInputs["slug"] = args ? args.slug : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["uHeight"] = args ? args.uHeight : undefined; resourceInputs["tagsAlls"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DeviceType.__pulumiType, name, resourceInputs, opts); } } exports.DeviceType = DeviceType; /** @internal */ DeviceType.__pulumiType = 'netbox:dcim/deviceType:DeviceType'; //# sourceMappingURL=deviceType.js.map