@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
94 lines • 3.27 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDatastoreStatsOutput = exports.getDatastoreStats = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The `vsphere.getDatastoreStats` data source can be used to retrieve the usage
* stats of all vSphere datastore objects in a datacenter. This can then be used as
* a standalone data source to get information required as input to other data
* sources.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const datastoreStats = datacenter.then(datacenter => vsphere.getDatastoreStats({
* datacenterId: datacenter.id,
* }));
* ```
*
* A useful example of this data source would be to determine the datastore with
* the most free space. For example, in addition to the above:
*
* Create an `outputs.tf` like that:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
*
* export const maxFreeSpaceName = theirMaxFreeSpaceName;
* export const maxFreeSpace = theirMaxFreeSpace;
* ```
*
* and a `locals.tf` like that:
*/
function getDatastoreStats(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("vsphere:index/getDatastoreStats:getDatastoreStats", {
"capacity": args.capacity,
"datacenterId": args.datacenterId,
"freeSpace": args.freeSpace,
}, opts);
}
exports.getDatastoreStats = getDatastoreStats;
/**
* The `vsphere.getDatastoreStats` data source can be used to retrieve the usage
* stats of all vSphere datastore objects in a datacenter. This can then be used as
* a standalone data source to get information required as input to other data
* sources.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const datastoreStats = datacenter.then(datacenter => vsphere.getDatastoreStats({
* datacenterId: datacenter.id,
* }));
* ```
*
* A useful example of this data source would be to determine the datastore with
* the most free space. For example, in addition to the above:
*
* Create an `outputs.tf` like that:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
*
* export const maxFreeSpaceName = theirMaxFreeSpaceName;
* export const maxFreeSpace = theirMaxFreeSpace;
* ```
*
* and a `locals.tf` like that:
*/
function getDatastoreStatsOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("vsphere:index/getDatastoreStats:getDatastoreStats", {
"capacity": args.capacity,
"datacenterId": args.datacenterId,
"freeSpace": args.freeSpace,
}, opts);
}
exports.getDatastoreStatsOutput = getDatastoreStatsOutput;
//# sourceMappingURL=getDatastoreStats.js.map