Class GetNetwork
Inheritance
System.Object
GetNetwork
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public static class GetNetwork
Methods
View SourceInvokeAsync(GetNetworkArgs, InvokeOptions)
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, DVS
port groups, or opaque networks such as those managed by NSX.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var datacenter = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = "dc1",
}));
var net = datacenter.Apply(datacenter => Output.Create(VSphere.GetNetwork.InvokeAsync(new VSphere.GetNetworkArgs
{
DatacenterId = datacenter.Id,
Name = "test-net",
})));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNetworkArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetNetworkResult> |