Subnet

This page describes operations you can perform on subnets. List, create, get details for, update, and delete.

List Subnet

List all visible subnets.

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{endpoint}/v2.0/subnets

HTTP Request Parameters

Parameter Style Type Format Enumeration Description Required
cidr query string cidr - Subnet CIDR. no
description query string - - Subnet description. no
gateway_ip query string ipv4 - Subnet default gateway ip. no
id query string hyph-uuid - Subnet unique id. no
ip_version query integer - [4] The IP version used. (supports only 4) no
ipv6_address_mode query string - ['dhcpv6-stateful', 'dhcpv6-stateless', 'static'] Address mode for IPv6 (not supported) no
ipv6_ra_mode query string - ['dhcpv6-stateful', 'dhcpv6-stateless', 'static'] IPv6 router advertisement mode (not supported) no
name query string - - Subnet name. no
network_id query string hyph-uuid - The ID of network this subnet belongs to. no
status query string - - Subnet status. no
tenant_id query string non-hyph-uuid - The owner name of subnet. no

Response

HTTP Response Code List

Response Code Description
200 OK
400 Bad Request
401 UnAuthorized
404 Not Found
500 Internal Server Error

HTTP Response Parameters

Parameter Type Format Description
subnets array<object> Subnet -
allocation_pools array<object> - List of subnet allocation pools
end string ipv4 -
start string ipv4 -
cidr string cidr Subnet CIDR.
description string - Subnet description.
dns_nameservers array<string> - List of subnet dns name servers.
enable_dhcp boolean - Set to true if DHCP is enabled and false if DHCP is disabled.
gateway_ip string ipv4 Subnet default gateway ip.
host_routes array<object> - A list of host route dictionaries for the subnet.
destination string cidr -
nexthop string ipv4 -
id string hyph-uuid Subnet unique id.
ip_version integer - The IP version used. (supports only 4)
ipv6_address_mode string - Address mode for IPv6 (not supported)
ipv6_ra_mode string - IPv6 router advertisement mode (not supported)
name string - Subnet name.
network_id string hyph-uuid The ID of network this subnet belongs to.
ntp_servers array<string> - List of ntp servers.
status string - Subnet status.
tags object - Subnet tags.
tenant_id string non-hyph-uuid The owner name of subnet.

Examples

Sample Request Body

This operation does not send a request body.

Sample Response Body

{
  "subnets": [
    {
      "allocation_pools": [
        {
          "end": "10.161.54.99",
          "start": "10.161.54.13"
        },
        {
          "end": "10.161.54.220",
          "start": "10.161.54.200"
        }
      ],
      "cidr": "10.161.54.0/24",
      "description": "Example subnet 1 description.",
      "dns_nameservers": [
        "8.8.8.8",
        "10.161.54.11"
      ],
      "enable_dhcp": true,
      "gateway_ip": "10.161.54.1",
      "host_routes": [
        {
          "destination": "10.2.0.0/24",
          "nexthop": "10.1.0.10"
        }
      ],
      "id": "93bb920c-19be-4026-8cc7-564bfcd41456",
      "ip_version": 4,
      "ipv6_address_mode": null,
      "ipv6_ra_mode": null,
      "name": "Example subnet 1",
      "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
      "ntp_servers": [
        "10.161.54.12"
      ],
      "status": "ACTIVE",
      "tags": {
        "keyword1": "value1",
        "keyword2": "value2"
      },
      "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
    },
    {
      "allocation_pools": [
        {
          "end": "10.161.55.99",
          "start": "10.161.55.13"
        },
        {
          "end": "10.161.55.220",
          "start": "10.161.55.200"
        }
      ],
      "cidr": "10.161.55.0/24",
      "description": "Example subnet 2 description.",
      "dns_nameservers": [
        "8.8.8.8",
        "10.161.55.11"
      ],
      "enable_dhcp": false,
      "gateway_ip": "10.161.55.1",
      "host_routes": [
        {
          "destination": "10.2.0.0/24",
          "nexthop": "10.1.0.10"
        }
      ],
      "id": "64887030-9623-4a20-bcb0-c92e8a2496ca",
      "ip_version": 4,
      "ipv6_address_mode": null,
      "ipv6_ra_mode": null,
      "name": "Example subnet 2",
      "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
      "ntp_servers": [
        "10.161.55.12"
      ],
      "status": "ACTIVE",
      "tags": {
        "keyword1": "value1",
        "keyword2": "value2"
      },
      "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
    }
  ]
}

