doc-exports/docs/css/api-ref/css_03_0081.html
Zheng, Xiu c8d7a6f7c1 CSS API 20230223 Version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Zheng, Xiu <zhengxiu@huawei.com>
Co-committed-by: Zheng, Xiu <zhengxiu@huawei.com>
2023-02-28 10:52:22 +00:00

181 lines
14 KiB
HTML

<a name="css_03_0081"></a><a name="css_03_0081"></a>
<h1 class="topictitle1">Adding or Deleting Cluster Tags in Batches</h1>
<div id="body1602483981348"><div class="section" id="css_03_0081__section1916116459357"><h4 class="sectiontitle">Function</h4><p id="css_03_0081__p1257212519351">This API is used to add or delete tags to or from a specified cluster in batches. Tag Management Service (TMS) uses this API to batch manage tags of a cluster. A cluster can have a maximum of 10 tags.</p>
<div class="note" id="css_03_0081__note3269142616529"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="css_03_0081__ul15874174655318"><li id="css_03_0081__li1187454613534">This API is an idempotent API. If the request body contains duplicate keys during tag creation, an error is reported.</li><li id="css_03_0081__li765134165611">When a tag is added:<ul id="css_03_0081__ul0388132014010"><li id="css_03_0081__li10388202018020">The key cannot be left blank or be an empty string. It cannot contain the following characters: Non-printable ASCII characters (0-31), =, *, &lt;, &gt;, \, ,, |, /, letters, digits, hyphens (-), and underscores (_).</li><li id="css_03_0081__li5668329687">The value cannot be left blank but can be an empty string. It cannot contain the following characters: Non-printable ASCII characters (0-31), =, *, &lt;, &gt;, \, ,, |, /, letters, digits, hyphens (-), and underscores (_).</li><li id="css_03_0081__li1946213221295">The key cannot be duplicate. If the key already exists in the database, the value will be overwritten.</li></ul>
</li><li id="css_03_0081__li168651940192713">When a tag is deleted:<ul id="css_03_0081__ul12420194392719"><li id="css_03_0081__li942018438277">If a to-be-deleted tag does not exist, the operation is considered successful by default. The value range of the tag character set is not verified.</li><li id="css_03_0081__li497045132716">The tag structure body cannot be missing, and the key cannot be left blank or be an empty string.</li></ul>
</li></ul>
</div></div>
<p id="css_03_0081__p16247841193712"></p>
</div>
<div class="section" id="css_03_0081__section17397120173712"><h4 class="sectiontitle">URI</h4><pre class="screen" id="css_03_0081__screen040172164815">POST /v1.0/{project_id}/css-cluster/{cluster_id}/tags/action</pre>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_03_0081__table2051364645814" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="css_03_0081__row1513164620582"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.5.1.1"><p id="css_03_0081__p10513184619585">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.04%" id="mcps1.3.3.2.5.1.2"><p id="css_03_0081__p65131346165815">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.88%" id="mcps1.3.3.2.5.1.3"><p id="css_03_0081__p165131466586">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.08%" id="mcps1.3.3.2.5.1.4"><p id="css_03_0081__p751310467588">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_03_0081__row20513746145810"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.1.1 "><p id="css_03_0081__p175131646165817">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="12.04%" headers="mcps1.3.3.2.5.1.2 "><p id="css_03_0081__p651410466581">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.88%" headers="mcps1.3.3.2.5.1.3 "><p id="css_03_0081__p115141546165810">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.08%" headers="mcps1.3.3.2.5.1.4 "><p id="css_03_0081__p251414460586">Project ID </p>
</td>
</tr>
<tr id="css_03_0081__row17514184616581"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.1.1 "><p id="css_03_0081__p751434620586">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="12.04%" headers="mcps1.3.3.2.5.1.2 "><p id="css_03_0081__p4514746115818">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.88%" headers="mcps1.3.3.2.5.1.3 "><p id="css_03_0081__p8514346125816">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.08%" headers="mcps1.3.3.2.5.1.4 "><p id="css_03_0081__p1451404617581">IDs of clusters to which tags are to be added or deleted in batches</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="css_03_0081__section6839100904"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_03_0081__table3416921183811" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="css_03_0081__row1968352183811"><th align="left" class="cellrowborder" valign="top" width="14.8985101489851%" id="mcps1.3.4.2.2.5.1.1"><p id="css_03_0081__p10683122123819">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.70872912708729%" id="mcps1.3.4.2.2.5.1.2"><p id="css_03_0081__p068352112383">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.538046195380463%" id="mcps1.3.4.2.2.5.1.3"><p id="css_03_0081__p126835217383">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.85471452854714%" id="mcps1.3.4.2.2.5.1.4"><p id="css_03_0081__p12684621203817">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_03_0081__row468472113382"><td class="cellrowborder" valign="top" width="14.8985101489851%" headers="mcps1.3.4.2.2.5.1.1 "><p id="css_03_0081__p146841221133818">tags</p>
</td>
<td class="cellrowborder" valign="top" width="12.70872912708729%" headers="mcps1.3.4.2.2.5.1.2 "><p id="css_03_0081__p4684162143813">No</p>
</td>
<td class="cellrowborder" valign="top" width="19.538046195380463%" headers="mcps1.3.4.2.2.5.1.3 "><p id="css_03_0081__p1368482133813">Array of <a href="#css_03_0081__table2440821133810">tag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="52.85471452854714%" headers="mcps1.3.4.2.2.5.1.4 "><p id="css_03_0081__p26842219386">Tag list</p>
</td>
</tr>
<tr id="css_03_0081__row668452116384"><td class="cellrowborder" valign="top" width="14.8985101489851%" headers="mcps1.3.4.2.2.5.1.1 "><p id="css_03_0081__p768417218389">action</p>
</td>
<td class="cellrowborder" valign="top" width="12.70872912708729%" headers="mcps1.3.4.2.2.5.1.2 "><p id="css_03_0081__p1668412115389">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.538046195380463%" headers="mcps1.3.4.2.2.5.1.3 "><p id="css_03_0081__p2068422118388">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.85471452854714%" headers="mcps1.3.4.2.2.5.1.4 "><p id="css_03_0081__p1268482183810">Operation to be performed. The value can be set to <strong id="css_03_0081__b208263225511250">create</strong> or <strong id="css_03_0081__b122462061711250">delete</strong> only.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="css_03_0081__table2440821133810"></a><a name="table2440821133810"></a><table cellpadding="4" cellspacing="0" summary="" id="css_03_0081__table2440821133810" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="css_03_0081__b4226174474017">resource_tag</strong> field description</caption><thead align="left"><tr id="css_03_0081__row56841321163811"><th align="left" class="cellrowborder" valign="top" width="14.758524147585241%" id="mcps1.3.4.3.2.5.1.1"><p id="css_03_0081__p368492111382">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.16828317168283%" id="mcps1.3.4.3.2.5.1.2"><p id="css_03_0081__p1168432133812">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.208479152084792%" id="mcps1.3.4.3.2.5.1.3"><p id="css_03_0081__p868422153820">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.86471352864714%" id="mcps1.3.4.3.2.5.1.4"><p id="css_03_0081__p96844217384">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_03_0081__row868402193815"><td class="cellrowborder" valign="top" width="14.758524147585241%" headers="mcps1.3.4.3.2.5.1.1 "><p id="css_03_0081__p13684202173812">key</p>
</td>
<td class="cellrowborder" valign="top" width="17.16828317168283%" headers="mcps1.3.4.3.2.5.1.2 "><p id="css_03_0081__p1268412143813">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.208479152084792%" headers="mcps1.3.4.3.2.5.1.3 "><p id="css_03_0081__p16851621143820">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.86471352864714%" headers="mcps1.3.4.3.2.5.1.4 "><p id="css_03_0081__p176851121143816">Tag key. The value can contain up to 36 characters.</p>
</td>
</tr>
<tr id="css_03_0081__row468512112385"><td class="cellrowborder" valign="top" width="14.758524147585241%" headers="mcps1.3.4.3.2.5.1.1 "><p id="css_03_0081__p16685182120384">value</p>
</td>
<td class="cellrowborder" valign="top" width="17.16828317168283%" headers="mcps1.3.4.3.2.5.1.2 "><p id="css_03_0081__p7685121133812">This parameter is mandatory when <strong id="css_03_0081__b019585534020">action</strong> is set to <strong id="css_03_0081__b1200105510406">create</strong> and optional when <strong id="css_03_0081__b148205839211250">action</strong> is set to <strong id="css_03_0081__b64993694511250">delete</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="15.208479152084792%" headers="mcps1.3.4.3.2.5.1.3 "><p id="css_03_0081__p968592116384">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.86471352864714%" headers="mcps1.3.4.3.2.5.1.4 "><p id="css_03_0081__p163215433176">Tag value. The value contains up to 43 characters.</p>
<p id="css_03_0081__p116851821153813">If <span class="parmname" id="css_03_0081__parmname108246677611250"><b>value</b></span> is not empty, delete tags by <span class="parmname" id="css_03_0081__parmname150552932911250"><b>key</b></span>/<span class="parmname" id="css_03_0081__parmname101498660911250"><b>value</b></span>. If <span class="parmname" id="css_03_0081__parmname112192562411250"><b>value</b></span> is empty, delete tags by <span class="parmname" id="css_03_0081__parmname188125054611250"><b>key</b></span>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="css_03_0081__section6439117506"><h4 class="sectiontitle">Response</h4><p id="css_03_0081__p5808131101">None</p>
</div>
<div class="section" id="css_03_0081__section9745102517013"><h4 class="sectiontitle">Example</h4><ul id="css_03_0081__ul196851021193811"><li id="css_03_0081__li568517212384">Example request</li></ul>
<pre class="screen" id="css_03_0081__screen1668552143817">POST /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/tags/action</pre>
<p id="css_03_0081__p1959081864716">This API is used to add tags in batches.</p>
<pre class="screen" id="css_03_0081__screen56855213385">{
"action": "create",
"tags": [
{
"key": "key1",
"value": "value1"
}
]
}</pre>
</div>
<div class="p" id="css_03_0081__p1236104317488">This API is used to delete tags in batches.<pre class="screen" id="css_03_0081__screen194482604510">{
"action": "delete",
"tags": [
{
"key": "key1"
}
]
}</pre>
</div>
<ul id="css_03_0081__ul54559111504"><li id="css_03_0081__li1045520115506">Response example<p id="css_03_0081__p17983152214532"><a name="css_03_0081__li1045520115506"></a><a name="li1045520115506"></a>None</p>
</li></ul>
<div class="section" id="css_03_0081__section453243119012"><h4 class="sectiontitle">Status Code</h4><p id="css_03_0081__p46921709171"><a href="#css_03_0081__table12321369178">Table 4</a> describes status codes.</p>
<div class="tablenoborder"><a name="css_03_0081__table12321369178"></a><a name="table12321369178"></a><table cellpadding="4" cellspacing="0" summary="" id="css_03_0081__table12321369178" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="css_03_0081__en-us_topic_0075288550_row1972183521418"><th align="left" class="cellrowborder" valign="top" width="33%" id="mcps1.3.9.3.2.4.1.1"><p id="css_03_0081__en-us_topic_0075288550_p14560134151414">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.51%" id="mcps1.3.9.3.2.4.1.2"><p id="css_03_0081__en-us_topic_0075288550_p5563194141411">Encoding</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.49%" id="mcps1.3.9.3.2.4.1.3"><p id="css_03_0081__en-us_topic_0075288550_p256616411143">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_03_0081__en-us_topic_0075288550_row129720356144"><td class="cellrowborder" valign="top" width="33%" headers="mcps1.3.9.3.2.4.1.1 "><p id="css_03_0081__en-us_topic_0075288550_p1957004131410">400</p>
</td>
<td class="cellrowborder" valign="top" width="24.51%" headers="mcps1.3.9.3.2.4.1.2 "><p id="css_03_0081__en-us_topic_0075288550_p165731141171419">BadRequest</p>
</td>
<td class="cellrowborder" valign="top" width="42.49%" headers="mcps1.3.9.3.2.4.1.3 "><p id="css_03_0081__en-us_topic_0075288550_p65778413148">Invalid request.</p>
<p id="css_03_0081__en-us_topic_0075288550_p1557974171415">Do not retry the request before modification.</p>
</td>
</tr>
<tr id="css_03_0081__en-us_topic_0075288550_row8972103517147"><td class="cellrowborder" valign="top" width="33%" headers="mcps1.3.9.3.2.4.1.1 "><p id="css_03_0081__en-us_topic_0075288550_p75841441191410">404</p>
</td>
<td class="cellrowborder" valign="top" width="24.51%" headers="mcps1.3.9.3.2.4.1.2 "><p id="css_03_0081__en-us_topic_0075288550_p258716416142">NotFound</p>
</td>
<td class="cellrowborder" valign="top" width="42.49%" headers="mcps1.3.9.3.2.4.1.3 "><p id="css_03_0081__en-us_topic_0075288550_p15589154118141">The requested resource cannot be found.</p>
<p id="css_03_0081__en-us_topic_0075288550_p14590164151410">Do not retry the request before modification.</p>
</td>
</tr>
<tr id="css_03_0081__en-us_topic_0075288550_row297223511416"><td class="cellrowborder" valign="top" width="33%" headers="mcps1.3.9.3.2.4.1.1 "><p id="css_03_0081__en-us_topic_0075288550_p13595164131416">204</p>
</td>
<td class="cellrowborder" valign="top" width="24.51%" headers="mcps1.3.9.3.2.4.1.2 "><p id="css_03_0081__en-us_topic_0075288550_p9598741131416">OK</p>
</td>
<td class="cellrowborder" valign="top" width="42.49%" headers="mcps1.3.9.3.2.4.1.3 "><p id="css_03_0081__en-us_topic_0075288550_p659994115146">The request is processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_03_0077.html">Tag Management APIs</a></div>
</div>
</div>