@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
91 lines • 4.68 kB
JavaScript
;
// *** 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.ModuleType = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/models/dcim/moduletype/):
*
* > 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.dcim.Manufacturer("test", {name: "Dell"});
* const testModuleType = new netbox.dcim.ModuleType("test", {
* manufacturerId: test.id,
* model: "Networking",
* });
* ```
*/
class ModuleType extends pulumi.CustomResource {
/**
* Get an existing ModuleType 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 ModuleType(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ModuleType. 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'] === ModuleType.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["comments"] = state ? state.comments : undefined;
resourceInputs["customFields"] = state ? state.customFields : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["manufacturerId"] = state ? state.manufacturerId : undefined;
resourceInputs["model"] = state ? state.model : undefined;
resourceInputs["partNumber"] = state ? state.partNumber : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAlls"] = state ? state.tagsAlls : undefined;
resourceInputs["weight"] = state ? state.weight : undefined;
resourceInputs["weightUnit"] = state ? state.weightUnit : 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["comments"] = args ? args.comments : undefined;
resourceInputs["customFields"] = args ? args.customFields : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["manufacturerId"] = args ? args.manufacturerId : undefined;
resourceInputs["model"] = args ? args.model : undefined;
resourceInputs["partNumber"] = args ? args.partNumber : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["weight"] = args ? args.weight : undefined;
resourceInputs["weightUnit"] = args ? args.weightUnit : undefined;
resourceInputs["tagsAlls"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ModuleType.__pulumiType, name, resourceInputs, opts);
}
}
exports.ModuleType = ModuleType;
/** @internal */
ModuleType.__pulumiType = 'netbox:dcim/moduleType:ModuleType';
//# sourceMappingURL=moduleType.js.map