Create Subnet

Create subnet.

Synchronous / Asynchronous

  • Asynchronous

Request

HTTP Request Method

  • POST

HTTP Request Path

{endpoint}/v2.0/subnets

HTTP Request Parameters

Parameter Style Type Format Enumeration Default Description Required
subnet plain object Subnet - - - yes
allocation_pools plain array<object> - - See notes. List of subnet allocation pools no
end plain string ipv4 - - - yes
start plain string ipv4 - - - yes
cidr plain string cidr - - Subnet CIDR. yes
description plain string - - "" Subnet description. no
dns_nameservers plain array<string> - - See notes. List of subnet dns name servers. no
enable_dhcp plain boolean - - True Set to true if DHCP is enabled and false if DHCP is disabled. no
gateway_ip plain string ipv4 - See notes. Subnet default gateway ip. no
host_routes plain array<object> - - null A list of host route dictionaries for the subnet. no
destination plain string cidr - - - yes
nexthop plain string ipv4 - - - yes
ip_version plain integer - [4] 4 The IP version used. (supports only 4) no
name plain string - - "" Subnet name. no
network_id plain string hyph-uuid - - The ID of network this subnet belongs to. yes
ntp_servers plain array<string> - - null List of ntp servers. no
tags plain object - - {} Subnet tags. no
tenant_id plain string non-hyph-uuid - See notes. The owner name of subnet. no

注釈

allocation_pools: The set of pools where available address exist excluding the gateway's one. This is calculated only at once when creating subnet.

dns_nameservers: ["0.0.0.0"] when create with dhcp enable.

gateway_ip: The first available IP address in subnet CIDR.

tenant_id: The ID of default tenant to which user belongs.

Response

HTTP Response Code List

Response Code Description
201 OK
400 Bad Request
401 UnAuthorized
404 Not Found
409 Conflict
500 Internal Server Error

HTTP Response Parameters

Parameter Type Format Description
subnet object Subnet -
allocation_pools array<object> - List of subnet allocation pools
end string ipv4 -
start string ipv4 -
cidr string cidr Subnet CIDR.
description string - Subnet description.
dns_nameservers array<string> - List of subnet dns name servers.
enable_dhcp boolean - Set to true if DHCP is enabled and false if DHCP is disabled.
gateway_ip string ipv4 Subnet default gateway ip.
host_routes array<object> - A list of host route dictionaries for the subnet.
destination string cidr -
nexthop string ipv4 -
id string hyph-uuid Subnet unique id.
ip_version integer - The IP version used. (supports only 4)
name string - Subnet name.
network_id string hyph-uuid The ID of network this subnet belongs to.
ntp_servers array<string> - List of ntp servers.
status string - Subnet status.
tags object - Subnet tags.
tenant_id string non-hyph-uuid The owner name of subnet.

Examples

Sample Request Body

{
  "subnet": {
    "allocation_pools": [
      {
        "end": "10.161.54.99",
        "start": "10.161.54.13"
      },
      {
        "end": "10.161.54.220",
        "start": "10.161.54.200"
      }
    ],
    "cidr": "10.161.54.0/24",
    "description": "Example subnet 1 description.",
    "dns_nameservers": [
      "8.8.8.8",
      "10.161.54.11"
    ],
    "enable_dhcp": true,
    "gateway_ip": "10.161.54.1",
    "host_routes": [
      {
        "destination": "10.2.0.0/24",
        "nexthop": "10.1.0.10"
      }
    ],
    "ip_version": 4,
    "name": "Example subnet 1",
    "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
    "ntp_servers": [
      "10.161.54.12"
    ],
    "tags": {
      "keyword1": "value1",
      "keyword2": "value2"
    },
    "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
  }
}

Sample Response Body

