UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

134 lines 4.99 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.ImageAccess = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages members for the shared OpenStack Glance V2 Image within the source * project, which owns the Image. * * ## Example Usage * * ### Unprivileged user * * Create a shared image and propose a membership to the * `bed6b6cbb86a4e2d8dc2735c2f1000e4` project ID. * * ```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", * visibility: "shared", * properties: { * key: "value", * }, * }); * const rancherosMember = new openstack.images.ImageAccess("rancheros_member", { * imageId: rancheros.id, * memberId: "bed6b6cbb86a4e2d8dc2735c2f1000e4", * }); * ``` * * ### Privileged user * * Create a shared image and set a membership to the * `bed6b6cbb86a4e2d8dc2735c2f1000e4` project ID. * * ```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", * visibility: "shared", * properties: { * key: "value", * }, * }); * const rancherosMember = new openstack.images.ImageAccess("rancheros_member", { * imageId: rancheros.id, * memberId: "bed6b6cbb86a4e2d8dc2735c2f1000e4", * status: "accepted", * }); * ``` * * ## Import * * Image access can be imported using the `image_id` and the `member_id`, * * separated by a slash, e.g. * * ```sh * $ pulumi import openstack:images/imageAccess:ImageAccess openstack_images_image_access_v2 89c60255-9bd6-460c-822a-e2b959ede9d2/bed6b6cbb86a4e2d8dc2735c2f1000e4 * ``` */ class ImageAccess extends pulumi.CustomResource { /** * Get an existing ImageAccess 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 ImageAccess(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ImageAccess. 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'] === ImageAccess.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["imageId"] = state?.imageId; resourceInputs["memberId"] = state?.memberId; resourceInputs["region"] = state?.region; resourceInputs["schema"] = state?.schema; resourceInputs["status"] = state?.status; resourceInputs["updatedAt"] = state?.updatedAt; } else { const args = argsOrState; if (args?.imageId === undefined && !opts.urn) { throw new Error("Missing required property 'imageId'"); } if (args?.memberId === undefined && !opts.urn) { throw new Error("Missing required property 'memberId'"); } resourceInputs["imageId"] = args?.imageId; resourceInputs["memberId"] = args?.memberId; resourceInputs["region"] = args?.region; resourceInputs["status"] = args?.status; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["schema"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ImageAccess.__pulumiType, name, resourceInputs, opts); } } exports.ImageAccess = ImageAccess; /** @internal */ ImageAccess.__pulumiType = 'openstack:images/imageAccess:ImageAccess'; //# sourceMappingURL=imageAccess.js.map