@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
92 lines • 4.18 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.InterfaceTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/models/dcim/interfacetemplate/):
*
* > A template for a network interface that will be created on all instantiations of the parent device type. See the interface documentation for more detail.
*
* ## 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 testDeviceType = new netbox.dcim.DeviceType("test", {
* model: "test-model",
* slug: "test-model",
* partNumber: "test-part-number",
* manufacturerId: test.id,
* });
* const testInterfaceTemplate = new netbox.dcim.InterfaceTemplate("test", {
* name: "eth0",
* description: "eth0 description",
* label: "eth0 label",
* deviceTypeId: testDeviceType.id,
* type: "100base-tx",
* mgmtOnly: true,
* });
* ```
*/
class InterfaceTemplate extends pulumi.CustomResource {
/**
* Get an existing InterfaceTemplate 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 InterfaceTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InterfaceTemplate. 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'] === InterfaceTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["deviceTypeId"] = state ? state.deviceTypeId : undefined;
resourceInputs["label"] = state ? state.label : undefined;
resourceInputs["mgmtOnly"] = state ? state.mgmtOnly : undefined;
resourceInputs["moduleTypeId"] = state ? state.moduleTypeId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["deviceTypeId"] = args ? args.deviceTypeId : undefined;
resourceInputs["label"] = args ? args.label : undefined;
resourceInputs["mgmtOnly"] = args ? args.mgmtOnly : undefined;
resourceInputs["moduleTypeId"] = args ? args.moduleTypeId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InterfaceTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.InterfaceTemplate = InterfaceTemplate;
/** @internal */
InterfaceTemplate.__pulumiType = 'netbox:dcim/interfaceTemplate:InterfaceTemplate';
//# sourceMappingURL=interfaceTemplate.js.map