Querying IP Address Information
Function
Queries the homing information of the IP address of a CDN PoP.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/cdn/ip-info
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
ip |
Yes |
Array |
Specifies the list of IP addresses, which can contain up to 20 IP addresses. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. |
X-Project-Id |
No |
String |
Project ID. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
cdn_ips |
Array of CdnIp objects |
Specifies the homing information of IP addresses. |
Parameter |
Type |
Description |
---|---|---|
ip |
String |
Specifies the IP address to be queried. |
belongs |
Boolean |
Indicates whether the CDN PoP is on [Huawei Cloud](tag: hws).
|
region |
String |
Specifies the homing information of an IP address. Unknown indicates that the homing information is unknown. |
isp |
String |
Specifies the carrier. If the homing information of the IP address is unknown, null is returned for this field. |
platform |
String |
Platform name. If the platform name is unknown, null is returned for this field. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Code |
error_msg |
String |
Error description |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Code |
error_msg |
String |
Error description |
Example Requests
-
Queries IP address home information. Format 1: IP addresses are concatenated by ampersands (&).
GET https://{endpoint}/v1/{project_id}/cdn/ip-info?ip=192.168.1.1&ip=192.168.1.2
-
Queries IP address home information. Format 2: IP addresses are separated by commas (,).
GET https://{endpoint}/v1/{project_id}/cdn/ip-info?ip=192.168.1.1,192.168.1.2
Example Responses
Status code: 200
Operation successful.
{ "cdn_ips" : [ { "ip" : "192.168.1.1", "region" : "Sichuan", "platform" : null, "isp" : "Dianxin", "belongs" : true }, { "ip" : "192.168.1.2", "region" : "Unknown", "platform" : null, "isp" : null, "belongs" : false } ] }
Status code: 400
Invalid parameter.
{ "error_code" : "LIVE.100011001", "error_msg" : "Request Illegal" }
Status code: 500
Internal service error.
{ "error_code" : "LIVE.100011005", "error_msg" : "Server internal error, please try again later or contact customer service staff to help solve" }
Status Codes
Status Code |
Description |
---|---|
200 |
Operation successful. |
400 |
Invalid parameter. |
500 |
Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.