doc-exports/docs/dns/api-ref/dns_api_67004.html
Qin Ying, Fan a79d5bdbdb DNS API 1017 version
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2022-10-20 13:26:00 +00:00

98 lines
8.0 KiB
HTML

<a name="dns_api_67004"></a><a name="dns_api_67004"></a>
<h1 class="topictitle1">Querying Tags of a Resource</h1>
<div id="body1532575050481"><div class="section" id="dns_api_67004__section2763065016101"><h4 class="sectiontitle">Function</h4><p id="dns_api_67004__ae1daa13a06714b93a3e4e24b49bce484">Query tags of a specified resource.</p>
</div>
<div class="section" id="dns_api_67004__section53701671161015"><h4 class="sectiontitle">URI</h4><p id="dns_api_67004__p4113242310593">GET /v2/{project_id}/{resource_type}/{resource_id}/tags</p>
<div class="p" id="dns_api_67004__p0687614174712">For details, see <a href="#dns_api_67004__table6099729418149">Table 1</a>.
<div class="tablenoborder"><a name="dns_api_67004__table6099729418149"></a><a name="table6099729418149"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67004__table6099729418149" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters in the URI</caption><thead align="left"><tr id="dns_api_67004__rfcbc44a8a46b42f7a3399447cc33e6bc"><th align="left" class="cellrowborder" valign="top" width="22.64%" id="mcps1.3.2.3.2.2.5.1.1"><p id="dns_api_67004__a7a4aca13a83145a7b874bba426d18c4c"><strong id="dns_api_67004__b11489181153217">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_67004__a8c3f3314bb0c42509b058a1de0687bf7"><strong id="dns_api_67004__b4367141233217">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_67004__a274153726c4f4e068d17da9d20adb07a"><strong id="dns_api_67004__b0334201353213">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_67004__en-us_topic_0123440237_p517246718149"><strong id="dns_api_67004__b1423241463214">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_67004__r4012eb0589df431685512c63766dd227"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67004__a1aec9468ac3740a592e230ea8946b4a0">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_67004__ac76f20b1516e4b15a400cc05c5c7ce34">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_67004__a2d2fc344bf1b429dae66d8e374fa2ed0">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_67004__a89702749d7e341b79567331aeb131cb1">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_67004__r12097de3a65e4af7996e768bb2f012f7"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67004__a83d50bdf8f0147428c4bd7d748d16f3e">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_67004__ad4ecbc7d4a34452f86a5163504ee39ea">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_67004__a8c89d349f80447ff996ebe69a283837a">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_67004__a05dbc56f4b6342738fbed75fdb3776e1">Resource type, which can be <strong id="dns_api_67004__b1280182613326">DNS-public_zone</strong>, <strong id="dns_api_67004__b628110263323">DNS-private_zone</strong>, <strong id="dns_api_67004__b428162663216">DNS-public_recordset</strong>, <strong id="dns_api_67004__b16282626183212">DNS-private_recordset</strong>, or <strong id="dns_api_67004__b128317266327">DNS-ptr_record</strong></p>
</td>
</tr>
<tr id="dns_api_67004__r959a126496424428b274abddaf342841"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67004__en-us_topic_0123440237_p408654311220">resource_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_67004__a8eaeadb4d70e418281a8f66c9e7f5039">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_67004__a9656fece8a6142d2889a5fd15e6e354a">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_67004__a74c281cde6aa47fbad1fdc186589692d">Resource ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="dns_api_67004__section44958995161021"><h4 class="sectiontitle">Request</h4><ul id="dns_api_67004__ul574750143015"><li id="dns_api_67004__li19747804302">Parameter description<p id="dns_api_67004__p1781935306"><a name="dns_api_67004__li19747804302"></a><a name="li19747804302"></a>None</p>
</li><li id="dns_api_67004__li157478013307">Example request<div class="p" id="dns_api_67004__p5694504494"><a name="dns_api_67004__li157478013307"></a><a name="li157478013307"></a>Query tags of the private zone whose ID is ff8080825b8fc86c015b94bc6f8712c3:<pre class="codeblock" id="dns_api_67004__codeblock1614284874913">GET https://{DNS_Endpoint}/v2/{project_id}/DNS-private_zone/ff8080825b8fc86c015b94bc6f8712c3/tags</pre>
</div>
</li></ul>
</div>
<div class="section" id="dns_api_67004__section40090803161031"><h4 class="sectiontitle">Response</h4><ul id="dns_api_67004__u9e70747b9dc44369a544d33192931763"><li id="dns_api_67004__l5a7131630cbb4563b069b4020a05bb98">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67004__t06efc88ee1e24ba281e64f0f72cd6ee2" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter in the response</caption><thead align="left"><tr id="dns_api_67004__r57b11ee36c3e4c078e8d340fede7ceb5"><th align="left" class="cellrowborder" valign="top" width="16.6%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="dns_api_67004__a241b6e5c9e234201af4fa904daa394f2"><strong>Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.74%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="dns_api_67004__a290e99af06484c05944b10c46ba3df86"><strong>Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.660000000000004%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="dns_api_67004__a7db4642355e5414282040a0dcd09f29f"><strong>Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_67004__r4ab5e324a1ce47a2bd7898c5f5232aa1"><td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_67004__a4e1ff91b33cc410d92c133a93b3d78f8">tags</p>
</td>
<td class="cellrowborder" valign="top" width="20.74%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_67004__ab36b944bfb32488cb24c09af397049ff">Array of object</p>
</td>
<td class="cellrowborder" valign="top" width="62.660000000000004%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_67004__a6ac16924197f4ccc962fe4fa46dbdf4b">Tag list. For details, see <a href="dns_api_80006.html#dns_api_80006__table19530794112436">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dns_api_67004__l85753eaf3dcb470f90cd401dba8a0424">Example response<pre class="screen" id="dns_api_67004__s9af343edcb8a415c807b434cd5995730">{
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="dns_api_67004__section9249181042119"><h4 class="sectiontitle">Returned Value</h4><p id="dns_api_67004__dns_api_61001_p711102924515">If the API call returns a code of 2<em id="dns_api_67004__dns_api_61001_i113378598177">xx</em>, for example, 200, 202, or 204, the request is successful.</p>
<p id="dns_api_67004__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>