@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
74 lines • 3.32 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Region = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/features/sites-and-racks/#regions):
*
* > Sites can be arranged geographically using regions. A region might represent a continent, country, city, campus, or other area depending on your use case. Regions can be nested recursively to construct a hierarchy. For example, you might define several country regions, and within each of those several state or city regions to which sites are assigned.
* >
* > Each region must have a name that is unique within its parent region, if any.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.dcim.Region("test", {
* name: "test",
* description: "test description",
* });
* ```
*/
class Region extends pulumi.CustomResource {
/**
* Get an existing Region 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 Region(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Region. 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'] === Region.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parentRegionId"] = state ? state.parentRegionId : undefined;
resourceInputs["slug"] = state ? state.slug : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parentRegionId"] = args ? args.parentRegionId : undefined;
resourceInputs["slug"] = args ? args.slug : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Region.__pulumiType, name, resourceInputs, opts);
}
}
exports.Region = Region;
/** @internal */
Region.__pulumiType = 'netbox:dcim/region:Region';
//# sourceMappingURL=region.js.map