doc-exports/docs/ecs/api-ref/en-us_topic_0167811964.html
Zaoxu, Li 4edaa4a4cc ECS API 20231016 version
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-04-29 11:04:13 +00:00

140 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0167811964"></a><a name="EN-US_TOPIC_0167811964"></a>
<h1 class="topictitle1">Deleting Tags from an ECS in a Batch</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section2854124164213"><h4 class="sectiontitle">Function</h4><ul id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_ul46196246156"><li id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_li66192024171514">This API is used to delete tags from a specified ECS in a batch.</li><li id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_li16191024141514">The Tag Management Service (TMS) uses this API to batch manage the tags of an ECS.</li></ul>
<div class="note" id="EN-US_TOPIC_0167811964__note131841047132817"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0167811964__ul101007193014"><li id="EN-US_TOPIC_0167811964__li101117193014">This API is idempotent. When you delete a tag but the tag does not exist, a successful result is returned.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section118542413427"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0167811964__p1493551218133">An ECS allows a maximum of 10 tags.</p>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section18541045425"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_p1726175204210">POST /v1/{project_id}/cloudservers/{server_id}/tags/action</p>
<div class="p" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_p36711920154619"><a href="#EN-US_TOPIC_0167811964__table1320245602220">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811964__table1320245602220"></a><a name="table1320245602220"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811964__table1320245602220" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0167811964__row620245692213"><th align="left" class="cellrowborder" valign="top" width="22.29222922292229%" id="mcps1.3.3.3.2.2.4.1.1"><p id="EN-US_TOPIC_0167811964__p1167114242314">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.662466246624664%" id="mcps1.3.3.3.2.2.4.1.2"><p id="EN-US_TOPIC_0167811964__p20671142102319">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.04530453045304%" id="mcps1.3.3.3.2.2.4.1.3"><p id="EN-US_TOPIC_0167811964__p76717232317">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0167811964__row18202256172216"><td class="cellrowborder" valign="top" width="22.29222922292229%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0167811964__p19672182132316">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="24.662466246624664%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0167811964__p667219216234">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="53.04530453045304%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0167811964__p56729216231">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0167811964__row720211560228"><td class="cellrowborder" valign="top" width="22.29222922292229%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0167811964__p1267212211235">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="24.662466246624664%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0167811964__p1567218232313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="53.04530453045304%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0167811964__p267216216230">Specifies the <span id="EN-US_TOPIC_0167811964__text62271010103018">ECS</span> ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section1687010415429"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_p167514712466"><a href="#EN-US_TOPIC_0167811964__table105531424192318">Table 2</a> describes the request parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811964__table105531424192318"></a><a name="table105531424192318"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811964__table105531424192318" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0167811964__row14553162412314"><th align="left" class="cellrowborder" valign="top" width="17.18%" id="mcps1.3.4.3.2.5.1.1"><p id="EN-US_TOPIC_0167811964__p5598182842317">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.150000000000002%" id="mcps1.3.4.3.2.5.1.2"><p id="EN-US_TOPIC_0167811964__p105981628162319">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.53%" id="mcps1.3.4.3.2.5.1.3"><p id="EN-US_TOPIC_0167811964__p1759912288234">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.14%" id="mcps1.3.4.3.2.5.1.4"><p id="EN-US_TOPIC_0167811964__p10599628202313">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0167811964__row1455317242231"><td class="cellrowborder" valign="top" width="17.18%" headers="mcps1.3.4.3.2.5.1.1 "><p id="EN-US_TOPIC_0167811964__p1599102812237">tags</p>
</td>
<td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.3.4.3.2.5.1.2 "><p id="EN-US_TOPIC_0167811964__p185997282237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.53%" headers="mcps1.3.4.3.2.5.1.3 "><p id="EN-US_TOPIC_0167811964__p13599142817236">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="46.14%" headers="mcps1.3.4.3.2.5.1.4 "><p id="EN-US_TOPIC_0167811964__p459962815237">Specifies tags. For details, see <a href="#EN-US_TOPIC_0167811964__table6449181462417">Table 3</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0167811964__row655312432311"><td class="cellrowborder" valign="top" width="17.18%" headers="mcps1.3.4.3.2.5.1.1 "><p id="EN-US_TOPIC_0167811964__p95997288232">action</p>
</td>
<td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.3.4.3.2.5.1.2 "><p id="EN-US_TOPIC_0167811964__p1259942812234">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.53%" headers="mcps1.3.4.3.2.5.1.3 "><p id="EN-US_TOPIC_0167811964__p16599122812235">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.14%" headers="mcps1.3.4.3.2.5.1.4 "><p id="EN-US_TOPIC_0167811964__p659982818236">Specifies the operation. (Only lowercase letters are supported.) For example, <strong id="EN-US_TOPIC_0167811964__b842352706152944">delete</strong> indicates the deletion operation.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811964__table6449181462417"></a><a name="table6449181462417"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811964__table6449181462417" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0167811964__b1258162163911">tags</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0167811964__row344941418249"><th align="left" class="cellrowborder" valign="top" width="21.3%" id="mcps1.3.4.4.2.5.1.1"><p id="EN-US_TOPIC_0167811964__p858782215254">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.29%" id="mcps1.3.4.4.2.5.1.2"><p id="EN-US_TOPIC_0167811964__p15587182216255">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.650000000000002%" id="mcps1.3.4.4.2.5.1.3"><p id="EN-US_TOPIC_0167811964__p1758719224252">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.76%" id="mcps1.3.4.4.2.5.1.4"><p id="EN-US_TOPIC_0167811964__p1558717228253">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0167811964__row84508141245"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0167811964__p1058772216253">key</p>
</td>
<td class="cellrowborder" valign="top" width="18.29%" headers="mcps1.3.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0167811964__p16587142214258">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.3.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0167811964__p20587182213254">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.76%" headers="mcps1.3.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0167811964__p12587422102513">Specifies the tag key.</p>
<p id="EN-US_TOPIC_0167811964__p45871322102513">This field cannot be left blank.</p>
<p id="EN-US_TOPIC_0167811964__p558752212258">The tag key of an ECS must be unique.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0167811964__row74501414122419"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0167811964__p11587152292514">value</p>
</td>
<td class="cellrowborder" valign="top" width="18.29%" headers="mcps1.3.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0167811964__p25871522112519">No</p>
</td>
<td class="cellrowborder" valign="top" width="16.650000000000002%" headers="mcps1.3.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0167811964__p2058762215254">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.76%" headers="mcps1.3.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0167811964__p175871022142520">Specifies the tag value.</p>
<p id="EN-US_TOPIC_0167811964__p135879224252">This field can be left blank.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section272211306539"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_p182181933115316">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_section69241026145215"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0167811964__p1977392475218">Batch delete two pairs of tags from a specified ECS.</p>
<pre class="screen" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_screen1526653429">POST https://<em id="EN-US_TOPIC_0167811964__i7445521195218">{endpoint}</em>/v1/{project_id}/cloudservers/{server_id}/tags/action
{
"action": "delete",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__section14223193362118"><h4 class="sectiontitle">Example Response</h4><p id="EN-US_TOPIC_0167811964__p19823616211">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_en-us_topic_0092803065_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_en-us_topic_0092803065_en-us_topic_0020212692_p23670760">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_en-us_topic_0092803065_en-us_topic_0067161469_en-us_topic_0057973179_section23611955"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0167811964__en-us_topic_0096282702_p1221022995117">See <a href="en-us_topic_0022067717.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0108433461.html">Tag Management</a></div>
</div>
</div>