@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
89 lines • 4.97 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.DynamicHostVolumeRegistration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Registers a dynamic host volume in Nomad that has already been created. Note
* that Nomad supports two workflows for dynamic host volumes: create and
* register. Both resources result in the same data source with the same outputs.
*/
class DynamicHostVolumeRegistration extends pulumi.CustomResource {
/**
* Get an existing DynamicHostVolumeRegistration 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 DynamicHostVolumeRegistration(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DynamicHostVolumeRegistration. 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'] === DynamicHostVolumeRegistration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["capabilities"] = state ? state.capabilities : undefined;
resourceInputs["capacity"] = state ? state.capacity : undefined;
resourceInputs["capacityBytes"] = state ? state.capacityBytes : undefined;
resourceInputs["capacityMaxBytes"] = state ? state.capacityMaxBytes : undefined;
resourceInputs["capacityMinBytes"] = state ? state.capacityMinBytes : undefined;
resourceInputs["constraints"] = state ? state.constraints : undefined;
resourceInputs["hostPath"] = state ? state.hostPath : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["namespace"] = state ? state.namespace : undefined;
resourceInputs["nodeId"] = state ? state.nodeId : undefined;
resourceInputs["nodePool"] = state ? state.nodePool : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["pluginId"] = state ? state.pluginId : undefined;
resourceInputs["state"] = state ? state.state : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capabilities === undefined) && !opts.urn) {
throw new Error("Missing required property 'capabilities'");
}
if ((!args || args.hostPath === undefined) && !opts.urn) {
throw new Error("Missing required property 'hostPath'");
}
if ((!args || args.nodeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodeId'");
}
resourceInputs["capabilities"] = args ? args.capabilities : undefined;
resourceInputs["capacity"] = args ? args.capacity : undefined;
resourceInputs["hostPath"] = args ? args.hostPath : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["namespace"] = args ? args.namespace : undefined;
resourceInputs["nodeId"] = args ? args.nodeId : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["capacityBytes"] = undefined /*out*/;
resourceInputs["capacityMaxBytes"] = undefined /*out*/;
resourceInputs["capacityMinBytes"] = undefined /*out*/;
resourceInputs["constraints"] = undefined /*out*/;
resourceInputs["nodePool"] = undefined /*out*/;
resourceInputs["pluginId"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DynamicHostVolumeRegistration.__pulumiType, name, resourceInputs, opts);
}
}
exports.DynamicHostVolumeRegistration = DynamicHostVolumeRegistration;
/** @internal */
DynamicHostVolumeRegistration.__pulumiType = 'nomad:index/dynamicHostVolumeRegistration:DynamicHostVolumeRegistration';
//# sourceMappingURL=dynamicHostVolumeRegistration.js.map