{
  "subnet": {
    "allocation_pools": [
      {
        "end": "10.161.54.99",
        "start": "10.161.54.13"
      },
      {
        "end": "10.161.54.220",
        "start": "10.161.54.200"
      }
    ],
    "cidr": "10.161.54.0/24",
    "description": "Example subnet 1 description.",
    "dns_nameservers": [
      "8.8.8.8",
      "10.161.54.11"
    ],
    "enable_dhcp": true,
    "gateway_ip": "10.161.54.1",
    "host_routes": [
      {
        "destination": "10.2.0.0/24",
        "nexthop": "10.1.0.10"
      }
    ],
    "id": "93bb920c-19be-4026-8cc7-564bfcd41456",
    "ip_version": 4,
    "name": "Example subnet 1",
    "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
    "ntp_servers": [
      "10.161.54.12"
    ],
    "status": "PENDING_CREATE",
    "tags": {
      "keyword1": "value1",
      "keyword2": "value2"
    },
    "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
  }
}

Show Subnet

Show details for subnet.

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{endpoint}/v2.0/subnets/{subnet_id}

HTTP Request Parameters

Parameter Style Type Format Enumeration Description Required
subnet_id URI string hyph-uuid - Subnet unique id. yes

Response

HTTP Response Code List

Response Code Description
200 OK
400 Bad Request
401 UnAuthorized
404 Not Found
500 Internal Server Error

HTTP Response Parameters

Parameter Type Format Description
subnet object Subnet -
allocation_pools array<object> - List of subnet allocation pools
end string ipv4 -
start string ipv4 -
cidr string cidr Subnet CIDR.
description string - Subnet description.
dns_nameservers array<string> - List of subnet dns name servers.
enable_dhcp boolean - Set to true if DHCP is enabled and false if DHCP is disabled.
gateway_ip string ipv4 Subnet default gateway ip.
host_routes array<object> - A list of host route dictionaries for the subnet.
destination string cidr -
nexthop string ipv4 -
id string hyph-uuid Subnet unique id.
ip_version integer - The IP version used. (supports only 4)
ipv6_address_mode string - Address mode for IPv6 (not supported)
ipv6_ra_mode string - IPv6 router advertisement mode (not supported)
name string - Subnet name.
network_id string hyph-uuid The ID of network this subnet belongs to.
ntp_servers array<string> - List of ntp servers.
status string - Subnet status.
tags object - Subnet tags.
tenant_id string non-hyph-uuid The owner name of subnet.

Examples

Sample Request Body

This operation does not send a request body.

Sample Response Body

{
  "subnet": {
    "allocation_pools": [
      {
        "end": "10.161.54.99",
        "start": "10.161.54.13"
      },
      {
        "end": "10.161.54.220",
        "start": "10.161.54.200"
      }
    ],
    "cidr": "10.161.54.0/24",
    "description": "Example subnet 1 description.",
    "dns_nameservers": [
      "8.8.8.8",
      "10.161.54.11"
    ],
    "enable_dhcp": true,
    "gateway_ip": "10.161.54.1",
    "host_routes": [
      {
        "destination": "10.2.0.0/24",
        "nexthop": "10.1.0.10"
      }
    ],
    "id": "93bb920c-19be-4026-8cc7-564bfcd41456",
    "ip_version": 4,
    "ipv6_address_mode": null,
    "ipv6_ra_mode": null,
    "name": "Example subnet 1",
    "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
    "ntp_servers": [
      "10.161.54.12"
    ],
    "status": "ACTIVE",
    "tags": {
      "keyword1": "value1",
      "keyword2": "value2"
    },
    "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
  }
}

Update Subnet

Update subnet.

Synchronous / Asynchronous

  • Asynchronous

Request

HTTP Request Method

  • PUT

HTTP Request Path

{endpoint}/v2.0/subnets/{subnet_id}

HTTP Request Parameters

Parameter Style Type Format Enumeration Description Required
subnet_id URI string hyph-uuid - Subnet unique id. yes
subnet plain object Subnet - - yes
description plain string - - Subnet description. no
dns_nameservers plain array<string> - - List of subnet dns name servers. no
enable_dhcp plain boolean - - Set to true if DHCP is enabled and false if DHCP is disabled. no
gateway_ip plain string ipv4 - Subnet default gateway ip. no
host_routes plain array<object> - - A list of host route dictionaries for the subnet. no
host_routes.destination plain string cidr - - no
host_routes.nexthop plain string ipv4 - - no
name plain string - - Subnet name. no
ntp_servers plain array<string> - - List of ntp servers. no
tags plain object - - Subnet tags. no

