UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

112 lines 5.05 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.TempUrl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this resource to generate an OpenStack Object Storage temporary URL. * * The temporary URL will be valid for as long as TTL is set to (in seconds). * Once the URL has expired, it will no longer be valid, but the resource * will remain in place. If you wish to automatically regenerate a URL, set * the `regenerate` argument to `true`. This will create a new resource with * a new ID and URL. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const container1 = new openstack.objectstorage.Container("container_1", { * name: "test", * metadata: { * "Temp-URL-Key": "testkey", * }, * }); * const object1 = new openstack.objectstorage.ContainerObject("object_1", { * containerName: container1.name, * name: "test", * content: "Hello, world!", * }); * const objTempurl = new openstack.objectstorage.TempUrl("obj_tempurl", { * container: container1.name, * object: object1.name, * method: "post", * ttl: 20, * }); * ``` */ class TempUrl extends pulumi.CustomResource { /** * Get an existing TempUrl 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 TempUrl(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of TempUrl. 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'] === TempUrl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["container"] = state ? state.container : undefined; resourceInputs["digest"] = state ? state.digest : undefined; resourceInputs["key"] = state ? state.key : undefined; resourceInputs["method"] = state ? state.method : undefined; resourceInputs["object"] = state ? state.object : undefined; resourceInputs["regenerate"] = state ? state.regenerate : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["split"] = state ? state.split : undefined; resourceInputs["ttl"] = state ? state.ttl : undefined; resourceInputs["url"] = state ? state.url : undefined; } else { const args = argsOrState; if ((!args || args.container === undefined) && !opts.urn) { throw new Error("Missing required property 'container'"); } if ((!args || args.object === undefined) && !opts.urn) { throw new Error("Missing required property 'object'"); } if ((!args || args.ttl === undefined) && !opts.urn) { throw new Error("Missing required property 'ttl'"); } resourceInputs["container"] = args ? args.container : undefined; resourceInputs["digest"] = args ? args.digest : undefined; resourceInputs["key"] = (args === null || args === void 0 ? void 0 : args.key) ? pulumi.secret(args.key) : undefined; resourceInputs["method"] = args ? args.method : undefined; resourceInputs["object"] = args ? args.object : undefined; resourceInputs["regenerate"] = args ? args.regenerate : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["split"] = args ? args.split : undefined; resourceInputs["ttl"] = args ? args.ttl : undefined; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["key", "url"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(TempUrl.__pulumiType, name, resourceInputs, opts); } } exports.TempUrl = TempUrl; /** @internal */ TempUrl.__pulumiType = 'openstack:objectstorage/tempUrl:TempUrl'; //# sourceMappingURL=tempUrl.js.map