---
title: "Create a subnet"
method: POST
path: "/subnets"
tags: ["subnet"]
---

# Create a subnet

`POST /subnets`

This operation submits a request to create a subnet based on the input parameters.
A subnet is a block of IP addresses.

## Request body

- SubnetIntentInput — An intentful representation of a subnet
  - `spec` Subnet, required — An intentful representation of a subnet spec
    - `description` string — A description for subnet.
    - `resources` SubnetResources, required — Subnet creation/modification spec.
      - `subnet_type` string, required
      - `vswitch_name` string
      - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `availability_zone_reference_list` AvailabilityZoneReference[] — List of availability zones from which resources are derived (Only supported on Xi).
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `virtual_network_reference` VirtualNetworkReference — The reference to a virtual_network
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `external_connectivity_state` string — External connectivity state (Only supported on Xi)
      - `vlan_id` integer
      - `ip_config` IpConfig — IP config.
        - `pool_list` IpPool[]
          - `range` string — Range of IPs (example: 10.0.0.9 10.0.0.19).
        - `default_gateway_ip` string — Default gateway IP address.
        - `prefix_length` integer
        - `subnet_ip` string — Subnet IP address.
        - `dhcp_options` DhcpOptions — Spec for defining DHCP options.
          - `domain_name_server_list` string[]
          - `boot_file_name` string
          - `domain_search_list` string[]
          - `domain_name` string
          - `tftp_server_name` string
        - `dhcp_server_address` Address — Host address.
          - `ip` string — IPV4 address.
          - `ipv6` string — IPV6 address.
          - `port` integer — Port Number
          - `fqdn` string — Fully qualified domain name.
    - `cluster_reference` ClusterReference — The reference to a cluster
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `name` string, required — subnet Name.
    - `availability_zone_reference` AvailabilityZoneReference — The reference to a availability_zone
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
  - `api_version` string
  - `metadata` SubnetMetadata, required — The subnet kind metadata
    - `last_update_time` string, date-time — UTC date and time in RFC-3339 format when subnet was last updated
    - `kind` string, required — The kind name
    - `uuid` string, UUID — subnet uuid
    - `spec_version` integer — Version number of the latest spec.
    - `creation_time` string, date-time — UTC date and time in RFC-3339 format when subnet was created
    - `spec_hash` string — Hash of the spec. This will be returned from server.
    - `should_force_translate` boolean — Applied on Prism Central only. Indicate whether force to translate the spec of the fanout request to fit the target cluster API schema.
    - `owner_reference` UserReference — The reference to a user
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `categories` object — Categories for the subnet
    - `name` string — subnet name

## Response `202`

Request Accepted

- SubnetIntentResponse — Response object for intentful operations on a subnet
  - `status` SubnetDefStatus — An intentful representation of a subnet status
    - `state` string — The state of the subnet.
    - `name` string, required — subnet Name.
    - `availability_zone_reference` AvailabilityZoneReference — The reference to a availability_zone
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `message_list` MessageResource[] — Any error messages for the subnet, if in an error state.
      - `message` string, required — If state is ERROR, a message describing the error.
      - `reason` string, required — If state is ERROR, a machine-readable snake-cased string.
      - `details` object — Custom key-value details relevant to the status.
    - `cluster_reference` ClusterReference — The reference to a cluster
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `resources` SubnetResourcesDefStatus, required — Subnet creation/modification status.
      - `subnet_type` string
      - `vswitch_name` string
      - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `availability_zone_reference_list` AvailabilityZoneReference[] — List of availability zones from which resources are derived (Only supported on Xi).
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `virtual_network_reference` VirtualNetworkReference — The reference to a virtual_network
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `external_connectivity_state` string — External connectivity state (Only supported on Xi)
      - `vlan_id` integer
      - `ip_config` IpConfig — IP config.
        - `pool_list` IpPool[]
          - `range` string — Range of IPs (example: 10.0.0.9 10.0.0.19).
        - `default_gateway_ip` string — Default gateway IP address.
        - `prefix_length` integer
        - `subnet_ip` string — Subnet IP address.
        - `dhcp_options` DhcpOptions — Spec for defining DHCP options.
          - `domain_name_server_list` string[]
          - `boot_file_name` string
          - `domain_search_list` string[]
          - `domain_name` string
          - `tftp_server_name` string
        - `dhcp_server_address` Address — Host address.
          - `ip` string — IPV4 address.
          - `ipv6` string — IPV6 address.
          - `port` integer — Port Number
          - `fqdn` string — Fully qualified domain name.
    - `description` string — A description for subnet.
  - `spec` Subnet — An intentful representation of a subnet spec
    - `description` string — A description for subnet.
    - `resources` SubnetResources, required — Subnet creation/modification spec.
      - `subnet_type` string, required
      - `vswitch_name` string
      - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `availability_zone_reference_list` AvailabilityZoneReference[] — List of availability zones from which resources are derived (Only supported on Xi).
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `virtual_network_reference` VirtualNetworkReference — The reference to a virtual_network
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `external_connectivity_state` string — External connectivity state (Only supported on Xi)
      - `vlan_id` integer
      - `ip_config` IpConfig — IP config.
        - `pool_list` IpPool[]
          - `range` string — Range of IPs (example: 10.0.0.9 10.0.0.19).
        - `default_gateway_ip` string — Default gateway IP address.
        - `prefix_length` integer
        - `subnet_ip` string — Subnet IP address.
        - `dhcp_options` DhcpOptions — Spec for defining DHCP options.
          - `domain_name_server_list` string[]
          - `boot_file_name` string
          - `domain_search_list` string[]
          - `domain_name` string
          - `tftp_server_name` string
        - `dhcp_server_address` Address — Host address.
          - `ip` string — IPV4 address.
          - `ipv6` string — IPV6 address.
          - `port` integer — Port Number
          - `fqdn` string — Fully qualified domain name.
    - `cluster_reference` ClusterReference — The reference to a cluster
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `name` string, required — subnet Name.
    - `availability_zone_reference` AvailabilityZoneReference — The reference to a availability_zone
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
  - `api_version` string, required
  - `metadata` SubnetMetadata, required — The subnet kind metadata
    - `last_update_time` string, date-time — UTC date and time in RFC-3339 format when subnet was last updated
    - `kind` string, required — The kind name
    - `uuid` string, UUID — subnet uuid
    - `spec_version` integer — Version number of the latest spec.
    - `creation_time` string, date-time — UTC date and time in RFC-3339 format when subnet was created
    - `spec_hash` string — Hash of the spec. This will be returned from server.
    - `should_force_translate` boolean — Applied on Prism Central only. Indicate whether force to translate the spec of the fanout request to fit the target cluster API schema.
    - `owner_reference` UserReference — The reference to a user
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `categories` object — Categories for the subnet
    - `name` string — subnet name

## Other responses

- `default` — Internal Error

---

[API](https://skmtc.net/nutanix/apis/nutanix-intentful-api.md) · [All operations](https://skmtc.net/nutanix/apis/nutanix-intentful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nutanix/nutanix-intentful-api/revisions/40395083ab31/schema)