Response

HTTP Response Code List

Response Code Description
200 OK
400 Bad Request
401 UnAuthorized
404 Not Found
409 Conflict
500 Internal Server Error

HTTP Response Parameters

Parameter Type Format Description
subnet object Subnet -
allocation_pools array<object> - List of subnet allocation pools
end string ipv4 -
start string ipv4 -
cidr string cidr Subnet CIDR.
description string - Subnet description.
dns_nameservers array<string> - List of subnet dns name servers.
enable_dhcp boolean - Set to true if DHCP is enabled and false if DHCP is disabled.
gateway_ip string ipv4 Subnet default gateway ip.
host_routes array<object> - A list of host route dictionaries for the subnet.
destination string cidr -
nexthop string ipv4 -
id string hyph-uuid Subnet unique id.
ip_version integer - The IP version used. (supports only 4)
ipv6_address_mode string - Address mode for IPv6 (not supported)
ipv6_ra_mode string - IPv6 router advertisement mode (not supported)
name string - Subnet name.
network_id string hyph-uuid The ID of network this subnet belongs to.
ntp_servers array<string> - List of ntp servers.
status string - Subnet status.
tags object - Subnet tags.
tenant_id string non-hyph-uuid The owner name of subnet.

Examples

Sample Request Body

{
  "subnet": {
    "description": "Example subnet 1 description.",
    "dns_nameservers": [
      "8.8.8.8",
      "10.161.54.11"
    ],
    "enable_dhcp": true,
    "gateway_ip": "10.161.54.1",
    "host_routes": [
      {
        "destination": "10.2.0.0/24",
        "nexthop": "10.1.0.10"
      }
    ],
    "name": "Example subnet 1",
    "ntp_servers": [
      "10.161.54.12"
    ],
    "tags": {
      "keyword1": "value1",
      "keyword2": "value2"
    }
  }
}

Sample Response Body

{
  "subnet": {
    "allocation_pools": [
      {
        "end": "10.161.54.99",
        "start": "10.161.54.13"
      },
      {
        "end": "10.161.54.220",
        "start": "10.161.54.200"
      }
    ],
    "cidr": "10.161.54.0/24",
    "description": "Example subnet 1 description.",
    "dns_nameservers": [
      "8.8.8.8",
      "10.161.54.11"
    ],
    "enable_dhcp": true,
    "gateway_ip": "10.161.54.1",
    "host_routes": [
      {
        "destination": "10.2.0.0/24",
        "nexthop": "10.1.0.10"
      }
    ],
    "id": "93bb920c-19be-4026-8cc7-564bfcd41456",
    "ip_version": 4,
    "ipv6_address_mode": null,
    "ipv6_ra_mode": null,
    "name": "Example subnet 1",
    "network_id": "6a9a64f6-45e7-46b2-b0e8-0a850896ff55",
    "ntp_servers": [
      "10.161.54.12"
    ],
    "status": "PENDING_UPDATE",
    "tags": {
      "keyword1": "value1",
      "keyword2": "value2"
    },
    "tenant_id": "6a156ddf2ecd497ca786ff2da6df5aa8"
  }
}

Delete Subnet

Delete subnet.

Synchronous / Asynchronous

  • Asynchronous

Request

HTTP Request Method

  • DELETE

HTTP Request Path

{endpoint}/v2.0/subnets/{subnet_id}

HTTP Request Parameters

Parameter Style Type Format Enumeration Description Required
subnet_id URI string hyph-uuid - Subnet unique id. yes

Response

HTTP Response Code List

Response Code Description
204 No Content
400 Bad Request
401 UnAuthorized
404 Not Found
409 Conflict
500 Internal Server Error

HTTP Response Parameters

This operation does not receive a response body.

Examples

Sample Request Body

This operation does not send a request body.

Sample Response Body

This operation does not receive a response body.