UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

68 lines 2.45 kB
"use strict"; // *** 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.getDatastoreOutput = exports.getDatastore = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * The `vsphere.getDatastore` data source can be used to discover the ID of a * vSphere datastore object. This can then be used with resources or data sources * that require a datastore. For example, to create virtual machines in using the * `vsphere.VirtualMachine` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * ``` */ function getDatastore(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("vsphere:index/getDatastore:getDatastore", { "datacenterId": args.datacenterId, "name": args.name, "stats": args.stats, }, opts); } exports.getDatastore = getDatastore; /** * The `vsphere.getDatastore` data source can be used to discover the ID of a * vSphere datastore object. This can then be used with resources or data sources * that require a datastore. For example, to create virtual machines in using the * `vsphere.VirtualMachine` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * ``` */ function getDatastoreOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("vsphere:index/getDatastore:getDatastore", { "datacenterId": args.datacenterId, "name": args.name, "stats": args.stats, }, opts); } exports.getDatastoreOutput = getDatastoreOutput; //# sourceMappingURL=getDatastore.js.map