UNPKG

@muhlba91/pulumi-proxmoxve

Version:

A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.

93 lines 3.77 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.HAResource = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages Proxmox HA resources. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const example = new proxmoxve.ha.HAResource("example", { * resourceId: "vm:123", * state: "started", * group: "example", * comment: "Managed by Pulumi", * }, { * dependsOn: [proxmox_virtual_environment_hagroup.example], * }); * ``` * * ## Import * * #!/usr/bin/env sh * * HA resources can be imported using their identifiers, e.g.: * * ```sh * $ pulumi import proxmoxve:HA/hAResource:HAResource example vm:123 * ``` */ class HAResource extends pulumi.CustomResource { /** * Get an existing HAResource 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 HAResource(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of HAResource. 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'] === HAResource.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["comment"] = state ? state.comment : undefined; resourceInputs["group"] = state ? state.group : undefined; resourceInputs["maxRelocate"] = state ? state.maxRelocate : undefined; resourceInputs["maxRestart"] = state ? state.maxRestart : undefined; resourceInputs["resourceId"] = state ? state.resourceId : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.resourceId === undefined) && !opts.urn) { throw new Error("Missing required property 'resourceId'"); } resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["group"] = args ? args.group : undefined; resourceInputs["maxRelocate"] = args ? args.maxRelocate : undefined; resourceInputs["maxRestart"] = args ? args.maxRestart : undefined; resourceInputs["resourceId"] = args ? args.resourceId : undefined; resourceInputs["state"] = args ? args.state : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HAResource.__pulumiType, name, resourceInputs, opts); } } exports.HAResource = HAResource; /** @internal */ HAResource.__pulumiType = 'proxmoxve:HA/hAResource:HAResource'; //# sourceMappingURL=haresource.js.map