UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

109 lines 4.71 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, { ...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?.attachments; resourceInputs["availabilityZone"] = state?.availabilityZone; resourceInputs["backupId"] = state?.backupId; resourceInputs["consistencyGroupId"] = state?.consistencyGroupId; resourceInputs["description"] = state?.description; resourceInputs["enableOnlineResize"] = state?.enableOnlineResize; resourceInputs["imageId"] = state?.imageId; resourceInputs["metadata"] = state?.metadata; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["schedulerHints"] = state?.schedulerHints; resourceInputs["size"] = state?.size; resourceInputs["snapshotId"] = state?.snapshotId; resourceInputs["sourceReplica"] = state?.sourceReplica; resourceInputs["sourceVolId"] = state?.sourceVolId; resourceInputs["volumeRetypePolicy"] = state?.volumeRetypePolicy; resourceInputs["volumeType"] = state?.volumeType; } else { const args = argsOrState; if (args?.size === undefined && !opts.urn) { throw new Error("Missing required property 'size'"); } resourceInputs["availabilityZone"] = args?.availabilityZone; resourceInputs["backupId"] = args?.backupId; resourceInputs["consistencyGroupId"] = args?.consistencyGroupId; resourceInputs["description"] = args?.description; resourceInputs["enableOnlineResize"] = args?.enableOnlineResize; resourceInputs["imageId"] = args?.imageId; resourceInputs["metadata"] = args?.metadata; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["schedulerHints"] = args?.schedulerHints; resourceInputs["size"] = args?.size; resourceInputs["snapshotId"] = args?.snapshotId; resourceInputs["sourceReplica"] = args?.sourceReplica; resourceInputs["sourceVolId"] = args?.sourceVolId; resourceInputs["volumeRetypePolicy"] = args?.volumeRetypePolicy; resourceInputs["volumeType"] = args?.volumeType; 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