This API is used to query the DNS server list.
GET /v1/{project_id}/dns/servers
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
limit |
No |
Integer |
Number of records displayed on each page. The value ranges from 1 to 1024. |
offset |
No |
Integer |
Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0. |
fw_instance_id |
No |
String |
Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
enterprise_project_id |
No |
String |
Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to Obtaining an Enterprise Project ID. If the enterprise project function is not enabled, the value is 0. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. You can obtain the token by referring to Obtaining a User Token. |
Content-Type |
Yes |
String |
Content type. It can only be set to application/json. |
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
data |
Array of DnsServersResponseDTO objects |
DNS server list. |
total |
Integer |
Total number of DNS servers. |
Parameter |
Type |
Description |
|---|---|---|
id |
Integer |
Domain name server ID. |
is_applied |
Integer |
Whether the DNS server is applied: 0 (no), 1 (yes). |
is_customized |
Integer |
Whether the DNS server is user-defined: 0 (no), 1 (yes). |
server_ip |
String |
DNS server IP address. |
health_check_domain_name |
String |
Health check domain name. |
Obtain the DNS server list of project 2349ba469daf4b7daf268bb0261d18b0.
https://{Endpoint}/v1/2349ba469daf4b7daf268bb0261d18b0/dns/servers?fw_instance_id=80e0f2df-24fd-49c2-8398-11f9a0299b3e
Status code: 200
Response to the request for obtaining DNS servers.
{
"data" : [ {
"health_check_domain_name" : "sslstatic.xiaoyusan.com",
"id" : 20165,
"is_applied" : 0,
"is_customized" : 1,
"server_ip" : "0.0.0.0"
}, {
"health_check_domain_name" : "sslstatic.xiaoyusan.com",
"id" : 14190,
"is_applied" : 1,
"is_customized" : 0,
"server_ip" : "100.79.1.240"
} ],
"total" : 2
}
Status Code |
Description |
|---|---|
200 |
Response to the request for obtaining DNS servers. |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
See Error Codes.