forked from docs/doc-exports
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Co-authored-by: Li, Qiao <qiaoli@huawei.com> Co-committed-by: Li, Qiao <qiaoli@huawei.com>
158 lines
13 KiB
HTML
158 lines
13 KiB
HTML
<a name="kms_02_0045"></a><a name="kms_02_0045"></a>
|
|
|
|
<h1 class="topictitle1">Adding or Deleting CMK Tags in Batches</h1>
|
|
<div id="body1521020894928"><div class="section" id="kms_02_0045__en-us_topic_0112992301_section19958056162916"><h4 class="sectiontitle">Function</h4><p id="kms_02_0045__en-us_topic_0112992301_p1418161123010">This API enables you to add or delete CMK tags in batches.</p>
|
|
</div>
|
|
<div class="section" id="kms_02_0045__en-us_topic_0112992301_section38441247183015"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0045__en-us_topic_0112992301_ul97111083113"><li id="kms_02_0045__en-us_topic_0112992301_li17711180123120">URI format<p id="kms_02_0045__en-us_topic_0112992301_p47489132318"><a name="kms_02_0045__en-us_topic_0112992301_li17711180123120"></a><a name="en-us_topic_0112992301_li17711180123120"></a>POST /v1.0/{project_id}/kms/{key_id}/tags/action</p>
|
|
</li><li id="kms_02_0045__en-us_topic_0112992301_li187371916153116">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0045__en-us_topic_0112992301_table040511290318" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0045__en-us_topic_0112992301_row1340502913116"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="kms_02_0045__en-us_topic_0112992301_p1577110425210"><strong id="kms_02_0045__en-us_topic_0112992301_b842352706202545">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="kms_02_0045__en-us_topic_0112992301_p167751142326">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="kms_02_0045__en-us_topic_0112992301_p157711420214">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="kms_02_0045__en-us_topic_0112992301_p1877644212217">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0045__en-us_topic_0112992301_row1440562943115"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p72101340183118">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p16210164083114">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p0266239291">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="kms_02_0045__en-us_topic_0112992301_p32105405312">Project ID</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="kms_02_0045__en-us_topic_0112992301_row1405429123118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p122110409319">key_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p1021115409312">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p1926983917917">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="kms_02_0045__en-us_topic_0112992301_p16211140183113">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0045__en-us_topic_0112992301_parmvalue80435593163333"><b>^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$</b></span></p>
|
|
<p id="kms_02_0045__en-us_topic_0112992301_p2211114018310">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="kms_02_0045__en-us_topic_0112992301_section7153105111310"><h4 class="sectiontitle">Requests</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0045__en-us_topic_0112992301_table3249442123412" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0045__en-us_topic_0112992301_row132496420340"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0045__en-us_topic_0112992301_p558017281137"><strong id="kms_02_0045__en-us_topic_0112992301_b1798779780">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.2.5.1.2"><p id="kms_02_0045__en-us_topic_0112992301_p158022817315">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.3"><p id="kms_02_0045__en-us_topic_0112992301_p195801328635">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.5.1.4"><p id="kms_02_0045__en-us_topic_0112992301_p13580928534">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0045__en-us_topic_0112992301_row15249942133415"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p924914220342">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p52498427345">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p12249242203419">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><div class="p" id="kms_02_0045__en-us_topic_0112992301_p5135135794311">list of tags, including tag keys and tag values.<ul id="kms_02_0045__en-us_topic_0112992301_ul17835144253711"><li id="kms_02_0045__en-us_topic_0112992301_li883514219377"><strong id="kms_02_0045__en-us_topic_0112992301_b842352706165737">key</strong> indicates the tag key. A CMK can have a maximum of 10 keys, and each of them is unique and cannot be empty. A key cannot have duplicate values. The value of <strong id="kms_02_0045__en-us_topic_0112992301_b842352706165433">key</strong> contains a maximum of 36 characters.</li><li id="kms_02_0045__en-us_topic_0112992301_li6835144219377"><strong id="kms_02_0045__en-us_topic_0112992301_b842352706165447">value</strong> indicates the tag value. Each tag value can contain a maximum of 43 characters. The relationship between values is <strong id="kms_02_0045__en-us_topic_0112992301_b842352706165526">AND</strong>.</li></ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="kms_02_0045__en-us_topic_0112992301_row152491442143420"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p6249184263419">action</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p142499423347">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p18169242499">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0045__en-us_topic_0112992301_p17339133112203">Operation ID.</p>
|
|
<p id="kms_02_0045__en-us_topic_0112992301_p20249042163413">The value can be <strong id="kms_02_0045__en-us_topic_0112992301_b842352706101829">create</strong> or <strong id="kms_02_0045__en-us_topic_0112992301_b842352706101833">delete</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="kms_02_0045__en-us_topic_0112992301_row1249134213412"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p19249204213342">sequence</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p15249114243411">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p1217464214918">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0045__en-us_topic_0112992301_p52491442123410">36-byte serial number of a request message</p>
|
|
<p id="kms_02_0045__en-us_topic_0112992301_p1249124213345">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="kms_02_0045__en-us_topic_0112992301_section0907192213412"><h4 class="sectiontitle">Responses</h4><p id="kms_02_0045__en-us_topic_0112992301_p2293242895945">None</p>
|
|
</div>
|
|
<div class="section" id="kms_02_0045__en-us_topic_0112992301_section207874128353"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0045__en-us_topic_0112992301_p1962111613356">The following example describes how to add tags, the keys and values of which are <span class="parmvalue" id="kms_02_0045__en-us_topic_0112992301_parmvalue145648574020467"><b>key1</b></span>, <span class="parmvalue" id="kms_02_0045__en-us_topic_0112992301_parmvalue198635389610311"><b>key</b></span>, <span class="parmvalue" id="kms_02_0045__en-us_topic_0112992301_parmvalue2018002147103111"><b>value1</b></span>, and <span class="parmvalue" id="kms_02_0045__en-us_topic_0112992301_parmvalue1599268364204613"><b>value3</b></span> respectively.</p>
|
|
<ul id="kms_02_0045__en-us_topic_0112992301_ul192061615184519"><li id="kms_02_0045__en-us_topic_0112992301_li14206615164510">Example request<pre class="screen" id="kms_02_0045__en-us_topic_0112992301_screen172061415164518">{
|
|
"action": "create",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key",
|
|
"value": "value3"
|
|
}
|
|
]
|
|
}</pre>
|
|
<div class="p" id="kms_02_0045__en-us_topic_0112992301_p10131854516">or<pre class="screen" id="kms_02_0045__en-us_topic_0112992301_screen6206315164510">{
|
|
"action": "delete",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value3"
|
|
}
|
|
]
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<ul id="kms_02_0045__en-us_topic_0112992301_ul920681524518"><li id="kms_02_0045__en-us_topic_0112992301_li2206151554518">Example response<pre class="screen" id="kms_02_0045__en-us_topic_0112992301_screen4043675095957">{
|
|
}</pre>
|
|
<div class="p" id="kms_02_0045__en-us_topic_0112992301_p2838643195957">or<pre class="screen" id="kms_02_0045__en-us_topic_0112992301_screen1784255143113">{
|
|
"error": {
|
|
"error_code": "KMS.XXXX",
|
|
"error_msg": "XXX"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
<div class="section" id="kms_02_0045__en-us_topic_0112992301_section188513533011"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0045__en-us_topic_0112992301_p58851531304"><a href="#kms_02_0045__en-us_topic_0112992301_table3885195311010">Table 3</a> lists the normal status code returned by the response.
|
|
<div class="tablenoborder"><a name="kms_02_0045__en-us_topic_0112992301_table3885195311010"></a><a name="en-us_topic_0112992301_table3885195311010"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0045__en-us_topic_0112992301_table3885195311010" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Status codes</caption><thead align="left"><tr id="kms_02_0045__en-us_topic_0112992301_row08858533011"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.7.2.2.2.4.1.1"><p id="kms_02_0045__en-us_topic_0112992301_p18885105310016">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="32%" id="mcps1.3.7.2.2.2.4.1.2"><p id="kms_02_0045__en-us_topic_0112992301_p488513536011">Status</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="46%" id="mcps1.3.7.2.2.2.4.1.3"><p id="kms_02_0045__en-us_topic_0112992301_p188852531708">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0045__en-us_topic_0112992301_row6885125316018"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.7.2.2.2.4.1.1 "><p id="kms_02_0045__en-us_topic_0112992301_p188851853102">204</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.7.2.2.2.4.1.2 "><p id="kms_02_0045__en-us_topic_0112992301_p2123920113816">No Content</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.7.2.2.2.4.1.3 "><p id="kms_02_0045__en-us_topic_0112992301_p151239205384">The request is processed successfully and no content is returned.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="kms_02_0045__en-us_topic_0112992301_p1288512533020">Exception status code. For details, see <a href="kms_02_0301.html#kms_02_0301">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="kms_02_0011.html">CMK Management</a></div>
|
|
</div>
|
|
</div>
|
|
|