• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. Querying IP Address Usage
  6. Querying IP Address Usage on a Specified Network

Querying IP Address Usage on a Specified Network

Function

This interface is used to query the IP address usage on a specified network.

The obtained information includes the total number of IP addresses on the network, the number of in-use IP addresses on the network, the total number of IP addresses on each subnet, and the number of in-use IP addresses on the subnet.

URI

GET /v2.0/network-ip-availabilities/{network_id}
Table 1 Parameter description

Parameter

Type

Mandatory

Description

network_id

UUID

Yes

Specifies the network ID.

Request Message

  • Request parameter

    None

  • Example request
    GET /v2.0/network-ip-availabilities/6b50d967-779c-40c9-a157-de1df3c17043

Response Message

  • Response parameter
    Table 2 Response parameter

    Name

    Type

    Description

    network_ip_availability

    Object

    Specifies outer object.

    network_id

    UUID

    Specifies the network ID.

    network_name

    String

    Specifies the network name.

    tenant_id

    UUID

    Specifies the project ID.

    total_ips

    int

    Specifies the total number of IP addresses on a network. (System reserved IP addresses are not included.)

    used_ips

    int

    Specifies the number of in-use IP addresses on a network. (System reserved IP addresses are not included.)

    subnet_ip_availability

    Object

    Specifies the subnet IP address usage object.

    subnet_id

    UUID

    Specifies the subnet ID.

    subnet_name

    String

    Specifies the subnet name.

    cidr

    CIDR

    Specifies the subnet CIDR block.

    ip_version

    int

    Specifies the subnet IP version.

  • Example response
    {
      "network_ip_availability": {
        "used_ips": 4,
        "subnet_ip_availability": [
          {
            "used_ips": 4,
            "subnet_id": "98e343d1-3cb8-4f69-9cd1-00569819480f",
            "subnet_name": "",
            "ip_version": 4,
            "cidr": "10.0.0.0/8",
            "total_ips": 300
          }
        ],
        "network_id": "6b50d967-779c-40c9-a157-de1df3c17043",
        "tenant_id": "7c4b23cb125d481c95cbe4f91b2c11cd",
        "total_ips": 300,
        "network_name": "pch_test_003"
      }
    }

Status Codes

For details, see Status Codes.