doc-exports/docs/cfw/api-ref/ListDnsServers.html
2024-07-03 10:59:59 +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="body2028217811105"><div class="section" id="ListDnsServers__section42831188104"><h4 class="sectiontitle">Function</h4><p id="ListDnsServers__p192838816105">This API is used to query the DNS server list.</p>
</div>
<div class="section" id="ListDnsServers__section62833810109"><h4 class="sectiontitle">URI</h4><p id="ListDnsServers__p192841816101">GET /v1/{project_id}/dns/servers</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__table1928511817102" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ListDnsServers__row72841388104"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ListDnsServers__p15285188171020">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ListDnsServers__p528518816108">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ListDnsServers__p1228618141014">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ListDnsServers__p1728608151015">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row728408151014"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListDnsServers__p13286138141015">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListDnsServers__p1328708151014">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListDnsServers__p16287385102">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListDnsServers__p72871811102">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListDnsServers__table182881383109" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="ListDnsServers__row16288108101019"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="ListDnsServers__p528912831014">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="ListDnsServers__p1828998181012">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="ListDnsServers__p1328938161015">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="ListDnsServers__p8290687103">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row928878161012"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p1129088111011">limit</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p629018171017">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p6290783106">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p22915816103">Number of records displayed on each page, in the range 1-1024</p>
</td>
</tr>
<tr id="ListDnsServers__row112881887107"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p329128171016">offset</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p13291889105">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p229114814105">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p129113817107">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__b2029220811108">0</strong>.</p>
</td>
</tr>
<tr id="ListDnsServers__row3288380103"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p1229214812109">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p1629238111012">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p1529218201011">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p629220881018">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__row02881789108"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListDnsServers__p18293281105">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListDnsServers__p929310851011">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListDnsServers__p12933891010">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListDnsServers__p929417871011">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__section1829413811102"><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__row8294183106"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ListDnsServers__p1129516881017">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ListDnsServers__p13295983103">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ListDnsServers__p32967811106">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ListDnsServers__p829614821016">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row13294198111014"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListDnsServers__p19296148101018">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListDnsServers__p529658191019">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListDnsServers__p229611814104">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListDnsServers__p529612811017">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__section3297085106"><h4 class="sectiontitle">Response Parameters</h4><p id="ListDnsServers__p10297783105"><strong id="ListDnsServers__b192971484107">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__row4297198161011"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="ListDnsServers__p202981810107">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="ListDnsServers__p1298383105">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="ListDnsServers__p929812811019">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row2297118201020"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListDnsServers__p17298683102">data</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListDnsServers__p16299118161018">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__p8299188161013">dns server list</p>
</td>
</tr>
<tr id="ListDnsServers__row182971589106"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListDnsServers__p329910813103">total</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListDnsServers__p3299168171017">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListDnsServers__p4300685104">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__row43015891010"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="ListDnsServers__p15302198191018">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="ListDnsServers__p73029813106">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="ListDnsServers__p173032811019">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row130188181010"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p530310891018">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p1303680104">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p103036831011">id</p>
</td>
</tr>
<tr id="ListDnsServers__row12301889104"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p530410811013">is_applied</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p0304128141015">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p11304782107">Indicates whether to apply. 0: no; 1: yes</p>
</td>
</tr>
<tr id="ListDnsServers__row183016811017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p1530438181011">is_customized</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p19305198191019">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p1330538151018">Indicates whether the DNS server is user-defined. 0: no; 1: yes</p>
</td>
</tr>
<tr id="ListDnsServers__row13301181103"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p203051889101">server_ip</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListDnsServers__p1330520819102">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p20305138131019">DNS server IP address</p>
</td>
</tr>
<tr id="ListDnsServers__row53014811020"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListDnsServers__p17305178121019">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__p1330616881012">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListDnsServers__p8306178171013">health check domain name</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section830638151014"><h4 class="sectiontitle">Example Requests</h4><p id="ListDnsServers__p1430658171020">Obtain the DNS server list of the project whose ID is 2349ba469daf4b7daf268bb0261d18b0.</p>
<pre class="screen" id="ListDnsServers__screen13062812107">https://console.example.com/cfw/v1/2349ba469daf4b7daf268bb0261d18b0/dns/servers</pre>
</div>
<div class="section" id="ListDnsServers__section53075841011"><h4 class="sectiontitle">Example Responses</h4><p id="ListDnsServers__p1930713818105"><strong id="ListDnsServers__b1530719821012">Status code: 200</strong></p>
<p id="ListDnsServers__p1930710814101">Response to the request for obtaining DNS servers</p>
<pre class="screen" id="ListDnsServers__screen133081589109">{
"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__section18530189111014"><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__row833517818104"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ListDnsServers__p153010991014">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__p1553059111011">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListDnsServers__row1633528111017"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p45300921013">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p13530189111014">Response to the request for obtaining DNS servers</p>
</td>
</tr>
<tr id="ListDnsServers__row33351881104"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p15305913106">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p453099171015">Unauthorized</p>
</td>
</tr>
<tr id="ListDnsServers__row1333516831011"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p105305981019">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p05302912101">Forbidden</p>
</td>
</tr>
<tr id="ListDnsServers__row7335168191016"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p105301912105">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p953079191017">Not Found</p>
</td>
</tr>
<tr id="ListDnsServers__row16335684103"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListDnsServers__p553018916104">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListDnsServers__p1853119919100">Internal Server Error</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListDnsServers__section1453115961010"><h4 class="sectiontitle">Error Codes</h4><p id="ListDnsServers__p153113951010">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>