forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
186 lines
15 KiB
HTML
186 lines
15 KiB
HTML
<a name="EN-US_TOPIC_0000001185673164"></a><a name="EN-US_TOPIC_0000001185673164"></a>
|
|
|
|
<h1 class="topictitle1">Adding or Deleting Resource Tags in Batches</h1>
|
|
<div id="body1524298666228"><div class="section" id="EN-US_TOPIC_0000001185673164__section961342216326"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001185673164__p10850132213218">This API is used to add or delete tags in batches for a specified resource. A maximum of 10 tags can be added for one resource.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001185673164__section3616162211329"><h4 class="sectiontitle">URI</h4><ul id="EN-US_TOPIC_0000001185673164__ul14851122263219"><li id="EN-US_TOPIC_0000001185673164__li18516221324">URI format<pre class="screen" id="EN-US_TOPIC_0000001185673164__screen57624166115">POST /v1.0/{project_id}/clusters/{resource_id}/tags/action</pre>
|
|
</li><li id="EN-US_TOPIC_0000001185673164__li15851622173213">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001185673164__table1263414221320" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001185673164__row38511622143216"><th align="left" class="cellrowborder" valign="top" width="14.85148514851485%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="EN-US_TOPIC_0000001185673164__p1085122233219"><strong id="EN-US_TOPIC_0000001185673164__b157598497318">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="EN-US_TOPIC_0000001185673164__p1785132212326"><strong id="EN-US_TOPIC_0000001185673164__b84235270684256">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="11.881188118811881%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="EN-US_TOPIC_0000001185673164__p68519227328"><strong>Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.42574257425742%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="EN-US_TOPIC_0000001185673164__p285122253218"><strong id="EN-US_TOPIC_0000001185673164__b183815522312">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001185673164__row5852142211326"><td class="cellrowborder" valign="top" width="14.85148514851485%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p285262203215">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p6852822153217">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.881188118811881%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p188521922133214">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.42574257425742%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p14202648155510">Project ID. For details about how to obtain the project ID, see <a href="dws_02_0011.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row4852152214321"><td class="cellrowborder" valign="top" width="14.85148514851485%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p7852822153215">resource_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p285232210324">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.881188118811881%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p985212216324">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.42574257425742%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p88521322163214">Resource ID, for example, <strong id="EN-US_TOPIC_0000001185673164__b84235270614114">7d85f602-a948-4a30-afd4-e84f47471c15</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001185673164__section96421022183220"><h4 class="sectiontitle">Request Message</h4><ul id="EN-US_TOPIC_0000001185673164__ul6852182212326"><li id="EN-US_TOPIC_0000001185673164__li13891162211426">Sample request for adding tags in batches<pre class="screen" id="EN-US_TOPIC_0000001185673164__screen1347173614419">POST /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/7d85f602-a948-4a30-afd4-e84f47471c15/tags/action
|
|
{
|
|
"action": "create",
|
|
"tags": [
|
|
{
|
|
"key": "Flower",
|
|
"value": "rose"
|
|
},
|
|
{
|
|
"key": "Food",
|
|
"value": "pie"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="EN-US_TOPIC_0000001185673164__li14434316423">Sample request for deleting tags in batches<pre class="screen" id="EN-US_TOPIC_0000001185673164__screen12938182294217">POST /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/7d85f602-a948-4a30-afd4-e84f47471c15/tags/action
|
|
{
|
|
"action": "delete",
|
|
"tags": [
|
|
{
|
|
"key": "Flower",
|
|
"value": "rose"
|
|
},
|
|
{
|
|
"key": "Food",
|
|
"value": "pie"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="EN-US_TOPIC_0000001185673164__li38521122133210">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001185673164__table12646422113215" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001185673164__row20852122213217"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.1.2.5.1.1"><p id="EN-US_TOPIC_0000001185673164__p5852112218325"><strong id="EN-US_TOPIC_0000001185673164__b23502323">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.1.2.5.1.2"><p id="EN-US_TOPIC_0000001185673164__p285272214324"><strong id="EN-US_TOPIC_0000001185673164__b1454673356">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.1.2.5.1.3"><p id="EN-US_TOPIC_0000001185673164__p2852202214326"><strong>Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.00000000000001%" id="mcps1.3.3.2.3.1.2.5.1.4"><p id="EN-US_TOPIC_0000001185673164__p20852152253220"><strong id="EN-US_TOPIC_0000001185673164__b5591924329">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001185673164__row8852172213322"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p7852322193218">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p1685272213212">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p20853422113216">List<<a href="#EN-US_TOPIC_0000001185673164__table594583311194">ResourceTag</a>></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.3.2.3.1.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p1853102211322">Tag list.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row178536228326"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p3853162263213">action</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p14853172283211">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.1.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p285332216322">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.3.2.3.1.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p3455728124210">Identifies the operation. The value can be <strong id="EN-US_TOPIC_0000001185673164__b842352706112823">create</strong> or <strong id="EN-US_TOPIC_0000001185673164__b842352706112836">delete</strong>.</p>
|
|
<ul id="EN-US_TOPIC_0000001185673164__ul1611136174215"><li id="EN-US_TOPIC_0000001185673164__li176113364424"><strong id="EN-US_TOPIC_0000001185673164__b84235270611286">create</strong>: adds tags in batches.</li><li id="EN-US_TOPIC_0000001185673164__li098453874216"><strong id="EN-US_TOPIC_0000001185673164__b84235270611295">delete</strong>: deletes tags in batches.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001185673164__table594583311194"></a><a name="table594583311194"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001185673164__table594583311194" frame="border" border="1" rules="all"><caption><b>Table 3 </b>resource_tag</caption><thead align="left"><tr id="EN-US_TOPIC_0000001185673164__row1955183371910"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001185673164__p17959153314198"><strong id="EN-US_TOPIC_0000001185673164__b107161953321">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000001185673164__p11963153351911"><strong id="EN-US_TOPIC_0000001185673164__b1190719073">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000001185673164__p3965183313192"><strong>Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.00000000000001%" id="mcps1.3.3.2.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000001185673164__p19692338199"><strong id="EN-US_TOPIC_0000001185673164__b1953698183217">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001185673164__row15976163371911"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p59811333121919">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p189831133141917">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p598719331190">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p16990933201912">Tag key. A tag key can contain a maximum of 36 Unicode characters, which cannot be null. The first and last characters cannot be spaces.</p>
|
|
<p id="EN-US_TOPIC_0000001185673164__p1740919129378">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row499283311914"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001185673164__p189946338192">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001185673164__p15996143318198">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001185673164__p086349191">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.3.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001185673164__p1211143481914">Key value. A tag value can contain a maximum of 43 Unicode characters, which can be null. The first and last characters cannot be spaces.</p>
|
|
<p id="EN-US_TOPIC_0000001185673164__p4764545454">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001185673164__section1267862233212"><h4 class="sectiontitle">Response Message</h4><p id="EN-US_TOPIC_0000001185673164__en-us_topic_0067625516_p070316818262">Example response</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001185673164__sabffaf8806d04531be3a32b013bf56e3">status CODE 204</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001185673164__section367910228327"><h4 class="sectiontitle">Status Code</h4><ul id="EN-US_TOPIC_0000001185673164__ul98541622173212"><li id="EN-US_TOPIC_0000001185673164__li18854122233214">Normal<p id="EN-US_TOPIC_0000001185673164__p10722155724911"><a name="EN-US_TOPIC_0000001185673164__li18854122233214"></a><a name="li18854122233214"></a>204</p>
|
|
</li><li id="EN-US_TOPIC_0000001185673164__li10854192293212">Exception
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001185673164__table5682122263215" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Returned value for failed requests</caption><thead align="left"><tr id="EN-US_TOPIC_0000001185673164__row13855122218322"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.2.2.1.2.3.1.1"><p id="EN-US_TOPIC_0000001185673164__p188551522163210"><strong id="EN-US_TOPIC_0000001185673164__b84235270611397">Returned Value</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.5.2.2.1.2.3.1.2"><p id="EN-US_TOPIC_0000001185673164__p8855102283212"><strong id="EN-US_TOPIC_0000001185673164__b14713916163213">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001185673164__row17855722163216"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001185673164__p785572213216">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001185673164__p88559223327">Invalid tag.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row1085562212325"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001185673164__p15855102243213">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001185673164__p885518226328">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row12855622183220"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001185673164__p385532293210">403</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001185673164__p38551822153220">You do not have the permission to perform the operation.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row198552222326"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001185673164__p13855022103219">404</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001185673164__p19855222183220">The requested resource was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001185673164__row1885502219326"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001185673164__p78551522163211">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001185673164__p12855182213325">Internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_02_0045.html">Tag Management APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|