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