1. Packages
  2. Nutanix
  3. API Docs
  4. getSubnets
Nutanix v0.0.52 published on Friday, Jun 7, 2024 by Piers Karsenbarg

nutanix.getSubnets

Explore with Pulumi AI

nutanix logo
Nutanix v0.0.52 published on Friday, Jun 7, 2024 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=[nutanix.GetSubnetsMetadataArgs(
        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, nil, 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: nutanix:index/getSubnets:getSubnets
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Metadatas []GetSubnetsMetadata
    The subnet kind metadata.
    metadatas List<GetSubnetsMetadata>
    The subnet kind metadata.
    metadatas GetSubnetsMetadata[]
    The subnet kind metadata.
    metadatas Sequence[GetSubnetsMetadata]
    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.GetSubnetsEntity>
    List of Subnets
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadatas List<PiersKarsenbarg.Nutanix.Outputs.GetSubnetsMetadata>
    The subnet kind metadata.
    ApiVersion string
    version of the API
    Entities []GetSubnetsEntity
    List of Subnets
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadatas []GetSubnetsMetadata
    The subnet kind metadata.
    apiVersion String
    version of the API
    entities List<GetSubnetsEntity>
    List of Subnets
    id String
    The provider-assigned unique ID for this managed resource.
    metadatas List<GetSubnetsMetadata>
    The subnet kind metadata.
    apiVersion string
    version of the API
    entities GetSubnetsEntity[]
    List of Subnets
    id string
    The provider-assigned unique ID for this managed resource.
    metadatas GetSubnetsMetadata[]
    The subnet kind metadata.
    api_version str
    version of the API
    entities Sequence[GetSubnetsEntity]
    List of Subnets
    id str
    The provider-assigned unique ID for this managed resource.
    metadatas Sequence[GetSubnetsMetadata]
    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
    AvailabilityZoneReference Dictionary<string, string>
    The reference to a availability_zone.
    Categories List<PiersKarsenbarg.Nutanix.Inputs.GetSubnetsEntityCategory>
    The API Version.
    ClusterName string
    The name of a cluster.
    ClusterReference Dictionary<string, string>
    The reference to a cluster.
    ClusterUuid string
    DefaultGatewayIp string
    Default gateway IP address.
    Description string
    A description for subnet.
    DhcpDomainNameServerLists List<string>
    DhcpDomainSearchLists List<string>
    DHCP domain search list for a subnet.
    DhcpOptions Dictionary<string, string>
    Spec for defining DHCP options.
    DhcpServerAddress Dictionary<string, string>
    Host address.
    DhcpServerAddressPort int
    Port Number.
    EnableNat bool
    IpConfigPoolListRanges List<string>
    IsExternal bool
    MessageLists List<PiersKarsenbarg.Nutanix.Inputs.GetSubnetsEntityMessageList>
    Metadata Dictionary<string, string>
    The subnet kind metadata.
    Name string
    the name.
    NetworkFunctionChainReference Dictionary<string, string>
    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
    AvailabilityZoneReference map[string]string
    The reference to a availability_zone.
    Categories []GetSubnetsEntityCategory
    The API Version.
    ClusterName string
    The name of a cluster.
    ClusterReference map[string]string
    The reference to a cluster.
    ClusterUuid string
    DefaultGatewayIp string
    Default gateway IP address.
    Description string
    A description for subnet.
    DhcpDomainNameServerLists []string
    DhcpDomainSearchLists []string
    DHCP domain search list for a subnet.
    DhcpOptions map[string]string
    Spec for defining DHCP options.
    DhcpServerAddress map[string]string
    Host address.
    DhcpServerAddressPort int
    Port Number.
    EnableNat bool
    IpConfigPoolListRanges []string
    IsExternal bool
    MessageLists []GetSubnetsEntityMessageList
    Metadata map[string]string
    The subnet kind metadata.
    Name string
    the name.
    NetworkFunctionChainReference map[string]string
    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
    availabilityZoneReference Map<String,String>
    The reference to a availability_zone.
    categories List<GetSubnetsEntityCategory>
    The API Version.
    clusterName String
    The name of a cluster.
    clusterReference Map<String,String>
    The reference to a cluster.
    clusterUuid String
    defaultGatewayIp String
    Default gateway IP address.
    description String
    A description for subnet.
    dhcpDomainNameServerLists List<String>
    dhcpDomainSearchLists List<String>
    DHCP domain search list for a subnet.
    dhcpOptions Map<String,String>
    Spec for defining DHCP options.
    dhcpServerAddress Map<String,String>
    Host address.
    dhcpServerAddressPort Integer
    Port Number.
    enableNat Boolean
    ipConfigPoolListRanges List<String>
    isExternal Boolean
    messageLists List<GetSubnetsEntityMessageList>
    metadata Map<String,String>
    The subnet kind metadata.
    name String
    the name.
    networkFunctionChainReference Map<String,String>
    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
    availabilityZoneReference {[key: string]: string}
    The reference to a availability_zone.
    categories GetSubnetsEntityCategory[]
    The API Version.
    clusterName string
    The name of a cluster.
    clusterReference {[key: string]: string}
    The reference to a cluster.
    clusterUuid string
    defaultGatewayIp string
    Default gateway IP address.
    description string
    A description for subnet.
    dhcpDomainNameServerLists string[]
    dhcpDomainSearchLists string[]
    DHCP domain search list for a subnet.
    dhcpOptions {[key: string]: string}
    Spec for defining DHCP options.
    dhcpServerAddress {[key: string]: string}
    Host address.
    dhcpServerAddressPort number
    Port Number.
    enableNat boolean
    ipConfigPoolListRanges string[]
    isExternal boolean
    messageLists GetSubnetsEntityMessageList[]
    metadata {[key: string]: string}
    The subnet kind metadata.
    name string
    the name.
    networkFunctionChainReference {[key: string]: string}
    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_reference Mapping[str, str]
    The reference to a availability_zone.
    categories Sequence[GetSubnetsEntityCategory]
    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_ip str
    Default gateway IP address.
    description str
    A description for subnet.
    dhcp_domain_name_server_lists Sequence[str]
    dhcp_domain_search_lists Sequence[str]
    DHCP domain search list for a subnet.
    dhcp_options Mapping[str, str]
    Spec for defining DHCP options.
    dhcp_server_address Mapping[str, str]
    Host address.
    dhcp_server_address_port int
    Port Number.
    enable_nat bool
    ip_config_pool_list_ranges Sequence[str]
    is_external bool
    message_lists Sequence[GetSubnetsEntityMessageList]
    metadata Mapping[str, str]
    The subnet kind metadata.
    name str
    the name.
    network_function_chain_reference Mapping[str, str]
    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
    availabilityZoneReference Map<String>
    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
    defaultGatewayIp String
    Default gateway IP address.
    description String
    A description for subnet.
    dhcpDomainNameServerLists List<String>
    dhcpDomainSearchLists List<String>
    DHCP domain search list for a subnet.
    dhcpOptions Map<String>
    Spec for defining DHCP options.
    dhcpServerAddress Map<String>
    Host address.
    dhcpServerAddressPort Number
    Port Number.
    enableNat Boolean
    ipConfigPoolListRanges List<String>
    isExternal Boolean
    messageLists List<Property Map>
    metadata Map<String>
    The subnet kind metadata.
    name String
    the name.
    networkFunctionChainReference Map<String>
    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

    Name string
    the name.
    Value string
    value of the key.
    Name string
    the name.
    Value string
    value of the key.
    name String
    the name.
    value String
    value of the key.
    name string
    the name.
    value string
    value of the key.
    name str
    the name.
    value str
    value of the key.
    name String
    the name.
    value String
    value of the key.

    GetSubnetsEntityMessageList

    Details Dictionary<string, object>
    Message string
    Reason string
    Details map[string]interface{}
    Message string
    Reason string
    details Map<String,Object>
    message String
    reason String
    details {[key: string]: any}
    message string
    reason string
    details Mapping[str, Any]
    message str
    reason str
    details Map<Any>
    message String
    reason String

    GetSubnetsMetadata

    Filter string
    Kind string
    The kind name (Default value: project.
    Length int
    Offset int
    SortAttribute string
    SortOrder string
    Filter string
    Kind string
    The kind name (Default value: project.
    Length int
    Offset int
    SortAttribute string
    SortOrder string
    filter String
    kind String
    The kind name (Default value: project.
    length Integer
    offset Integer
    sortAttribute String
    sortOrder String
    filter string
    kind string
    The kind name (Default value: project.
    length number
    offset number
    sortAttribute string
    sortOrder string
    filter str
    kind str
    The kind name (Default value: project.
    length int
    offset int
    sort_attribute str
    sort_order str
    filter String
    kind String
    The kind name (Default value: project.
    length Number
    offset Number
    sortAttribute String
    sortOrder String

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.0.52 published on Friday, Jun 7, 2024 by Piers Karsenbarg