@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
131 lines • 6.09 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.Share = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this resource to configure a share.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const network1 = new openstack.networking.Network("network_1", {
* name: "network_1",
* adminStateUp: true,
* });
* const subnet1 = new openstack.networking.Subnet("subnet_1", {
* name: "subnet_1",
* cidr: "192.168.199.0/24",
* ipVersion: 4,
* networkId: network1.id,
* });
* const sharenetwork1 = new openstack.sharedfilesystem.ShareNetwork("sharenetwork_1", {
* name: "test_sharenetwork",
* description: "test share network with security services",
* neutronNetId: network1.id,
* neutronSubnetId: subnet1.id,
* });
* const share1 = new openstack.sharedfilesystem.Share("share_1", {
* name: "nfs_share",
* description: "test share description",
* shareProto: "NFS",
* size: 1,
* shareNetworkId: sharenetwork1.id,
* });
* ```
*
* ## Import
*
* This resource can be imported by specifying the ID of the share:
*
* ```sh
* $ pulumi import openstack:sharedfilesystem/share:Share share_1 id
* ```
*/
class Share extends pulumi.CustomResource {
/**
* Get an existing Share 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 Share(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Share. 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'] === Share.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allMetadata"] = state ? state.allMetadata : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["exportLocations"] = state ? state.exportLocations : undefined;
resourceInputs["hasReplicas"] = state ? state.hasReplicas : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["isPublic"] = state ? state.isPublic : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["replicationType"] = state ? state.replicationType : undefined;
resourceInputs["shareNetworkId"] = state ? state.shareNetworkId : undefined;
resourceInputs["shareProto"] = state ? state.shareProto : undefined;
resourceInputs["shareServerId"] = state ? state.shareServerId : undefined;
resourceInputs["shareType"] = state ? state.shareType : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["snapshotId"] = state ? state.snapshotId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.shareProto === undefined) && !opts.urn) {
throw new Error("Missing required property 'shareProto'");
}
if ((!args || args.size === undefined) && !opts.urn) {
throw new Error("Missing required property 'size'");
}
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["isPublic"] = args ? args.isPublic : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["shareNetworkId"] = args ? args.shareNetworkId : undefined;
resourceInputs["shareProto"] = args ? args.shareProto : undefined;
resourceInputs["shareType"] = args ? args.shareType : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["snapshotId"] = args ? args.snapshotId : undefined;
resourceInputs["allMetadata"] = undefined /*out*/;
resourceInputs["exportLocations"] = undefined /*out*/;
resourceInputs["hasReplicas"] = undefined /*out*/;
resourceInputs["host"] = undefined /*out*/;
resourceInputs["projectId"] = undefined /*out*/;
resourceInputs["replicationType"] = undefined /*out*/;
resourceInputs["shareServerId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Share.__pulumiType, name, resourceInputs, opts);
}
}
exports.Share = Share;
/** @internal */
Share.__pulumiType = 'openstack:sharedfilesystem/share:Share';
//# sourceMappingURL=share.js.map