@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
161 lines • 8.31 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.Image = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V2 Image resource within OpenStack Glance.
*
* > **Note:** All arguments including the source image URL password will be
* stored in the raw state as plain-text. Read more about sensitive data in
* state.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const rancheros = new openstack.images.Image("rancheros", {
* name: "RancherOS",
* imageSourceUrl: "https://releases.rancher.com/os/latest/rancheros-openstack.img",
* containerFormat: "bare",
* diskFormat: "qcow2",
* properties: {
* key: "value",
* },
* });
* ```
*
* ## Notes
*
* ### Properties
*
* This resource supports the ability to add properties to a resource during
* creation as well as add, update, and delete properties during an update of this
* resource.
*
* Newer versions of OpenStack are adding some read-only properties to each image.
* These properties start with the prefix `os_`. If these properties are detected,
* this resource will automatically reconcile these with the user-provided
* properties.
*
* In addition, the `directUrl` and `stores` properties are also automatically reconciled if the
* Image Service set it.
*
* ## Import
*
* Images can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:images/image:Image rancheros 89c60255-9bd6-460c-822a-e2b959ede9d2
* ```
*/
class Image extends pulumi.CustomResource {
/**
* Get an existing Image 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 Image(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Image. 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'] === Image.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["checksum"] = state ? state.checksum : undefined;
resourceInputs["containerFormat"] = state ? state.containerFormat : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["decompress"] = state ? state.decompress : undefined;
resourceInputs["diskFormat"] = state ? state.diskFormat : undefined;
resourceInputs["file"] = state ? state.file : undefined;
resourceInputs["hidden"] = state ? state.hidden : undefined;
resourceInputs["imageCachePath"] = state ? state.imageCachePath : undefined;
resourceInputs["imageId"] = state ? state.imageId : undefined;
resourceInputs["imageSourcePassword"] = state ? state.imageSourcePassword : undefined;
resourceInputs["imageSourceUrl"] = state ? state.imageSourceUrl : undefined;
resourceInputs["imageSourceUsername"] = state ? state.imageSourceUsername : undefined;
resourceInputs["localFilePath"] = state ? state.localFilePath : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["minDiskGb"] = state ? state.minDiskGb : undefined;
resourceInputs["minRamMb"] = state ? state.minRamMb : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["protected"] = state ? state.protected : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["schema"] = state ? state.schema : undefined;
resourceInputs["sizeBytes"] = state ? state.sizeBytes : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["verifyChecksum"] = state ? state.verifyChecksum : undefined;
resourceInputs["visibility"] = state ? state.visibility : undefined;
resourceInputs["webDownload"] = state ? state.webDownload : undefined;
}
else {
const args = argsOrState;
if ((!args || args.containerFormat === undefined) && !opts.urn) {
throw new Error("Missing required property 'containerFormat'");
}
if ((!args || args.diskFormat === undefined) && !opts.urn) {
throw new Error("Missing required property 'diskFormat'");
}
resourceInputs["containerFormat"] = args ? args.containerFormat : undefined;
resourceInputs["decompress"] = args ? args.decompress : undefined;
resourceInputs["diskFormat"] = args ? args.diskFormat : undefined;
resourceInputs["hidden"] = args ? args.hidden : undefined;
resourceInputs["imageCachePath"] = args ? args.imageCachePath : undefined;
resourceInputs["imageId"] = args ? args.imageId : undefined;
resourceInputs["imageSourcePassword"] = (args === null || args === void 0 ? void 0 : args.imageSourcePassword) ? pulumi.secret(args.imageSourcePassword) : undefined;
resourceInputs["imageSourceUrl"] = args ? args.imageSourceUrl : undefined;
resourceInputs["imageSourceUsername"] = args ? args.imageSourceUsername : undefined;
resourceInputs["localFilePath"] = args ? args.localFilePath : undefined;
resourceInputs["minDiskGb"] = args ? args.minDiskGb : undefined;
resourceInputs["minRamMb"] = args ? args.minRamMb : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["protected"] = args ? args.protected : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["verifyChecksum"] = args ? args.verifyChecksum : undefined;
resourceInputs["visibility"] = args ? args.visibility : undefined;
resourceInputs["webDownload"] = args ? args.webDownload : undefined;
resourceInputs["checksum"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["file"] = undefined /*out*/;
resourceInputs["metadata"] = undefined /*out*/;
resourceInputs["owner"] = undefined /*out*/;
resourceInputs["schema"] = undefined /*out*/;
resourceInputs["sizeBytes"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["imageSourcePassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Image.__pulumiType, name, resourceInputs, opts);
}
}
exports.Image = Image;
/** @internal */
Image.__pulumiType = 'openstack:images/image:Image';
//# sourceMappingURL=image.js.map