forked from docs/doc-exports
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>
132 lines
11 KiB
HTML
132 lines
11 KiB
HTML
<a name="dns_api_67001"></a><a name="dns_api_67001"></a>
|
|
|
|
<h1 class="topictitle1">Adding Resource Tags</h1>
|
|
<div id="body1532574607826"><div class="section" id="dns_api_67001__section2763065016101"><h4 class="sectiontitle">Function</h4><p id="dns_api_67001__a6eb654d918da41ebbdcf96ae1ca625d7">Add tags to a specified resource.</p>
|
|
<p id="dns_api_67001__p147719171875">You can add a maximum of 20 tags to a resource.</p>
|
|
<p id="dns_api_67001__aa5874d954eb34a42b9ac20e0f36bd65f">The API is idempotent.</p>
|
|
<p id="dns_api_67001__en-us_topic_0101702788_p43630101429">If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.</p>
|
|
</div>
|
|
<div class="section" id="dns_api_67001__section53701671161015"><h4 class="sectiontitle">URI</h4><p id="dns_api_67001__p4113242310593">POST /v2/{project_id}/{resource_type}/{resource_id}/tags</p>
|
|
<div class="p" id="dns_api_67001__p1180320208449">For details, see <a href="#dns_api_67001__table6099729418149">Table 1</a>.
|
|
<div class="tablenoborder"><a name="dns_api_67001__table6099729418149"></a><a name="table6099729418149"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67001__table6099729418149" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters in the URI</caption><thead align="left"><tr id="dns_api_67001__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_67001__p3709279118149"><strong id="dns_api_67001__b162774213314533">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_67001__p5172606218149"><strong id="dns_api_67001__b593421527191713">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_67001__p2906151418149"><strong id="dns_api_67001__b84235270619112">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_67001__p517246718149"><strong id="dns_api_67001__b842352706112423">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dns_api_67001__row1631668818149"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67001__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_67001__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_67001__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_67001__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_67001__row1923936518149"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67001__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_67001__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_67001__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_67001__p1779865118149">Resource type, which can be <strong id="dns_api_67001__b84235270692258">DNS-public_zone</strong>, <strong id="dns_api_67001__b8423527069232">DNS-private_zone</strong>, <strong id="dns_api_67001__b84235270692310">DNS-public_recordset</strong>, <strong id="dns_api_67001__b84235270692315">DNS-private_recordset</strong>, or <strong id="dns_api_67001__b84235270692322">DNS-ptr_record</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dns_api_67001__row1082100911220"><td class="cellrowborder" valign="top" width="22.64%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_67001__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_67001__p6257460611220">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_67001__p3537835811220">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_67001__p4707473411220">Resource ID</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dns_api_67001__section44958995161021"><h4 class="sectiontitle">Request</h4><ul id="dns_api_67001__ud24aa7b8138545a482883391d2c46c0a"><li id="dns_api_67001__lc28bf778b52c4e53a6149f7fee32cf7b">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67001__tf56b8c8326da44b3844fe8c5df85a23c" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter in the request</caption><thead align="left"><tr id="dns_api_67001__r22221fe96fc24fa5a3f22d0100989975"><th align="left" class="cellrowborder" valign="top" width="22.447755224477554%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="dns_api_67001__en-us_topic_0101702788_p3415211830"><strong>Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.038496150384962%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="dns_api_67001__en-us_topic_0101702788_p276632601830"><strong id="dns_api_67001__b1400424311">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.5983401659834%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="dns_api_67001__en-us_topic_0101702788_p261316001830"><strong id="dns_api_67001__b582182203">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45.91540845915409%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="dns_api_67001__en-us_topic_0101702788_p362848191830"><strong>Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dns_api_67001__r0ff740ac33024e74ab63717c22aaaed6"><td class="cellrowborder" valign="top" width="22.447755224477554%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="dns_api_67001__aa055935855b44aa580ac1748d6f41850">tag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.038496150384962%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="dns_api_67001__en-us_topic_0101702788_p458022581830">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.5983401659834%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="dns_api_67001__a52b5dc27b27a45aabcfa3d18e332d4ed">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.91540845915409%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="dns_api_67001__p101791743155017">Tag</p>
|
|
<p id="dns_api_67001__a8a0d1af5efb7404498e4669e48d0ae76">For details, see <a href="#dns_api_67001__t055aabf9d8484a0d922846610305b7f9">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="dns_api_67001__t055aabf9d8484a0d922846610305b7f9"></a><a name="t055aabf9d8484a0d922846610305b7f9"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_67001__t055aabf9d8484a0d922846610305b7f9" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters in the tag list</caption><thead align="left"><tr id="dns_api_67001__r57726f784b5b4006a4bb47accda06a5c"><th align="left" class="cellrowborder" valign="top" width="22.36%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="dns_api_67001__a3a8890a0c3af48d68f912f272351c4aa"><strong>Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.21%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="dns_api_67001__af2d271ee7de8401292991a8f72dc37eb"><strong id="dns_api_67001__b70501557">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.46%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="dns_api_67001__ad4ea1d8dca6144308936f01420ef0585"><strong id="dns_api_67001__b1395359266">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45.97%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="dns_api_67001__a0e2c0399a34e48d5b7c57c6dbf69beed"><strong>Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dns_api_67001__r2e28006831f0424480241316b32eae61"><td class="cellrowborder" valign="top" width="22.36%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dns_api_67001__a8dc4dd9562734cadbbff4a64cc973c52">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.21%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dns_api_67001__a4901c3e7ab064f698d345c38d0c2c46e">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.46%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dns_api_67001__a3c2e609918db475d8ca0cd27104064d8">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.97%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dns_api_67001__ae51cc6516ab24504807d3f5aa8017f45">Tag key. The key contains 36 Unicode characters at most and cannot be blank. It can contain only digits, letters, hyphens (-), and underscores (_).</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dns_api_67001__rfbfff4f65df24a4992bd5da651ab5562"><td class="cellrowborder" valign="top" width="22.36%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dns_api_67001__a18771070534f469a987b92f31b108866">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.21%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dns_api_67001__a5cbd7f2d4fdc4d2dbdcbd2591568f73c">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.46%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dns_api_67001__ad7b4d716b6814e3bb4e6abe17b88955e">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.97%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dns_api_67001__acdc40e9a66fa412abb279f7a1969ce78">Tag value. Each value contains 43 Unicode characters at most and can be an empty string. It can contain only digits, letters, hyphens (-), and underscores (_).</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="dns_api_67001__l7e5ebe803f8b4f0c83e4e60619568275">Example request<div class="p" id="dns_api_67001__p1893716478"><a name="dns_api_67001__l7e5ebe803f8b4f0c83e4e60619568275"></a><a name="l7e5ebe803f8b4f0c83e4e60619568275"></a>Add tags for the private zone whose ID is ff8080825b8fc86c015b94bc6f8712c3:<pre class="codeblock" id="dns_api_67001__codeblock10148185994619">POST https://{DNS_Endpoint}/v2/{project_id}/DNS-private_zone/ff8080825b8fc86c015b94bc6f8712c3/tags</pre>
|
|
</div>
|
|
<div class="p" id="dns_api_67001__p414815954611"><pre class="screen" id="dns_api_67001__screen3148195916466">{
|
|
"tag": {
|
|
"key": "key1",
|
|
"value": "value1"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dns_api_67001__section40090803161031"><h4 class="sectiontitle">Response</h4><p id="dns_api_67001__a37e08be422074cbea99b1e9c1bc95283">None</p>
|
|
</div>
|
|
<div class="section" id="dns_api_67001__section9249181042119"><h4 class="sectiontitle">Returned Value</h4><p id="dns_api_67001__dns_api_61001_p711102924515">If the API call returns a code of 2<em id="dns_api_67001__dns_api_61001_i113378598177">xx</em>, for example, 200, 202, or 204, the request is successful.</p>
|
|
<p id="dns_api_67001__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>
|
|
|