UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

79 lines 3.53 kB
"use strict"; // *** 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.SiteGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/facilities/#site-groups): * * > Like regions, site groups can be arranged in a recursive hierarchy for grouping sites. However, whereas regions are intended for geographic organization, site groups may be used for functional grouping. For example, you might classify sites as corporate, branch, or customer sites in addition to where they are physically located. * > * > The use of both regions and site groups affords to independent but complementary dimensions across which sites can be organized. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const parent = new netbox.dcim.SiteGroup("parent", { * name: "parent", * description: "sample description", * }); * const child = new netbox.dcim.SiteGroup("child", { * name: "child", * description: "sample description", * parentId: parent.id, * }); * ``` */ class SiteGroup extends pulumi.CustomResource { /** * Get an existing SiteGroup 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 SiteGroup(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SiteGroup. 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'] === SiteGroup.__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["parentId"] = state ? state.parentId : undefined; resourceInputs["slug"] = state ? state.slug : undefined; } else { const args = argsOrState; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["parentId"] = args ? args.parentId : undefined; resourceInputs["slug"] = args ? args.slug : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SiteGroup.__pulumiType, name, resourceInputs, opts); } } exports.SiteGroup = SiteGroup; /** @internal */ SiteGroup.__pulumiType = 'netbox:dcim/siteGroup:SiteGroup'; //# sourceMappingURL=siteGroup.js.map