Files
doc-exports/docs/cfw/api-ref/ListDnsServers.html
2024-05-31 16:33:09 +08:00

249 lines
17 KiB
HTML

<a name="ListDnsServers"></a><a name="ListDnsServers"></a>
<h1 class="topictitle1">Querying the DNS Server List</h1>
<div id="body14573110113010"><div class="section" id="ListDnsServers__section1557311043018"><h4 class="sectiontitle">Function</h4><p id="ListDnsServers__p1957314020305">This API is used to query the DNS server list.</p>
</div>
<div class="section" id="ListDnsServers__section257415018304"><h4 class="sectiontitle">URI</h4><p id="ListDnsServers__p17574180133019">GET /v1/{project_id}/dns/servers</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__table1157520123011" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ListDnsServers__row15751104300"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ListDnsServers__p1157600113018">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ListDnsServers__p1357619013301">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ListDnsServers__p165767093011">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ListDnsServers__p1857618083016">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row3575150103010"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListDnsServers__p175776011301">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListDnsServers__p757760163017">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListDnsServers__p1057718023015">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListDnsServers__p13577909301">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__table1057814013010" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="ListDnsServers__row11578701309"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="ListDnsServers__p1557916093015">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="ListDnsServers__p457915013015">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="ListDnsServers__p35791301304">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="ListDnsServers__p157970203016">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row4578120183015"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p158016013307">limit</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p17580160133015">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p8580606309">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p55805063016">Number of records displayed on each page, in the range 1-1024</p>
</td>
</tr>
<tr id="ListDnsServers__row10578180143017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p1658119020307">offset</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p858119015301">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p3581906306">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p175811405304">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 <strong id="ListDnsServers__b25813019301">0</strong>.</p>
</td>
</tr>
<tr id="ListDnsServers__row165783063018"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p458150153010">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p185821304301">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p1558214019301">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p5582603305">Firewall instance ID, which is automatically generated after a CFW instance is created. You can obtain the ID by calling the API used for querying a firewall instance. For details, see the API Explorer and Help Center FAQ.By default, if fw_instance_Id is not specified, information about the first firewall under the account is returned. If fw_instance_Id is specified, information about the firewall with this fw_instance_Id is returned.If object_Id is specified, information about the firewall with this object_Id is returned by default. If both fw_instance_Id and object_Id are specified, the specified object_Id must belong to the specified firewall.</p>
</td>
</tr>
<tr id="ListDnsServers__row155781300303"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p1258280173014">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p85831063016">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p10583306304">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p95831402304">Enterprise project id, the id generated by the enterprise project after the user supports the enterprise project.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section1583507300"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="ListDnsServers__row125841807308"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ListDnsServers__p1158410020303">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ListDnsServers__p158414014301">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ListDnsServers__p55853014303">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ListDnsServers__p185851405306">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row058410016301"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListDnsServers__p55851502305">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListDnsServers__p758515013015">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListDnsServers__p158560103015">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListDnsServers__p135866043016">User token. It 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 a token.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section158619018309"><h4 class="sectiontitle">Response Parameters</h4><p id="ListDnsServers__p15877019307"><strong id="ListDnsServers__b65874017303">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__response_HttpGetDnsServersResponseData" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="ListDnsServers__row115886013011"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="ListDnsServers__p1458818014307">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="ListDnsServers__p7589110103012">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="ListDnsServers__p11589180183016">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row13588130193016"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListDnsServers__p358916063011">data</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListDnsServers__p1058912053010">Array of <a href="#ListDnsServers__response_DnsServersResponseDTO">DnsServersResponseDTO</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListDnsServers__p155905023019">dns server list</p>
</td>
</tr>
<tr id="ListDnsServers__row1458816043018"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListDnsServers__p75909016309">total</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListDnsServers__p1759018023014">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListDnsServers__p659010011306">dns server total</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListDnsServers__response_DnsServersResponseDTO"></a><a name="response_DnsServersResponseDTO"></a><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__response_DnsServersResponseDTO" frame="border" border="1" rules="all"><caption><b>Table 5 </b>DnsServersResponseDTO</caption><thead align="left"><tr id="ListDnsServers__row20591110183015"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="ListDnsServers__p759111033020">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="ListDnsServers__p1959211014307">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="ListDnsServers__p1059217018306">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row35911800303"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p0592608301">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p65928053015">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p25931013304">id</p>
</td>
</tr>
<tr id="ListDnsServers__row95911093019"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p95931202301">is_applied</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p145935063019">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p159315018304">Indicates whether to apply. 0: no; 1: yes</p>
</td>
</tr>
<tr id="ListDnsServers__row16591107307"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p25931017305">is_customized</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p95941207309">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p2059413016304">Indicates whether the DNS server is user-defined. 0: no; 1: yes</p>
</td>
</tr>
<tr id="ListDnsServers__row125918014307"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p2594406308">server_ip</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p16594100103017">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p6595130143014">DNS server IP address</p>
</td>
</tr>
<tr id="ListDnsServers__row16591505305"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p259518010302">health_check_domain_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p559570123017">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p8595901301">health check domain name</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section25959016302"><h4 class="sectiontitle">Example Requests</h4><p id="ListDnsServers__p25969018304">Obtain the DNS server list of the project whose ID is 2349ba469daf4b7daf268bb0261d18b0.</p>
<pre class="screen" id="ListDnsServers__screen859612093018">https://console.xxxxxx.com/cfw/v1/2349ba469daf4b7daf268bb0261d18b0/dns/servers</pre>
</div>
<div class="section" id="ListDnsServers__section959610193017"><h4 class="sectiontitle">Example Responses</h4><p id="ListDnsServers__p4596190123011"><strong id="ListDnsServers__b1959610173013">Status code: 200</strong></p>
<p id="ListDnsServers__p13596801300">Response to the request for obtaining DNS servers</p>
<pre class="screen" id="ListDnsServers__screen105971023019">{
"data" : {
"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
}</pre>
</div>
<div class="section" id="ListDnsServers__section19730180173010"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ListDnsServers__row19622100203016"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ListDnsServers__p773017018304">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="ListDnsServers__p3730170183011">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row166223019302"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p773011053010">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p137304012302">Response to the request for obtaining DNS servers</p>
</td>
</tr>
<tr id="ListDnsServers__row186233033017"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p373120113015">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p1273100173010">Unauthorized</p>
</td>
</tr>
<tr id="ListDnsServers__row762380113015"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p117328014301">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p1073250143012">Forbidden</p>
</td>
</tr>
<tr id="ListDnsServers__row126231709301"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p4732110163018">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p19732190163018">Not Found</p>
</td>
</tr>
<tr id="ListDnsServers__row3623804303"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p9732209309">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p13732304309">Internal Server Error</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section1873220133012"><h4 class="sectiontitle">Error Codes</h4><p id="ListDnsServers__p97321107302">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000006.html">Domain Parse and Domain Set Management</a></div>
</div>
</div>