@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
97 lines • 4.88 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.
*
* ## Importing Dynamic Host Volumes
*
* Dynamic host volumes are imported using the pattern `<volume ID>@<namespace>` .
*
* [`accessMode`]: /nomad/docs/other-specifications/volume/capability#access_mode
* [`attachmentMode`]: /nomad/docs/other-specifications/volume/capability#attachment_mode
* [volumeSource]: /nomad/docs/job-specification/volume#source
*/
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, { ...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?.capabilities;
resourceInputs["capacity"] = state?.capacity;
resourceInputs["capacityBytes"] = state?.capacityBytes;
resourceInputs["capacityMaxBytes"] = state?.capacityMaxBytes;
resourceInputs["capacityMinBytes"] = state?.capacityMinBytes;
resourceInputs["constraints"] = state?.constraints;
resourceInputs["hostPath"] = state?.hostPath;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["nodeId"] = state?.nodeId;
resourceInputs["nodePool"] = state?.nodePool;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["pluginId"] = state?.pluginId;
resourceInputs["state"] = state?.state;
}
else {
const args = argsOrState;
if (args?.capabilities === undefined && !opts.urn) {
throw new Error("Missing required property 'capabilities'");
}
if (args?.hostPath === undefined && !opts.urn) {
throw new Error("Missing required property 'hostPath'");
}
if (args?.nodeId === undefined && !opts.urn) {
throw new Error("Missing required property 'nodeId'");
}
resourceInputs["capabilities"] = args?.capabilities;
resourceInputs["capacity"] = args?.capacity;
resourceInputs["hostPath"] = args?.hostPath;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["nodeId"] = args?.nodeId;
resourceInputs["parameters"] = args?.parameters;
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