UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

112 lines 3.85 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.getNetworkOutput = exports.getNetwork = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * The `vsphere.getNetwork` data source can be used to discover the ID of a network in * vSphere. This can be any network that can be used as the backing for a network * interface for `vsphere.VirtualMachine` or any other vSphere resource that * requires a network. This includes standard (host-based) port groups, distributed * port groups, or opaque networks such as those managed by NSX. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "VM Network", * datacenterId: datacenter.id, * })); * ``` * * ### Additional Examples * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const myPortGroup = datacenter.then(datacenter => vsphere.getNetwork({ * datacenterId: datacenter.id, * name: "VM Network", * filters: [{ * networkType: "Network", * }], * })); * ``` */ function getNetwork(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("vsphere:index/getNetwork:getNetwork", { "datacenterId": args.datacenterId, "distributedVirtualSwitchUuid": args.distributedVirtualSwitchUuid, "filters": args.filters, "name": args.name, "retryInterval": args.retryInterval, "retryTimeout": args.retryTimeout, }, opts); } exports.getNetwork = getNetwork; /** * The `vsphere.getNetwork` data source can be used to discover the ID of a network in * vSphere. This can be any network that can be used as the backing for a network * interface for `vsphere.VirtualMachine` or any other vSphere resource that * requires a network. This includes standard (host-based) port groups, distributed * port groups, or opaque networks such as those managed by NSX. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "VM Network", * datacenterId: datacenter.id, * })); * ``` * * ### Additional Examples * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const myPortGroup = datacenter.then(datacenter => vsphere.getNetwork({ * datacenterId: datacenter.id, * name: "VM Network", * filters: [{ * networkType: "Network", * }], * })); * ``` */ function getNetworkOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("vsphere:index/getNetwork:getNetwork", { "datacenterId": args.datacenterId, "distributedVirtualSwitchUuid": args.distributedVirtualSwitchUuid, "filters": args.filters, "name": args.name, "retryInterval": args.retryInterval, "retryTimeout": args.retryTimeout, }, opts); } exports.getNetworkOutput = getNetworkOutput; //# sourceMappingURL=getNetwork.js.map