All Products
Search
Document Center

Elastic IP Address:DescribePublicIpAddress

Last Updated:Oct 27, 2025

Queries the public IP address range of a virtual private cloud (VPC) in a region.

Operation description

You cannot query the range of public IP addresses of a classic network by calling the DescribePublicIpAddress operation.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DescribePublicIpAddresslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

Valid values: 1 to 100. Default value: 100.

100
RegionIdstringYes

The region that you want to query. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
IpVersionstringNo

The IP version. Valid values:

  • IPv4 (default)
  • IPv6
ipv4

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45
Successboolean

Indicates whether the call is successful. Valid values:

  • true
  • false
true
Codestring

The HTTP status codes returned.

200
Messagestring

The response messages.

test
PageSizeinteger

The number of entries per page.

100
PageNumberinteger

The page number.

1
TotalCountinteger

The number of returned entries.

1
RegionIdstring

The ID of the region to which the public IP addresses belong.

cn-hangzhou
PublicIpAddressarray

The range of the public IP addresses of the VPC in the region.

ipAddressstring

The range of the public IP addresses of the VPC in the region.

101.37.XX.XX/24

Examples

Sample success responses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "Success": true,
  "Code": 200,
  "Message": "test",
  "PageSize": 100,
  "PageNumber": 1,
  "TotalCount": 1,
  "RegionId": "cn-hangzhou",
  "PublicIpAddress": [
    "101.37.XX.XX/24"
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.IpVersionParam IpVersion illegal.Illegal parameter: IpVersion
403ForbiddenUser not authorized to operate on the specified resource.You do not have the permissions to manage the specified resource. Apply for the permissions and try again.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-24The Error code has changed. The request parameters of the API has changedView Change Details
2024-03-12The Error code has changedView Change Details
2024-02-26API Description Update. The Error code has changedView Change Details
2023-05-15The Error code has changedView Change Details