@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
155 lines (154 loc) • 4.98 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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:
*/
export declare function getDatastoreStats(args: GetDatastoreStatsArgs, opts?: pulumi.InvokeOptions): Promise<GetDatastoreStatsResult>;
/**
* A collection of arguments for invoking getDatastoreStats.
*/
export interface GetDatastoreStatsArgs {
/**
* A mapping of the capacity for all datastore in the datacenter,
* where the name of the datastore is used as key and the capacity as value.
*/
capacity?: {
[key: string]: string;
};
/**
* The
* [managed object reference ID][docs-about-morefs] of the datacenter the
* datastores are located in. For default datacenters, use the `id` attribute
* from an empty `vsphere.Datacenter` data source.
*/
datacenterId: string;
/**
* A mapping of the free space for each datastore in the
* datacenter, where the name of the datastore is used as key and the free space
* as value.
*/
freeSpace?: {
[key: string]: string;
};
}
/**
* A collection of values returned by getDatastoreStats.
*/
export interface GetDatastoreStatsResult {
/**
* A mapping of the capacity for all datastore in the datacenter,
* where the name of the datastore is used as key and the capacity as value.
*/
readonly capacity?: {
[key: string]: string;
};
/**
* The [managed object reference ID][docs-about-morefs] of the
* datacenter the datastores are located in.
*/
readonly datacenterId: string;
/**
* A mapping of the free space for each datastore in the
* datacenter, where the name of the datastore is used as key and the free space
* as value.
*/
readonly freeSpace?: {
[key: string]: string;
};
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}
/**
* 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:
*/
export declare function getDatastoreStatsOutput(args: GetDatastoreStatsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetDatastoreStatsResult>;
/**
* A collection of arguments for invoking getDatastoreStats.
*/
export interface GetDatastoreStatsOutputArgs {
/**
* A mapping of the capacity for all datastore in the datacenter,
* where the name of the datastore is used as key and the capacity as value.
*/
capacity?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The
* [managed object reference ID][docs-about-morefs] of the datacenter the
* datastores are located in. For default datacenters, use the `id` attribute
* from an empty `vsphere.Datacenter` data source.
*/
datacenterId: pulumi.Input<string>;
/**
* A mapping of the free space for each datastore in the
* datacenter, where the name of the datastore is used as key and the free space
* as value.
*/
freeSpace?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}