doc-exports/docs/dns/api-ref/dns_api_62004.html
Qin Ying, Fan cf1007c84e DNS API 20240223 version
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2024-05-16 13:48:49 +00:00

110 lines
8.1 KiB
HTML

<a name="dns_api_62004"></a><a name="dns_api_62004"></a>
<h1 class="topictitle1">Querying Name Servers in a Public Zone</h1>
<div id="body1492859433049"><div class="section" id="dns_api_62004__section55898385"><h4 class="sectiontitle">Function</h4><p id="dns_api_62004__p10983320">Query name servers in a public zone.</p>
</div>
<div class="section" id="dns_api_62004__section33323423"><h4 class="sectiontitle">URI</h4><p id="dns_api_62004__p431592017711">GET /v2/zones/{zone_id}/nameservers</p>
<div class="p" id="dns_api_62004__p112538221979">For details, see <a href="#dns_api_62004__table14024165">Table 1</a>.
<div class="tablenoborder"><a name="dns_api_62004__table14024165"></a><a name="table14024165"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_62004__table14024165" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter in the URI</caption><thead align="left"><tr id="dns_api_62004__row26592044"><th align="left" class="cellrowborder" valign="top" width="19.41%" id="mcps1.3.2.3.2.2.5.1.1"><p id="dns_api_62004__p6471942"><strong id="dns_api_62004__b162774213314533_1">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.97%" id="mcps1.3.2.3.2.2.5.1.2"><p id="dns_api_62004__p54465313"><strong id="dns_api_62004__b593421527191713">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.65%" id="mcps1.3.2.3.2.2.5.1.3"><p id="dns_api_62004__p49614245"><strong id="dns_api_62004__b84235270619112_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.97%" id="mcps1.3.2.3.2.2.5.1.4"><p id="dns_api_62004__p59330872"><strong id="dns_api_62004__b842352706112423_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_62004__row41071365"><td class="cellrowborder" valign="top" width="19.41%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_62004__p38446258">zone_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="dns_api_62004__p27139175">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.65%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="dns_api_62004__p50789581">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.97%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="dns_api_62004__p20315403">Zone ID</p>
<p id="dns_api_62004__p1669018482183">You can obtain the value by calling the API in <a href="dns_api_62003.html">Querying Public Zones</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="dns_api_62004__section31475357"><h4 class="sectiontitle">Request</h4><ul id="dns_api_62004__ul35351571269"><li id="dns_api_62004__li1053565782615">Request parameters<p id="dns_api_62004__p1815201642711"><a name="dns_api_62004__li1053565782615"></a><a name="li1053565782615"></a>None</p>
</li><li id="dns_api_62004__li4109190182715">Example request<p id="dns_api_62004__p1651121054613"><a name="dns_api_62004__li4109190182715"></a><a name="li4109190182715"></a>Query name servers of the zone whose ID is 2c9eb155587194ec01587224c9f90149:</p>
<pre class="codeblock" id="dns_api_62004__codeblock157042222406">GET https://{DNS_Endpoint}/v2/zones/2c9eb155587194ec01587224c9f90149/nameservers</pre>
</li></ul>
</div>
<div class="section" id="dns_api_62004__section14842765"><h4 class="sectiontitle">Response</h4><ul id="dns_api_62004__ul8135151"><li id="dns_api_62004__li6107499">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_62004__table2534644119347" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter in the response</caption><thead align="left"><tr id="dns_api_62004__row2134485619347"><th align="left" class="cellrowborder" valign="top" width="18.47%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="dns_api_62004__p5121175619347"><strong id="dns_api_62004__b162774213314533_3">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.59%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="dns_api_62004__p5451156519347"><strong id="dns_api_62004__b84235270619112_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.940000000000005%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="dns_api_62004__p5336061019347"><strong id="dns_api_62004__b842352706112423_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_62004__row2724213119347"><td class="cellrowborder" valign="top" width="18.47%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_62004__p5912903419347">nameservers</p>
</td>
<td class="cellrowborder" valign="top" width="21.59%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_62004__p2472241219347">Array of object</p>
</td>
<td class="cellrowborder" valign="top" width="59.940000000000005%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_62004__p64387025171923">Name server list. For details, see <a href="#dns_api_62004__table3847447219326">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dns_api_62004__table3847447219326"></a><a name="table3847447219326"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_62004__table3847447219326" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of the <strong id="dns_api_62004__b842352706152641">nameservers</strong> field</caption><thead align="left"><tr id="dns_api_62004__row3833649519326"><th align="left" class="cellrowborder" valign="top" width="20.16%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="dns_api_62004__p3493722219342"><strong id="dns_api_62004__b162774213314533_5">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.67%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="dns_api_62004__p1134272819342"><strong id="dns_api_62004__b84235270619112_5">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.17%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="dns_api_62004__p4634576219342"><strong id="dns_api_62004__b842352706112423_5">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_62004__row3753895719326"><td class="cellrowborder" valign="top" width="20.16%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="dns_api_62004__p19222756195728">hostname</p>
</td>
<td class="cellrowborder" valign="top" width="29.67%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="dns_api_62004__p13539398195728">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.17%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="dns_api_62004__p22949440195728">Host name of a name server</p>
</td>
</tr>
<tr id="dns_api_62004__row4963379019326"><td class="cellrowborder" valign="top" width="20.16%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="dns_api_62004__p20035160195728">priority</p>
</td>
<td class="cellrowborder" valign="top" width="29.67%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="dns_api_62004__p12235287195728">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50.17%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="dns_api_62004__p51534186195728">Priority of a name server</p>
<p id="dns_api_62004__p63758461163042">For example, if the priority of a name server is <strong id="dns_api_62004__b842352706104533">1</strong>, it is used to resolve domain names in first priority.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="dns_api_62004__ul2026335"><li id="dns_api_62004__li18237015">Example response<pre class="screen" id="dns_api_62004__screen6709033920539">{
"nameservers": [
{
"hostname": "ns1.example.com.",
"priority": 1
},
{
"hostname": "ns2.example.com.",
"priority": 2
}
]
}
</pre>
</li></ul>
</div>
<div class="section" id="dns_api_62004__section9249181042119"><h4 class="sectiontitle">Returned Value</h4><p id="dns_api_62004__dns_api_61001_p711102924515">If a 2xx status code is returned, for example, 200, 202, or 204, the request is successful.</p>
<p id="dns_api_62004__dns_api_61001_p18506102624518">For details, see <a href="dns_api_80002.html">Status Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dns_api_62000.html">Public Zone Management</a></div>
</div>
</div>