Querying Name Servers in a Private Zone
Function
This API is used to query the name server information of a private zone after the private zone is created. The information includes the priority and DNS server address.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
dns:zone:get
Read
zone *
-
g:ResourceTag/<tag-key>
-
g:EnterpriseProjectId
-
-
-
URI
GET /v2/zones/{zone_id}/nameservers
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
zone_id |
Yes |
String |
Definition Zone ID Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition The user token. The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. For details about how to obtain a user token, seeObtaining a User Token. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
nameservers |
Array of PrivateNameServer objects |
Definition Name server list Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
priority |
Integer |
Definition Priority. If the priority of a name server is set to 1, it is used to resolve domain names in the first priority. Range N/A |
|
address |
String |
Definition Address of the DNS server Range N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code Range N/A |
|
message |
String |
Definition Error description Range N/A |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code Range N/A |
|
message |
String |
Definition Error description Range N/A |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code Range N/A |
|
message |
String |
Definition Error description Range N/A |
Example Requests
None
Example Responses
Status code: 200
Successful request
{
"nameservers" : [ {
"priority" : 1,
"address" : "100.125.0.81"
}, {
"priority" : 2,
"address" : "100.125.0.82"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Successful request |
|
400 |
Error response |
|
404 |
Error response |
|
500 |
Error response |
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.