@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
94 lines • 4.12 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.QosBandwidthLimitRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V2 Neutron QoS bandwidth limit rule resource within OpenStack.
*
* ## Example Usage
*
* ### Create a QoS Policy with some bandwidth limit rule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const qosPolicy1 = new openstack.networking.QosPolicy("qos_policy_1", {
* name: "qos_policy_1",
* description: "bw_limit",
* });
* const bwLimitRule1 = new openstack.networking.QosBandwidthLimitRule("bw_limit_rule_1", {
* qosPolicyId: qosPolicy1.id,
* maxKbps: 3000,
* maxBurstKbps: 300,
* direction: "egress",
* });
* ```
*
* ## Import
*
* QoS bandwidth limit rules can be imported using the `qos_policy_id/bandwidth_limit_rule` format, e.g.
*
* ```sh
* $ pulumi import openstack:networking/qosBandwidthLimitRule:QosBandwidthLimitRule bw_limit_rule_1 d6ae28ce-fcb5-4180-aa62-d260a27e09ae/46dfb556-b92f-48ce-94c5-9a9e2140de94
* ```
*/
class QosBandwidthLimitRule extends pulumi.CustomResource {
/**
* Get an existing QosBandwidthLimitRule 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 QosBandwidthLimitRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of QosBandwidthLimitRule. 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'] === QosBandwidthLimitRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["direction"] = state ? state.direction : undefined;
resourceInputs["maxBurstKbps"] = state ? state.maxBurstKbps : undefined;
resourceInputs["maxKbps"] = state ? state.maxKbps : undefined;
resourceInputs["qosPolicyId"] = state ? state.qosPolicyId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
}
else {
const args = argsOrState;
if ((!args || args.maxKbps === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxKbps'");
}
if ((!args || args.qosPolicyId === undefined) && !opts.urn) {
throw new Error("Missing required property 'qosPolicyId'");
}
resourceInputs["direction"] = args ? args.direction : undefined;
resourceInputs["maxBurstKbps"] = args ? args.maxBurstKbps : undefined;
resourceInputs["maxKbps"] = args ? args.maxKbps : undefined;
resourceInputs["qosPolicyId"] = args ? args.qosPolicyId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(QosBandwidthLimitRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.QosBandwidthLimitRule = QosBandwidthLimitRule;
/** @internal */
QosBandwidthLimitRule.__pulumiType = 'openstack:networking/qosBandwidthLimitRule:QosBandwidthLimitRule';
//# sourceMappingURL=qosBandwidthLimitRule.js.map