@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
102 lines • 5.37 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.DevicePowerOutlet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/models/dcim/poweroutlet/):
*
* > Power outlets represent the outlets on a power distribution unit (PDU) or other device that supplies power to dependent devices. Each power port may be assigned a physical type, and may be associated with a specific feed leg (where three-phase power is used) and/or a specific upstream power port. This association can be used to model the distribution of power within a device.
*
* For example, imagine a PDU with one power port which draws from a three-phase feed and 48 power outlets arranged into three banks of 16 outlets each. Outlets 1-16 would be associated with leg A on the port, and outlets 17-32 and 33-48 would be associated with legs B and C, respectively.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* // Note that some terraform code is not included in the example for brevity
* const test = new netbox.dcim.Device("test", {
* name: "%[1]s",
* deviceTypeId: testNetboxDeviceType.id,
* roleId: testNetboxDeviceRole.id,
* siteId: testNetboxSite.id,
* });
* const testDevicePowerOutlet = new netbox.dcim.DevicePowerOutlet("test", {
* deviceId: test.id,
* name: "power outlet",
* type: "iec-60320-c5",
* feedLeg: "A",
* });
* ```
*/
class DevicePowerOutlet extends pulumi.CustomResource {
/**
* Get an existing DevicePowerOutlet 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 DevicePowerOutlet(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DevicePowerOutlet. 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'] === DevicePowerOutlet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["customFields"] = state ? state.customFields : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["deviceId"] = state ? state.deviceId : undefined;
resourceInputs["feedLeg"] = state ? state.feedLeg : undefined;
resourceInputs["label"] = state ? state.label : undefined;
resourceInputs["markConnected"] = state ? state.markConnected : undefined;
resourceInputs["moduleId"] = state ? state.moduleId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["powerPortId"] = state ? state.powerPortId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAlls"] = state ? state.tagsAlls : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.deviceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'deviceId'");
}
resourceInputs["customFields"] = args ? args.customFields : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["deviceId"] = args ? args.deviceId : undefined;
resourceInputs["feedLeg"] = args ? args.feedLeg : undefined;
resourceInputs["label"] = args ? args.label : undefined;
resourceInputs["markConnected"] = args ? args.markConnected : undefined;
resourceInputs["moduleId"] = args ? args.moduleId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["powerPortId"] = args ? args.powerPortId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["tagsAlls"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DevicePowerOutlet.__pulumiType, name, resourceInputs, opts);
}
}
exports.DevicePowerOutlet = DevicePowerOutlet;
/** @internal */
DevicePowerOutlet.__pulumiType = 'netbox:dcim/devicePowerOutlet:DevicePowerOutlet';
//# sourceMappingURL=devicePowerOutlet.js.map