UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

104 lines 5.47 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.CircuitTermination = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/circuits/#circuit-terminations): * * > The association of a circuit with a particular site and/or device is modeled separately as a circuit termination. A circuit may have up to two terminations, labeled A and Z. A single-termination circuit can be used when you don't know (or care) about the far end of a circuit (for example, an Internet access circuit which connects to a transit provider). A dual-termination circuit is useful for tracking circuits which connect two sites. * > * > Each circuit termination is attached to either a site or to a provider network. Site terminations may optionally be connected via a cable to a specific device interface or port within that site. Each termination must be assigned a port speed, and can optionally be assigned an upstream speed if it differs from the downstream speed (a common scenario with e.g. DOCSIS cable modems). Fields are also available to track cross-connect and patch panel details. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const test = new netbox.dcim.Site("test", { * name: "%[1]s", * status: "active", * }); * const testCircuitProvider = new netbox.circuit.CircuitProvider("test", {name: "%[1]s"}); * const testCircuitType = new netbox.circuit.CircuitType("test", {name: "%[1]s"}); * const testCircuit = new netbox.circuit.Circuit("test", { * cid: "%[1]s", * status: "active", * providerId: testCircuitProvider.id, * typeId: testCircuitType.id, * }); * const testCircuitTermination = new netbox.circuit.CircuitTermination("test", { * circuitId: testCircuit.id, * termSide: "A", * siteId: test.id, * portSpeed: 100000, * upstreamSpeed: 50000, * }); * ``` */ class CircuitTermination extends pulumi.CustomResource { /** * Get an existing CircuitTermination 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 CircuitTermination(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CircuitTermination. 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'] === CircuitTermination.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["circuitId"] = state ? state.circuitId : undefined; resourceInputs["customFields"] = state ? state.customFields : undefined; resourceInputs["portSpeed"] = state ? state.portSpeed : undefined; resourceInputs["siteId"] = state ? state.siteId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["termSide"] = state ? state.termSide : undefined; resourceInputs["upstreamSpeed"] = state ? state.upstreamSpeed : undefined; } else { const args = argsOrState; if ((!args || args.circuitId === undefined) && !opts.urn) { throw new Error("Missing required property 'circuitId'"); } if ((!args || args.siteId === undefined) && !opts.urn) { throw new Error("Missing required property 'siteId'"); } if ((!args || args.termSide === undefined) && !opts.urn) { throw new Error("Missing required property 'termSide'"); } resourceInputs["circuitId"] = args ? args.circuitId : undefined; resourceInputs["customFields"] = args ? args.customFields : undefined; resourceInputs["portSpeed"] = args ? args.portSpeed : undefined; resourceInputs["siteId"] = args ? args.siteId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["termSide"] = args ? args.termSide : undefined; resourceInputs["upstreamSpeed"] = args ? args.upstreamSpeed : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CircuitTermination.__pulumiType, name, resourceInputs, opts); } } exports.CircuitTermination = CircuitTermination; /** @internal */ CircuitTermination.__pulumiType = 'netbox:circuit/circuitTermination:CircuitTermination'; //# sourceMappingURL=circuitTermination.js.map