doc-exports/docs/dns/api-ref/dns_api_67005.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

125 lines
9.4 KiB
HTML

<a name="dns_api_67005"></a><a name="dns_api_67005"></a>
<h1 class="topictitle1">Querying Tags of a Specified Resource Type</h1>
<div id="body1532574607842"><div class="section" id="dns_api_67005__section2763065016101"><h4 class="sectiontitle">Function</h4><p id="dns_api_67005__ada37093d11d34725afe2a4a706024bb1">Query all tags of a resource type.</p>
</div>
<div class="section" id="dns_api_67005__section53701671161015"><h4 class="sectiontitle">URI</h4><p id="dns_api_67005__p6663550820366">GET /v2/{project_id}/{resource_type}/tags</p>
<div class="p" id="dns_api_67005__p711024501">For details, see <a href="#dns_api_67005__table6099729418149">Table 1</a>.
<div class="tablenoborder"><a name="dns_api_67005__table6099729418149"></a><a name="table6099729418149"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67005__table6099729418149" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters in the URI</caption><thead align="left"><tr id="dns_api_67005__row3442661918149"><th align="left" class="cellrowborder" valign="top" width="22.64%" id="mcps1.3.2.3.2.2.5.1.1"><p id="dns_api_67005__p3709279118149"><strong id="dns_api_67005__b67491352133415">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.37%" id="mcps1.3.2.3.2.2.5.1.2"><p id="dns_api_67005__p5172606218149"><strong id="dns_api_67005__b12453253183413">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.349999999999998%" id="mcps1.3.2.3.2.2.5.1.3"><p id="dns_api_67005__p2906151418149"><strong id="dns_api_67005__b13154544345">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.64%" id="mcps1.3.2.3.2.2.5.1.4"><p id="dns_api_67005__p517246718149"><strong id="dns_api_67005__b1652975517341">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_67005__row1631668818149"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67005__p4658337018149">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.37%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="dns_api_67005__p1515661618149">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="dns_api_67005__p1972638718149">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.64%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="dns_api_67005__p5433349018149">Project ID. You can obtain it in <a href="dns_api_80007.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="dns_api_67005__row1923936518149"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67005__p1488470218149">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="17.37%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="dns_api_67005__p6481017518149">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="dns_api_67005__p1513281718149">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.64%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="dns_api_67005__p91002307415">Resource type.</p>
<ul id="dns_api_67005__ul3997124517225"><li id="dns_api_67005__dns_api_67001_li166466010217">DNS-public_zone</li><li id="dns_api_67005__dns_api_67001_li1264680132118">DNS-private_zone</li><li id="dns_api_67005__dns_api_67001_li136469010215">DNS-public_recordset</li><li id="dns_api_67005__dns_api_67001_li176467015215">DNS-private_recordset</li><li id="dns_api_67005__dns_api_67001_li126461909212">DNS-ptr_record</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="dns_api_67005__section44958995161021"><h4 class="sectiontitle">Request</h4><p id="dns_api_67005__p96021025219">None</p>
<ul id="dns_api_67005__ul574750143015"><li id="dns_api_67005__li19747804302">Parameter description<p id="dns_api_67005__p1781935306"><a name="dns_api_67005__li19747804302"></a><a name="li19747804302"></a>None</p>
</li><li id="dns_api_67005__li157478013307">Example request<div class="p" id="dns_api_67005__p1738562655017"><a name="dns_api_67005__li157478013307"></a><a name="li157478013307"></a>Query tags of all private zones in a project:<pre class="codeblock" id="dns_api_67005__codeblock204468239506">GET https://{DNS_Endpoint}/v2/{project_id}/DNS-private_zone/tags</pre>
</div>
</li></ul>
</div>
<div class="section" id="dns_api_67005__section40090803161031"><h4 class="sectiontitle">Response</h4><ul id="dns_api_67005__u6f4d9f02c504499b8d4fef93dbcde47a"><li id="dns_api_67005__l1f767a1c05184a759c01d58434849626">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67005__t593ae00046564bbcb49e84485ef14071" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the response</caption><thead align="left"><tr id="dns_api_67005__rf54583b8c8e0499691d7d9ff9f06f37a"><th align="left" class="cellrowborder" valign="top" width="19.24%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="dns_api_67005__a86661040859b40a8b253c065971cf8ae"><strong id="dns_api_67005__b12629797426">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.67%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="dns_api_67005__a5cfaf558b8724bd999608631ffa7f08f"><strong>Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.09%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="dns_api_67005__acc90819224564ea5a481fc9816ae6a22"><strong>Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_67005__r30b7bae25edb4cfc8fd03903cbe75b5a"><td class="cellrowborder" valign="top" width="19.24%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_67005__a0c6dfa6d8f3f4730a43d1c0f2e94cbe0">tags</p>
</td>
<td class="cellrowborder" valign="top" width="18.67%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_67005__p10265887147">Array of object</p>
</td>
<td class="cellrowborder" valign="top" width="62.09%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_67005__add06d19cb36743c8b9be66895278d027">Tag list. For details, see <a href="#dns_api_67005__table19530794112436">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dns_api_67005__table19530794112436"></a><a name="table19530794112436"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67005__table19530794112436" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of the <strong id="dns_api_67005__b727814588278">tag</strong> field</caption><thead align="left"><tr id="dns_api_67005__row15361836112436"><th align="left" class="cellrowborder" valign="top" width="18.011801180118013%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="dns_api_67005__p58707511112436"><strong id="dns_api_67005__b1215310182812">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.28192819281928%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="dns_api_67005__p42210623112436"><strong>Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.70627062706271%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="dns_api_67005__p63617265112436"><strong id="dns_api_67005__b228181142817">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_67005__row35684479112436"><td class="cellrowborder" valign="top" width="18.011801180118013%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="dns_api_67005__p13313439112530">key</p>
</td>
<td class="cellrowborder" valign="top" width="19.28192819281928%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="dns_api_67005__p35653193112436">String</p>
</td>
<td class="cellrowborder" valign="top" width="62.70627062706271%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="dns_api_67005__p011410211144">Tag key</p>
<p id="dns_api_67005__p12621122816413">A key can contain up to 36 Unicode characters. The key cannot be empty. </p>
</td>
</tr>
<tr id="dns_api_67005__row20048002112436"><td class="cellrowborder" valign="top" width="18.011801180118013%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="dns_api_67005__p66095544112533">values</p>
</td>
<td class="cellrowborder" valign="top" width="19.28192819281928%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="dns_api_67005__p60123528112436">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="62.70627062706271%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="dns_api_67005__p592417401420">Tag value</p>
<p id="dns_api_67005__p3383124915419">Each value can contain up to 43 Unicode characters and can be an empty string. </p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dns_api_67005__l6f5c66f4d570477db930dd906888a70b">Example response<pre class="screen" id="dns_api_67005__s2496e19c4a604219a8cd47e69452b32d">{
"tags": [
{
"key": "key1",
"values": [
"value1",
"value2"
]
},
{
"key": "key2",
"values": [
"value1",
"value2"
]
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="dns_api_67005__section9249181042119"><h4 class="sectiontitle">Returned Value</h4><p id="dns_api_67005__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_67005__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_67000.html">Tag Management</a></div>
</div>
</div>