UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

109 lines 5.37 kB
"use strict"; // *** 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.Volume = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V3 volume resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const volume1 = new openstack.blockstorage.Volume("volume_1", { * region: "RegionOne", * name: "volume_1", * description: "first test volume", * size: 3, * }); * ``` * * ## Import * * Volumes can be imported using the `id`, e.g. * * ```sh * $ pulumi import openstack:blockstorage/volume:Volume volume_1 ea257959-eeb1-4c10-8d33-26f0409a755d * ``` */ class Volume extends pulumi.CustomResource { /** * Get an existing Volume 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 Volume(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Volume. 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'] === Volume.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["attachments"] = state ? state.attachments : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["backupId"] = state ? state.backupId : undefined; resourceInputs["consistencyGroupId"] = state ? state.consistencyGroupId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enableOnlineResize"] = state ? state.enableOnlineResize : undefined; resourceInputs["imageId"] = state ? state.imageId : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["schedulerHints"] = state ? state.schedulerHints : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["snapshotId"] = state ? state.snapshotId : undefined; resourceInputs["sourceReplica"] = state ? state.sourceReplica : undefined; resourceInputs["sourceVolId"] = state ? state.sourceVolId : undefined; resourceInputs["volumeRetypePolicy"] = state ? state.volumeRetypePolicy : undefined; resourceInputs["volumeType"] = state ? state.volumeType : undefined; } else { const args = argsOrState; if ((!args || args.size === undefined) && !opts.urn) { throw new Error("Missing required property 'size'"); } resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined; resourceInputs["backupId"] = args ? args.backupId : undefined; resourceInputs["consistencyGroupId"] = args ? args.consistencyGroupId : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enableOnlineResize"] = args ? args.enableOnlineResize : undefined; resourceInputs["imageId"] = args ? args.imageId : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["schedulerHints"] = args ? args.schedulerHints : undefined; resourceInputs["size"] = args ? args.size : undefined; resourceInputs["snapshotId"] = args ? args.snapshotId : undefined; resourceInputs["sourceReplica"] = args ? args.sourceReplica : undefined; resourceInputs["sourceVolId"] = args ? args.sourceVolId : undefined; resourceInputs["volumeRetypePolicy"] = args ? args.volumeRetypePolicy : undefined; resourceInputs["volumeType"] = args ? args.volumeType : undefined; resourceInputs["attachments"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Volume.__pulumiType, name, resourceInputs, opts); } } exports.Volume = Volume; /** @internal */ Volume.__pulumiType = 'openstack:blockstorage/volume:Volume'; //# sourceMappingURL=volume.js.map