UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

164 lines 5.75 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.getResourcePoolOutput = exports.getResourcePool = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * The `vsphere.ResourcePool` data source can be used to discover the ID of a * resource pool in vSphere. This is useful to return the ID of a resource pool * that you want to use to create virtual machines in using the * `vsphere.VirtualMachine` resource. * * ## Example Usage * * ### Find a Resource Pool by Path * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const pool = datacenter.then(datacenter => vsphere.getResourcePool({ * name: "cluster-01/Resources", * datacenterId: datacenter.id, * })); * ``` * * ### Find a Child Resource Pool Using the Parent ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const parentPool = datacenter.then(datacenter => vsphere.getResourcePool({ * name: "cluster-01/Resources", * datacenterId: datacenter.id, * })); * const childPool = parentPool.then(parentPool => vsphere.getResourcePool({ * name: "example", * parentResourcePoolId: parentPool.id, * })); * ``` * * ### Specifying the Root Resource Pool for a Standalone ESXi Host * * > **NOTE:** Returning the root resource pool for a cluster can be done * directly via the `vsphere.ComputeCluster` * data source. * * All compute resources in vSphere have a resource pool, even if one has not been * explicitly created. This resource pool is referred to as the _root resource * pool_ and can be looked up by specifying the path. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const pool = vsphere.getResourcePool({ * name: "esxi-01.example.com/Resources", * datacenterId: datacenter.id, * }); * ``` * * For more information on the root resource pool, see * [Managing Resource Pools][vmware-docs-resource-pools] in the vSphere * documentation. * * [vmware-docs-resource-pools]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/managing-resource-pools.html */ function getResourcePool(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("vsphere:index/getResourcePool:getResourcePool", { "datacenterId": args.datacenterId, "name": args.name, "parentResourcePoolId": args.parentResourcePoolId, }, opts); } exports.getResourcePool = getResourcePool; /** * The `vsphere.ResourcePool` data source can be used to discover the ID of a * resource pool in vSphere. This is useful to return the ID of a resource pool * that you want to use to create virtual machines in using the * `vsphere.VirtualMachine` resource. * * ## Example Usage * * ### Find a Resource Pool by Path * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const pool = datacenter.then(datacenter => vsphere.getResourcePool({ * name: "cluster-01/Resources", * datacenterId: datacenter.id, * })); * ``` * * ### Find a Child Resource Pool Using the Parent ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const parentPool = datacenter.then(datacenter => vsphere.getResourcePool({ * name: "cluster-01/Resources", * datacenterId: datacenter.id, * })); * const childPool = parentPool.then(parentPool => vsphere.getResourcePool({ * name: "example", * parentResourcePoolId: parentPool.id, * })); * ``` * * ### Specifying the Root Resource Pool for a Standalone ESXi Host * * > **NOTE:** Returning the root resource pool for a cluster can be done * directly via the `vsphere.ComputeCluster` * data source. * * All compute resources in vSphere have a resource pool, even if one has not been * explicitly created. This resource pool is referred to as the _root resource * pool_ and can be looked up by specifying the path. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const pool = vsphere.getResourcePool({ * name: "esxi-01.example.com/Resources", * datacenterId: datacenter.id, * }); * ``` * * For more information on the root resource pool, see * [Managing Resource Pools][vmware-docs-resource-pools] in the vSphere * documentation. * * [vmware-docs-resource-pools]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-resource-management-8-0/managing-resource-pools.html */ function getResourcePoolOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("vsphere:index/getResourcePool:getResourcePool", { "datacenterId": args.datacenterId, "name": args.name, "parentResourcePoolId": args.parentResourcePoolId, }, opts); } exports.getResourcePoolOutput = getResourcePoolOutput; //# sourceMappingURL=getResourcePool.js.map