UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

93 lines 4.73 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.Circuit = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/circuits/#circuits_1): * * > A communications circuit represents a single physical link connecting exactly two endpoints, commonly referred to as its A and Z terminations. A circuit in NetBox may have zero, one, or two terminations defined. It is common to have only one termination defined when you don't necessarily care about the details of the provider side of the circuit, e.g. for Internet access circuits. Both terminations would likely be modeled for circuits which connect one customer site to another. * > * > Each circuit is associated with a provider and a user-defined type. For example, you might have Internet access circuits delivered to each site by one provider, and private MPLS circuits delivered by another. Each circuit must be assigned a circuit ID, each of which must be unique per provider. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const test = new netbox.tenancy.Tenant("test", {name: "test"}); * const testCircuitProvider = new netbox.circuit.CircuitProvider("test", {name: "test"}); * const testCircuitType = new netbox.circuit.CircuitType("test", {name: "test"}); * const testCircuit = new netbox.circuit.Circuit("test", { * cid: "test", * status: "active", * providerId: testCircuitProvider.id, * typeId: testCircuitType.id, * }); * ``` */ class Circuit extends pulumi.CustomResource { /** * Get an existing Circuit 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 Circuit(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Circuit. 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'] === Circuit.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cid"] = state ? state.cid : undefined; resourceInputs["providerId"] = state ? state.providerId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["typeId"] = state ? state.typeId : undefined; } else { const args = argsOrState; if ((!args || args.cid === undefined) && !opts.urn) { throw new Error("Missing required property 'cid'"); } if ((!args || args.providerId === undefined) && !opts.urn) { throw new Error("Missing required property 'providerId'"); } if ((!args || args.status === undefined) && !opts.urn) { throw new Error("Missing required property 'status'"); } if ((!args || args.typeId === undefined) && !opts.urn) { throw new Error("Missing required property 'typeId'"); } resourceInputs["cid"] = args ? args.cid : undefined; resourceInputs["providerId"] = args ? args.providerId : undefined; resourceInputs["status"] = args ? args.status : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["typeId"] = args ? args.typeId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Circuit.__pulumiType, name, resourceInputs, opts); } } exports.Circuit = Circuit; /** @internal */ Circuit.__pulumiType = 'netbox:circuit/circuit:Circuit'; //# sourceMappingURL=circuit.js.map