@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
103 lines • 4.39 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.LimitV3 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V3 Limit resource within OpenStack Keystone.
*
* > **Note:** You _must_ have admin privileges in your OpenStack cloud to use
* this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const glance = openstack.identity.getService({
* name: "glance",
* });
* const project1 = new openstack.identity.Project("project_1", {name: "project_1"});
* const limit1 = new openstack.identity.LimitV3("limit_1", {
* projectId: project1.id,
* serviceId: glance.then(glance => glance.id),
* resourceName: "image_count_total",
* resourceLimit: 10,
* description: "foo",
* });
* ```
*
* ## Import
*
* Limits can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:identity/limitV3:LimitV3 limit_1 89c60255-9bd6-460c-822a-e2b959ede9d2
* ```
*/
class LimitV3 extends pulumi.CustomResource {
/**
* Get an existing LimitV3 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 LimitV3(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LimitV3. 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'] === LimitV3.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["domainId"] = state ? state.domainId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["resourceLimit"] = state ? state.resourceLimit : undefined;
resourceInputs["resourceName"] = state ? state.resourceName : undefined;
resourceInputs["serviceId"] = state ? state.serviceId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.resourceLimit === undefined) && !opts.urn) {
throw new Error("Missing required property 'resourceLimit'");
}
if ((!args || args.resourceName === undefined) && !opts.urn) {
throw new Error("Missing required property 'resourceName'");
}
if ((!args || args.serviceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["domainId"] = args ? args.domainId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["resourceLimit"] = args ? args.resourceLimit : undefined;
resourceInputs["resourceName"] = args ? args.resourceName : undefined;
resourceInputs["serviceId"] = args ? args.serviceId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LimitV3.__pulumiType, name, resourceInputs, opts);
}
}
exports.LimitV3 = LimitV3;
/** @internal */
LimitV3.__pulumiType = 'openstack:identity/limitV3:LimitV3';
//# sourceMappingURL=limitV3.js.map