@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
92 lines • 3.76 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.QosAssociationV3 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V3 block storage Qos Association resource within OpenStack.
*
* > **Note:** This usually requires admin privileges.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const qos = new openstack.blockstorage.QosV3("qos", {
* name: "%s",
* consumer: "front-end",
* specs: {
* read_iops_sec: "20000",
* },
* });
* const volumeType = new openstack.blockstorage.VolumeTypeV3("volume_type", {name: "%s"});
* const qosAssociation = new openstack.blockstorage.QosAssociationV3("qos_association", {
* qosId: qos.id,
* volumeTypeId: volumeType.id,
* });
* ```
*
* ## Import
*
* Qos association can be imported using the `qos_id/volume_type_id`, e.g.
*
* ```sh
* $ pulumi import openstack:blockstorage/qosAssociationV3:QosAssociationV3 qos_association 941793f0-0a34-4bc4-b72e-a6326ae58283/ea257959-eeb1-4c10-8d33-26f0409a755d
* ```
*/
class QosAssociationV3 extends pulumi.CustomResource {
/**
* Get an existing QosAssociationV3 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 QosAssociationV3(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of QosAssociationV3. 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'] === QosAssociationV3.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["qosId"] = state ? state.qosId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["volumeTypeId"] = state ? state.volumeTypeId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.qosId === undefined) && !opts.urn) {
throw new Error("Missing required property 'qosId'");
}
if ((!args || args.volumeTypeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'volumeTypeId'");
}
resourceInputs["qosId"] = args ? args.qosId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["volumeTypeId"] = args ? args.volumeTypeId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(QosAssociationV3.__pulumiType, name, resourceInputs, opts);
}
}
exports.QosAssociationV3 = QosAssociationV3;
/** @internal */
QosAssociationV3.__pulumiType = 'openstack:blockstorage/qosAssociationV3:QosAssociationV3';
//# sourceMappingURL=qosAssociationV3.js.map