@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
105 lines • 4.32 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.BandwidthAllocation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* BandwidthAllocation resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* //#######################################################
* // Create
* //#######################################################
* // 1000 mbps leads to 1 spn (eg: taiwan-raspberry)
* // >1000 mbps leads to 2 spns (eg: taiwan-raspberry, taiwan-larch)
* // >2000 mbps leads to 3 spns and so on. (eg: taiwan-raspberry, taiwan-larch, taiwan-peng)
* // The API is smart enough to generate these spn's and return to us.
* // To create with qos use following example
* // resource "scm_bandwidth_allocation" "example" {
* // name = "taiwan"
* // allocated_bandwidth = 50 # In Mbps
* //
* // qos = {
* // enabled = true
* // customized = false # Set to true if using a custom profile
* // profile = "Default Profile" # Name of the QoS Profile
* // guaranteed_ratio = 20 # 20% guaranteed bandwidth ratio. API seems to accept only round integers
* // }
* //}
* // When creating, we never specify an spn_name_list. That is purely during update
* const example = new scm.BandwidthAllocation("example", {
* name: "taiwan",
* allocatedBandwidth: 50,
* });
* ```
*
* ## Import
*
* The following command can be used to import a resource not managed by Terraform:
*
* bash
*
* ```sh
* $ pulumi import scm:index/bandwidthAllocation:BandwidthAllocation example <name_value_of_the_resource>
* ```
*/
class BandwidthAllocation extends pulumi.CustomResource {
/**
* Get an existing BandwidthAllocation 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 BandwidthAllocation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of BandwidthAllocation. 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'] === BandwidthAllocation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allocatedBandwidth"] = state?.allocatedBandwidth;
resourceInputs["name"] = state?.name;
resourceInputs["qos"] = state?.qos;
resourceInputs["spnNameLists"] = state?.spnNameLists;
resourceInputs["tfid"] = state?.tfid;
}
else {
const args = argsOrState;
if (args?.allocatedBandwidth === undefined && !opts.urn) {
throw new Error("Missing required property 'allocatedBandwidth'");
}
resourceInputs["allocatedBandwidth"] = args?.allocatedBandwidth;
resourceInputs["name"] = args?.name;
resourceInputs["qos"] = args?.qos;
resourceInputs["spnNameLists"] = args?.spnNameLists;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BandwidthAllocation.__pulumiType, name, resourceInputs, opts);
}
}
exports.BandwidthAllocation = BandwidthAllocation;
/** @internal */
BandwidthAllocation.__pulumiType = 'scm:index/bandwidthAllocation:BandwidthAllocation';
//# sourceMappingURL=bandwidthAllocation.js.map