Nutanix v0.7.3 published on Thursday, Mar 13, 2025 by Piers Karsenbarg
nutanix.getSubnets
Explore with Pulumi AI
 
Nutanix v0.7.3 published on Thursday, Mar 13, 2025 by Piers Karsenbarg
Describes a list of subnets
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pulumi/nutanix";
const subnets = nutanix.getSubnets({});
const test = nutanix.getSubnets({
    metadatas: [{
        filter: "name==vlan0_test_2",
    }],
});
import pulumi
import pulumi_nutanix as nutanix
subnets = nutanix.get_subnets()
test = nutanix.get_subnets(metadatas=[{
    "filter": "name==vlan0_test_2",
}])
package main
import (
	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nutanix.GetSubnets(ctx, &nutanix.GetSubnetsArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = nutanix.GetSubnets(ctx, &nutanix.GetSubnetsArgs{
			Metadatas: []nutanix.GetSubnetsMetadata{
				{
					Filter: "name==vlan0_test_2",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = Pulumi.Nutanix;
return await Deployment.RunAsync(() => 
{
    var subnets = Nutanix.GetSubnets.Invoke();
    var test = Nutanix.GetSubnets.Invoke(new()
    {
        Metadatas = new[]
        {
            new Nutanix.Inputs.GetSubnetsMetadataInputArgs
            {
                Filter = "name==vlan0_test_2",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.NutanixFunctions;
import com.pulumi.nutanix.inputs.GetSubnetsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var subnets = NutanixFunctions.getSubnets();
        final var test = NutanixFunctions.getSubnets(GetSubnetsArgs.builder()
            .metadatas(GetSubnetsMetadataArgs.builder()
                .filter("name==vlan0_test_2")
                .build())
            .build());
    }
}
variables:
  subnets:
    fn::invoke:
      function: nutanix:getSubnets
      arguments: {}
  test:
    fn::invoke:
      function: nutanix:getSubnets
      arguments:
        metadatas:
          - filter: name==vlan0_test_2
Using getSubnets
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSubnets(args: GetSubnetsArgs, opts?: InvokeOptions): Promise<GetSubnetsResult>
function getSubnetsOutput(args: GetSubnetsOutputArgs, opts?: InvokeOptions): Output<GetSubnetsResult>def get_subnets(metadatas: Optional[Sequence[GetSubnetsMetadata]] = None,
                opts: Optional[InvokeOptions] = None) -> GetSubnetsResult
def get_subnets_output(metadatas: Optional[pulumi.Input[Sequence[pulumi.Input[GetSubnetsMetadataArgs]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetSubnetsResult]func GetSubnets(ctx *Context, args *GetSubnetsArgs, opts ...InvokeOption) (*GetSubnetsResult, error)
func GetSubnetsOutput(ctx *Context, args *GetSubnetsOutputArgs, opts ...InvokeOption) GetSubnetsResultOutput> Note: This function is named GetSubnets in the Go SDK.
public static class GetSubnets 
{
    public static Task<GetSubnetsResult> InvokeAsync(GetSubnetsArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetsResult> Invoke(GetSubnetsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
public static Output<GetSubnetsResult> getSubnets(GetSubnetsArgs args, InvokeOptions options)
fn::invoke:
  function: nutanix:index/getSubnets:getSubnets
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Metadatas
List<PiersKarsenbarg. Nutanix. Inputs. Get Subnets Metadata> 
- The subnet kind metadata.
- Metadatas
[]GetSubnets Metadata 
- The subnet kind metadata.
- metadatas
List<GetSubnets Metadata> 
- The subnet kind metadata.
- metadatas
GetSubnets Metadata[] 
- The subnet kind metadata.
- metadatas
Sequence[GetSubnets Metadata] 
- The subnet kind metadata.
- metadatas List<Property Map>
- The subnet kind metadata.
getSubnets Result
The following output properties are available:
- ApiVersion string
- version of the API
- Entities
List<PiersKarsenbarg. Nutanix. Outputs. Get Subnets Entity> 
- List of Subnets
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
List<PiersKarsenbarg. Nutanix. Outputs. Get Subnets Metadata> 
- The subnet kind metadata.
- ApiVersion string
- version of the API
- Entities
[]GetSubnets Entity 
- List of Subnets
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
[]GetSubnets Metadata 
- The subnet kind metadata.
- apiVersion String
- version of the API
- entities
List<GetSubnets Entity> 
- List of Subnets
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas
List<GetSubnets Metadata> 
- The subnet kind metadata.
- apiVersion string
- version of the API
- entities
GetSubnets Entity[] 
- List of Subnets
- id string
- The provider-assigned unique ID for this managed resource.
- metadatas
GetSubnets Metadata[] 
- The subnet kind metadata.
- api_version str
- version of the API
- entities
Sequence[GetSubnets Entity] 
- List of Subnets
- id str
- The provider-assigned unique ID for this managed resource.
- metadatas
Sequence[GetSubnets Metadata] 
- The subnet kind metadata.
- apiVersion String
- version of the API
- entities List<Property Map>
- List of Subnets
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas List<Property Map>
- The subnet kind metadata.
Supporting Types
GetSubnetsEntity  
- ApiVersion string
- version of the API
- AvailabilityZone Dictionary<string, string>Reference 
- The reference to a availability_zone.
- Categories
List<PiersKarsenbarg. Nutanix. Inputs. Get Subnets Entity Category> 
- The API Version.
- ClusterName string
- The name of a cluster.
- ClusterReference Dictionary<string, string>
- The reference to a cluster.
- ClusterUuid string
- DefaultGateway stringIp 
- Default gateway IP address.
- Description string
- A description for subnet.
- DhcpDomain List<string>Name Server Lists 
- DhcpDomain List<string>Search Lists 
- DHCP domain search list for a subnet.
- DhcpOptions Dictionary<string, string>
- Spec for defining DHCP options.
- DhcpServer Dictionary<string, string>Address 
- Host address.
- DhcpServer intAddress Port 
- Port Number.
- EnableNat bool
- IpConfig List<string>Pool List Ranges 
- IsExternal bool
- MessageLists List<PiersKarsenbarg. Nutanix. Inputs. Get Subnets Entity Message List> 
- Metadata Dictionary<string, string>
- The subnet kind metadata.
- Name string
- the name.
- NetworkFunction Dictionary<string, string>Chain Reference 
- The reference to a network_function_chain.
- OwnerReference Dictionary<string, string>
- The reference to a user.
- PrefixLength int
- -. IP prefix length of the Subnet.
- ProjectReference Dictionary<string, string>
- The reference to a project.
- State string
- The state of the subnet.
- SubnetId string
- SubnetIp string
- Subnet IP address.
- SubnetName string
- SubnetType string
- The type of the subnet.
- VlanId int
- VLAN assigned to the subnet.
- VpcReference Dictionary<string, string>
- VswitchName string
- The name of the vswitch.
- ApiVersion string
- version of the API
- AvailabilityZone map[string]stringReference 
- The reference to a availability_zone.
- Categories
[]GetSubnets Entity Category 
- The API Version.
- ClusterName string
- The name of a cluster.
- ClusterReference map[string]string
- The reference to a cluster.
- ClusterUuid string
- DefaultGateway stringIp 
- Default gateway IP address.
- Description string
- A description for subnet.
- DhcpDomain []stringName Server Lists 
- DhcpDomain []stringSearch Lists 
- DHCP domain search list for a subnet.
- DhcpOptions map[string]string
- Spec for defining DHCP options.
- DhcpServer map[string]stringAddress 
- Host address.
- DhcpServer intAddress Port 
- Port Number.
- EnableNat bool
- IpConfig []stringPool List Ranges 
- IsExternal bool
- MessageLists []GetSubnets Entity Message List 
- Metadata map[string]string
- The subnet kind metadata.
- Name string
- the name.
- NetworkFunction map[string]stringChain Reference 
- The reference to a network_function_chain.
- OwnerReference map[string]string
- The reference to a user.
- PrefixLength int
- -. IP prefix length of the Subnet.
- ProjectReference map[string]string
- The reference to a project.
- State string
- The state of the subnet.
- SubnetId string
- SubnetIp string
- Subnet IP address.
- SubnetName string
- SubnetType string
- The type of the subnet.
- VlanId int
- VLAN assigned to the subnet.
- VpcReference map[string]string
- VswitchName string
- The name of the vswitch.
- apiVersion String
- version of the API
- availabilityZone Map<String,String>Reference 
- The reference to a availability_zone.
- categories
List<GetSubnets Entity Category> 
- The API Version.
- clusterName String
- The name of a cluster.
- clusterReference Map<String,String>
- The reference to a cluster.
- clusterUuid String
- defaultGateway StringIp 
- Default gateway IP address.
- description String
- A description for subnet.
- dhcpDomain List<String>Name Server Lists 
- dhcpDomain List<String>Search Lists 
- DHCP domain search list for a subnet.
- dhcpOptions Map<String,String>
- Spec for defining DHCP options.
- dhcpServer Map<String,String>Address 
- Host address.
- dhcpServer IntegerAddress Port 
- Port Number.
- enableNat Boolean
- ipConfig List<String>Pool List Ranges 
- isExternal Boolean
- messageLists List<GetSubnets Entity Message List> 
- metadata Map<String,String>
- The subnet kind metadata.
- name String
- the name.
- networkFunction Map<String,String>Chain Reference 
- The reference to a network_function_chain.
- ownerReference Map<String,String>
- The reference to a user.
- prefixLength Integer
- -. IP prefix length of the Subnet.
- projectReference Map<String,String>
- The reference to a project.
- state String
- The state of the subnet.
- subnetId String
- subnetIp String
- Subnet IP address.
- subnetName String
- subnetType String
- The type of the subnet.
- vlanId Integer
- VLAN assigned to the subnet.
- vpcReference Map<String,String>
- vswitchName String
- The name of the vswitch.
- apiVersion string
- version of the API
- availabilityZone {[key: string]: string}Reference 
- The reference to a availability_zone.
- categories
GetSubnets Entity Category[] 
- The API Version.
- clusterName string
- The name of a cluster.
- clusterReference {[key: string]: string}
- The reference to a cluster.
- clusterUuid string
- defaultGateway stringIp 
- Default gateway IP address.
- description string
- A description for subnet.
- dhcpDomain string[]Name Server Lists 
- dhcpDomain string[]Search Lists 
- DHCP domain search list for a subnet.
- dhcpOptions {[key: string]: string}
- Spec for defining DHCP options.
- dhcpServer {[key: string]: string}Address 
- Host address.
- dhcpServer numberAddress Port 
- Port Number.
- enableNat boolean
- ipConfig string[]Pool List Ranges 
- isExternal boolean
- messageLists GetSubnets Entity Message List[] 
- metadata {[key: string]: string}
- The subnet kind metadata.
- name string
- the name.
- networkFunction {[key: string]: string}Chain Reference 
- The reference to a network_function_chain.
- ownerReference {[key: string]: string}
- The reference to a user.
- prefixLength number
- -. IP prefix length of the Subnet.
- projectReference {[key: string]: string}
- The reference to a project.
- state string
- The state of the subnet.
- subnetId string
- subnetIp string
- Subnet IP address.
- subnetName string
- subnetType string
- The type of the subnet.
- vlanId number
- VLAN assigned to the subnet.
- vpcReference {[key: string]: string}
- vswitchName string
- The name of the vswitch.
- api_version str
- version of the API
- availability_zone_ Mapping[str, str]reference 
- The reference to a availability_zone.
- categories
Sequence[GetSubnets Entity Category] 
- The API Version.
- cluster_name str
- The name of a cluster.
- cluster_reference Mapping[str, str]
- The reference to a cluster.
- cluster_uuid str
- default_gateway_ strip 
- Default gateway IP address.
- description str
- A description for subnet.
- dhcp_domain_ Sequence[str]name_ server_ lists 
- dhcp_domain_ Sequence[str]search_ lists 
- DHCP domain search list for a subnet.
- dhcp_options Mapping[str, str]
- Spec for defining DHCP options.
- dhcp_server_ Mapping[str, str]address 
- Host address.
- dhcp_server_ intaddress_ port 
- Port Number.
- enable_nat bool
- ip_config_ Sequence[str]pool_ list_ ranges 
- is_external bool
- message_lists Sequence[GetSubnets Entity Message List] 
- metadata Mapping[str, str]
- The subnet kind metadata.
- name str
- the name.
- network_function_ Mapping[str, str]chain_ reference 
- The reference to a network_function_chain.
- owner_reference Mapping[str, str]
- The reference to a user.
- prefix_length int
- -. IP prefix length of the Subnet.
- project_reference Mapping[str, str]
- The reference to a project.
- state str
- The state of the subnet.
- subnet_id str
- subnet_ip str
- Subnet IP address.
- subnet_name str
- subnet_type str
- The type of the subnet.
- vlan_id int
- VLAN assigned to the subnet.
- vpc_reference Mapping[str, str]
- vswitch_name str
- The name of the vswitch.
- apiVersion String
- version of the API
- availabilityZone Map<String>Reference 
- The reference to a availability_zone.
- categories List<Property Map>
- The API Version.
- clusterName String
- The name of a cluster.
- clusterReference Map<String>
- The reference to a cluster.
- clusterUuid String
- defaultGateway StringIp 
- Default gateway IP address.
- description String
- A description for subnet.
- dhcpDomain List<String>Name Server Lists 
- dhcpDomain List<String>Search Lists 
- DHCP domain search list for a subnet.
- dhcpOptions Map<String>
- Spec for defining DHCP options.
- dhcpServer Map<String>Address 
- Host address.
- dhcpServer NumberAddress Port 
- Port Number.
- enableNat Boolean
- ipConfig List<String>Pool List Ranges 
- isExternal Boolean
- messageLists List<Property Map>
- metadata Map<String>
- The subnet kind metadata.
- name String
- the name.
- networkFunction Map<String>Chain Reference 
- The reference to a network_function_chain.
- ownerReference Map<String>
- The reference to a user.
- prefixLength Number
- -. IP prefix length of the Subnet.
- projectReference Map<String>
- The reference to a project.
- state String
- The state of the subnet.
- subnetId String
- subnetIp String
- Subnet IP address.
- subnetName String
- subnetType String
- The type of the subnet.
- vlanId Number
- VLAN assigned to the subnet.
- vpcReference Map<String>
- vswitchName String
- The name of the vswitch.
GetSubnetsEntityCategory   
GetSubnetsEntityMessageList    
GetSubnetsMetadata  
- filter str
- kind str
- The kind name (Default value: project.
- length int
- offset int
- sort_attribute str
- sort_order str
Package Details
- Repository
- nutanix pierskarsenbarg/pulumi-nutanix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the nutanixTerraform Provider.
 
Nutanix v0.7.3 published on Thursday, Mar 13, 2025 by Piers Karsenbarg