Files
doc-exports/docs/dws/api-ref/dws_02_0047.html
luhuayi fd5ee5dcd8 DWS API 20250722 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-07-30 14:29:39 +00:00

185 lines
14 KiB
HTML

<a name="EN-US_TOPIC_0000002395171013"></a><a name="EN-US_TOPIC_0000002395171013"></a>
<h1 class="topictitle1">Adding Tags in Batches</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000002395171013__section1171982317298"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002395171013__p18719142392919">This API is used to add tags to a cluster in batches.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section20720182312917"><h4 class="sectiontitle">URI</h4><pre class="screen" id="EN-US_TOPIC_0000002395171013__screen727565733213">POST /v1.0/{project_id}/clusters/{cluster_id}/tags/batch-create</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002395171013__table117201237295" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002395171013__row1472019231292"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="EN-US_TOPIC_0000002395171013__p15720172372918">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="EN-US_TOPIC_0000002395171013__p172014237298">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="EN-US_TOPIC_0000002395171013__p1972172310294">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="EN-US_TOPIC_0000002395171013__p67211623192920">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002395171013__row12720132312911"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002395171013__p1372152315290">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002395171013__p1972111233296">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002395171013__p17721123202915">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002395171013__p177211723112913"><strong id="EN-US_TOPIC_0000002395171013__b199829640942519">Definition</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p107211723152913">Project ID. To obtain the value, see <a href="dws_02_0011.html">Obtaining a Project ID</a>.</p>
<p id="EN-US_TOPIC_0000002395171013__p16721423132914"><strong id="EN-US_TOPIC_0000002395171013__b137892621242516">Constraints</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1472152392912">N/A</p>
<p id="EN-US_TOPIC_0000002395171013__p1672132315292"><strong id="EN-US_TOPIC_0000002395171013__b134074612042521">Range</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p3721112314298">N/A</p>
<p id="EN-US_TOPIC_0000002395171013__p1872111234291"><strong id="EN-US_TOPIC_0000002395171013__b88137136642525">Default Value</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1721123112911">N/A</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row972010231296"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002395171013__p672118236297">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002395171013__p072122372918">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002395171013__p14721132318299">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002395171013__p272215232292"><strong id="EN-US_TOPIC_0000002395171013__b68078124142519">Definition</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1772262312912">Cluster ID. To obtain the value, see <a href="dws_02_00068.html">Obtaining the Cluster ID</a>.</p>
<p id="EN-US_TOPIC_0000002395171013__p14722102310293"><strong id="EN-US_TOPIC_0000002395171013__b19566463142516">Constraints</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p117221423182913">N/A</p>
<p id="EN-US_TOPIC_0000002395171013__p1372216235299"><strong id="EN-US_TOPIC_0000002395171013__b71913727042521">Range</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1572202316293">N/A</p>
<p id="EN-US_TOPIC_0000002395171013__p37226234291"><strong id="EN-US_TOPIC_0000002395171013__b144356022542525">Default Value</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p0722142314295">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section17722112392912"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002395171013__en-us_topic_0000002374985921_en-us_topic_0000002374724813_request_BatchCreateResourceTags" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002395171013__row8722223162911"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000002395171013__p9722102332911">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000002395171013__p10722023182916">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000002395171013__p172218238299">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000002395171013__p107235232298">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002395171013__row572282302915"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000002395171013__p77231923172911">tags</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000002395171013__p172382312917">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000002395171013__p1672382382918">Array of <a href="#EN-US_TOPIC_0000002395171013__en-us_topic_0000002374985921_en-us_topic_0000002374724813_request_BatchCreateResourceTag">BatchCreateResourceTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000002395171013__p97231723202920">Tag list.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002395171013__en-us_topic_0000002374985921_en-us_topic_0000002374724813_request_BatchCreateResourceTag"></a><a name="en-us_topic_0000002374985921_en-us_topic_0000002374724813_request_BatchCreateResourceTag"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002395171013__en-us_topic_0000002374985921_en-us_topic_0000002374724813_request_BatchCreateResourceTag" frame="border" border="1" rules="all"><caption><b>Table 3 </b>BatchCreateResourceTag</caption><thead align="left"><tr id="EN-US_TOPIC_0000002395171013__row1172392332916"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="EN-US_TOPIC_0000002395171013__p2723182392917">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="EN-US_TOPIC_0000002395171013__p1472313233293">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="EN-US_TOPIC_0000002395171013__p37231423152913">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="EN-US_TOPIC_0000002395171013__p5723172319297">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002395171013__row8723723172911"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002395171013__p87241323122916">key</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002395171013__p12724423172915">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002395171013__p472442362911">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002395171013__p14724132392916"><strong id="EN-US_TOPIC_0000002395171013__b6749814642519">Definition</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p8724132362914">Tag key.</p>
<p id="EN-US_TOPIC_0000002395171013__p14724112311290"><strong id="EN-US_TOPIC_0000002395171013__b97595338042521">Range</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1772402310299">N/A</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row572302312299"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002395171013__p2724192362910">value</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002395171013__p167241423102911">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002395171013__p16724142315290">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002395171013__p5724142362911"><strong id="EN-US_TOPIC_0000002395171013__b35876245942519">Definition</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1472432382919">Tag value.</p>
<p id="EN-US_TOPIC_0000002395171013__p11724122319292"><strong id="EN-US_TOPIC_0000002395171013__b57463846642521">Range</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p1172492311299">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section9724023202915"><h4 class="sectiontitle">Response Parameters</h4><p id="EN-US_TOPIC_0000002395171013__p137249232296"><strong id="EN-US_TOPIC_0000002395171013__b174300468842531">Status code: 200</strong></p>
<p id="EN-US_TOPIC_0000002395171013__p672419236296">Tags are added in batches.</p>
<p id="EN-US_TOPIC_0000002395171013__p12724152342915">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section172412372910"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0000002395171013__p1572432312295">Add tags whose key is <strong id="EN-US_TOPIC_0000002395171013__b188641844113111">key</strong> and value is <strong id="EN-US_TOPIC_0000002395171013__b9864124415311">value</strong> in batches.</p>
<pre class="screen" id="EN-US_TOPIC_0000002395171013__screen137252237298">POST https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/b5c45780-1006-49e3-b2d5-b3229975bbc7/tags/batch-create
{
"tags" : [ {
"key" : "key",
"value" : "value"
} ]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section272572311291"><h4 class="sectiontitle">Example Responses</h4><p id="EN-US_TOPIC_0000002395171013__p1272592318299">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002395171013__section20840723172916"><h4 class="sectiontitle">Status Code</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002395171013__en-us_topic_0000002374985921_en-us_topic_0000002374724813_status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002395171013__row17731182316294"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="EN-US_TOPIC_0000002395171013__p98400231297">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="EN-US_TOPIC_0000002395171013__p1584022320293">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002395171013__row1873162342918"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p8840162319296">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p198403236296">Tags are added in batches.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row7731172311297"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p16840122382910">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p15840152318295">Request error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row87311623182911"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p884092312914">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p1184010237294">Authorization failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row1731122372920"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p198402023122916">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p7840102311299">No operation permission.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row1173132319296"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p16840172316293">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p18840102322917">No resources found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row2073162392913"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p784014238297">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p148401223192910">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002395171013__row87314234298"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002395171013__p16840102319297">503</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002395171013__p138403234299">Service unavailable.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_02_0045.html">Tag Management</a></div>
</div>
</div>