Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Virtual Private Cloud/ API Reference/ APIs/ Querying IP Address Usage/ Querying IP Address Usage on a Specified Network

Querying IP Address Usage on a Specified Network

Function

This API 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.

NOTICE:
  • The first and the last two IP addresses on each subnet are reserved by the system for the gateway and DHCP service.
  • The total number of IP addresses and the number of in-use IP addresses described in this section and the subsequent sections do not include the IP addresses reserved by the system.
  • When assigning an IP address, you can specify the reserved IP address for the system. The reserved IP addresses will not be included in the number of in-use IP addresses and the total number of IP addresses no matter how the IP address is assigned.

URI

GET /v2.0/network-ip-availabilities/{network_id}

Table 1 describes the parameters.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

network_id

String

Yes

Specifies the network ID.

NOTE:

network_id indicates the subnet ID used when the VPC subnet API is called.

For more information, see What Are the Differences Between the VPC Subnet API and the OpenStack Neutron Subnet API?.

Request Parameters

None

Example Request

GET https://{Endpoint}/v2.0/network-ip-availabilities/6b50d967-779c-40c9-a157-de1df3c17043

Response Parameters

Table 2 Response parameter

Parameter

Type

Description

network_ip_availability

network_ip_availability object

Specifies the network_ip_availability objects. For details, see Table 3.

Table 3 network_ip_availability objects

Parameter

Type

Description

network_id

String

Specifies the network ID.

network_name

String

Specifies the network name.

tenant_id

String

Specifies the project ID.

total_ips

Integer

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

used_ips

Integer

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

subnet_ip_availability

Array of subnet_ip_availability objects

Specifies the subnet IP address usage objects. For details, see Table 4.

Table 4 Description of the subnet_ip_availability field

Parameter

Type

Description

used_ips

Integer

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

subnet_id

String

Specifies the subnet ID.

If you use the management console, the value of this parameter is the Network ID value.

subnet_name

String

Specifies the subnet name.

ip_version

Integer

Specifies the IP version of the subnet. Only IPv4 is supported.

cidr

String

Specifies the subnet CIDR block.

total_ips

Integer

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

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 Code

See Status Codes.

Error Code

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback