UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

129 lines 6.33 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.RackType = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://netboxlabs.com/docs/netbox/en/stable/models/dcim/racktype/): * * > A rack type defines the physical characteristics of a particular model of rack. * * ## 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: "my-manufacturer"}); * const testRackType = new netbox.dcim.RackType("test", { * model: "mymodel", * manufacturerId: test.id, * width: 19, * uHeight: 48, * startingUnit: 1, * formFactor: "2-post-frame", * description: "My description", * outerWidth: 10, * outerDepth: 15, * outerUnit: "mm", * weight: 15, * maxWeight: 20, * weightUnit: "kg", * mountingDepthMm: 21, * comments: "My comments", * }); * ``` */ class RackType extends pulumi.CustomResource { /** * Get an existing RackType 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 RackType(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RackType. 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'] === RackType.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["comments"] = state ? state.comments : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["formFactor"] = state ? state.formFactor : undefined; resourceInputs["manufacturerId"] = state ? state.manufacturerId : undefined; resourceInputs["maxWeight"] = state ? state.maxWeight : undefined; resourceInputs["model"] = state ? state.model : undefined; resourceInputs["mountingDepthMm"] = state ? state.mountingDepthMm : undefined; resourceInputs["outerDepth"] = state ? state.outerDepth : undefined; resourceInputs["outerUnit"] = state ? state.outerUnit : undefined; resourceInputs["outerWidth"] = state ? state.outerWidth : undefined; resourceInputs["slug"] = state ? state.slug : undefined; resourceInputs["startingUnit"] = state ? state.startingUnit : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAlls"] = state ? state.tagsAlls : undefined; resourceInputs["uHeight"] = state ? state.uHeight : undefined; resourceInputs["weight"] = state ? state.weight : undefined; resourceInputs["weightUnit"] = state ? state.weightUnit : undefined; resourceInputs["width"] = state ? state.width : undefined; } else { const args = argsOrState; if ((!args || args.formFactor === undefined) && !opts.urn) { throw new Error("Missing required property 'formFactor'"); } if ((!args || args.model === undefined) && !opts.urn) { throw new Error("Missing required property 'model'"); } if ((!args || args.startingUnit === undefined) && !opts.urn) { throw new Error("Missing required property 'startingUnit'"); } if ((!args || args.uHeight === undefined) && !opts.urn) { throw new Error("Missing required property 'uHeight'"); } if ((!args || args.width === undefined) && !opts.urn) { throw new Error("Missing required property 'width'"); } resourceInputs["comments"] = args ? args.comments : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["formFactor"] = args ? args.formFactor : undefined; resourceInputs["manufacturerId"] = args ? args.manufacturerId : undefined; resourceInputs["maxWeight"] = args ? args.maxWeight : undefined; resourceInputs["model"] = args ? args.model : undefined; resourceInputs["mountingDepthMm"] = args ? args.mountingDepthMm : undefined; resourceInputs["outerDepth"] = args ? args.outerDepth : undefined; resourceInputs["outerUnit"] = args ? args.outerUnit : undefined; resourceInputs["outerWidth"] = args ? args.outerWidth : undefined; resourceInputs["slug"] = args ? args.slug : undefined; resourceInputs["startingUnit"] = args ? args.startingUnit : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["uHeight"] = args ? args.uHeight : undefined; resourceInputs["weight"] = args ? args.weight : undefined; resourceInputs["weightUnit"] = args ? args.weightUnit : undefined; resourceInputs["width"] = args ? args.width : undefined; resourceInputs["tagsAlls"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RackType.__pulumiType, name, resourceInputs, opts); } } exports.RackType = RackType; /** @internal */ RackType.__pulumiType = 'netbox:dcim/rackType:RackType'; //# sourceMappingURL=rackType.js.map