UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

188 lines • 8.01 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.Supervisor = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a resource for configuring Workload Management. * * ## Example Usage * * ### S * * ### Enable Workload Management on a Compute Cluster * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vmClass = new vsphere.VirtualMachineClass("vm_class", { * name: "custom-class", * cpus: 4, * memory: 4096, * }); * const supervisor = new vsphere.Supervisor("supervisor", { * cluster: "<compute_cluster_id>", * storagePolicy: "<storage_policy_name>", * contentLibrary: "<content_library_id>", * mainDns: "10.0.0.250", * workerDns: "10.0.0.250", * edgeCluster: "<edge_cluster_id>", * dvsUuid: "<distributed_switch_uuid>", * sizingHint: "MEDIUM", * managementNetwork: { * network: "<portgroup_id>", * subnetMask: "255.255.255.0", * startingAddress: "10.0.0.150", * gateway: "10.0.0.250", * addressCount: 5, * }, * ingressCidrs: [{ * address: "10.10.10.0", * prefix: 24, * }], * egressCidrs: [{ * address: "10.10.11.0", * prefix: 24, * }], * podCidrs: [{ * address: "10.244.10.0", * prefix: 23, * }], * serviceCidr: { * address: "10.10.12.0", * prefix: 24, * }, * searchDomains: "vsphere.local", * namespaces: [{ * name: "custom-namespace", * contentLibraries: [], * vmClasses: [vmClass.id], * }], * }); * ``` */ class Supervisor extends pulumi.CustomResource { /** * Get an existing Supervisor 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 Supervisor(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Supervisor. 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'] === Supervisor.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cluster"] = state?.cluster; resourceInputs["contentLibrary"] = state?.contentLibrary; resourceInputs["dvsUuid"] = state?.dvsUuid; resourceInputs["edgeCluster"] = state?.edgeCluster; resourceInputs["egressCidrs"] = state?.egressCidrs; resourceInputs["ingressCidrs"] = state?.ingressCidrs; resourceInputs["mainDns"] = state?.mainDns; resourceInputs["mainNtps"] = state?.mainNtps; resourceInputs["managementNetwork"] = state?.managementNetwork; resourceInputs["namespaces"] = state?.namespaces; resourceInputs["podCidrs"] = state?.podCidrs; resourceInputs["searchDomains"] = state?.searchDomains; resourceInputs["serviceCidr"] = state?.serviceCidr; resourceInputs["sizingHint"] = state?.sizingHint; resourceInputs["storagePolicy"] = state?.storagePolicy; resourceInputs["workerDns"] = state?.workerDns; resourceInputs["workerNtps"] = state?.workerNtps; } else { const args = argsOrState; if (args?.cluster === undefined && !opts.urn) { throw new Error("Missing required property 'cluster'"); } if (args?.contentLibrary === undefined && !opts.urn) { throw new Error("Missing required property 'contentLibrary'"); } if (args?.dvsUuid === undefined && !opts.urn) { throw new Error("Missing required property 'dvsUuid'"); } if (args?.edgeCluster === undefined && !opts.urn) { throw new Error("Missing required property 'edgeCluster'"); } if (args?.egressCidrs === undefined && !opts.urn) { throw new Error("Missing required property 'egressCidrs'"); } if (args?.ingressCidrs === undefined && !opts.urn) { throw new Error("Missing required property 'ingressCidrs'"); } if (args?.mainDns === undefined && !opts.urn) { throw new Error("Missing required property 'mainDns'"); } if (args?.mainNtps === undefined && !opts.urn) { throw new Error("Missing required property 'mainNtps'"); } if (args?.managementNetwork === undefined && !opts.urn) { throw new Error("Missing required property 'managementNetwork'"); } if (args?.podCidrs === undefined && !opts.urn) { throw new Error("Missing required property 'podCidrs'"); } if (args?.searchDomains === undefined && !opts.urn) { throw new Error("Missing required property 'searchDomains'"); } if (args?.serviceCidr === undefined && !opts.urn) { throw new Error("Missing required property 'serviceCidr'"); } if (args?.sizingHint === undefined && !opts.urn) { throw new Error("Missing required property 'sizingHint'"); } if (args?.storagePolicy === undefined && !opts.urn) { throw new Error("Missing required property 'storagePolicy'"); } if (args?.workerDns === undefined && !opts.urn) { throw new Error("Missing required property 'workerDns'"); } if (args?.workerNtps === undefined && !opts.urn) { throw new Error("Missing required property 'workerNtps'"); } resourceInputs["cluster"] = args?.cluster; resourceInputs["contentLibrary"] = args?.contentLibrary; resourceInputs["dvsUuid"] = args?.dvsUuid; resourceInputs["edgeCluster"] = args?.edgeCluster; resourceInputs["egressCidrs"] = args?.egressCidrs; resourceInputs["ingressCidrs"] = args?.ingressCidrs; resourceInputs["mainDns"] = args?.mainDns; resourceInputs["mainNtps"] = args?.mainNtps; resourceInputs["managementNetwork"] = args?.managementNetwork; resourceInputs["namespaces"] = args?.namespaces; resourceInputs["podCidrs"] = args?.podCidrs; resourceInputs["searchDomains"] = args?.searchDomains; resourceInputs["serviceCidr"] = args?.serviceCidr; resourceInputs["sizingHint"] = args?.sizingHint; resourceInputs["storagePolicy"] = args?.storagePolicy; resourceInputs["workerDns"] = args?.workerDns; resourceInputs["workerNtps"] = args?.workerNtps; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Supervisor.__pulumiType, name, resourceInputs, opts); } } exports.Supervisor = Supervisor; /** @internal */ Supervisor.__pulumiType = 'vsphere:index/supervisor:Supervisor'; //# sourceMappingURL=supervisor.js.map