forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com> Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
192 lines
14 KiB
HTML
192 lines
14 KiB
HTML
<a name="sdrs_05_0802"></a><a name="sdrs_05_0802"></a>
|
|
|
|
<h1 class="topictitle1">Adding Protected Instance Tags in Batches</h1>
|
|
<div id="body1548216603525"><div class="section" id="sdrs_05_0802__section11743182514464"><h4 class="sectiontitle">Function</h4><p id="sdrs_05_0802__p15988152594618">This API is used to add protected instance tags for a specified protected instance in batches.</p>
|
|
<p id="sdrs_05_0802__p1198814253468">You can add a maximum of 20 tags to a protected instance.</p>
|
|
<p id="sdrs_05_0802__p189881625144619">This API is idempotent.</p>
|
|
<ul id="sdrs_05_0802__ul14988122513468"><li id="sdrs_05_0802__li498862519464">If there are duplicate keys in the request body when you add tags, an error is reported.</li><li id="sdrs_05_0802__li12988102524616">During tag creation, duplicate keys are not allowed. If a key exists in the database, its value will be overwritten.</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0802__section1775552564615"><h4 class="sectiontitle">URI</h4><ul id="sdrs_05_0802__ul1098816254461"><li id="sdrs_05_0802__li13988142514461">URI format<p id="sdrs_05_0802__p1598816252466"><a name="sdrs_05_0802__li13988142514461"></a><a name="li13988142514461"></a>POST /v1/{project_id}/protected-instances/{protected_instance_id}/tags/action</p>
|
|
</li></ul>
|
|
<ul id="sdrs_05_0802__ul998852511468"><li id="sdrs_05_0802__li12988525194610">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0802__table14756192511463" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0802__row189891125114611"><th align="left" class="cellrowborder" valign="top" width="19.39%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="sdrs_05_0802__p9989625134619"><strong id="sdrs_05_0802__b842352706162023">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.47%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="sdrs_05_0802__p199892258468"><strong id="sdrs_05_0802__b84235270615447">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.24%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="sdrs_05_0802__p298916253464"><strong id="sdrs_05_0802__b84235270615453">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="44.9%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="sdrs_05_0802__p8989225134620"><strong id="sdrs_05_0802__b84235270615457">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0802__row998942594616"><td class="cellrowborder" valign="top" width="19.39%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="sdrs_05_0802__p198982554613">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="sdrs_05_0802__p1298915253466">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="sdrs_05_0802__p898962594617">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.9%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="sdrs_05_0802__p398915254462">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row13989162512469"><td class="cellrowborder" valign="top" width="19.39%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="sdrs_05_0802__p89891925134615">protected_instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="sdrs_05_0802__p20989152518462">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="sdrs_05_0802__p10989102518465">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.9%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="sdrs_05_0802__p1798962564612">Specifies the ID of a protected instance.</p>
|
|
<p id="sdrs_05_0802__p167524401505">For details, see <a href="sdrs_05_0503.html">Querying Protected Instances</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0802__section1877562518469"><h4 class="sectiontitle">Request</h4><ul id="sdrs_05_0802__ul998932544619"><li id="sdrs_05_0802__li1989192594612">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0802__table0779825104611" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0802__row798917257464"><th align="left" class="cellrowborder" valign="top" width="12.12121212121212%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="sdrs_05_0802__p10989112574616"><strong id="sdrs_05_0802__b1315452426">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.2020202020202%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="sdrs_05_0802__p13989102564611"><strong id="sdrs_05_0802__b62886448">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25.25252525252525%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="sdrs_05_0802__p2989162513468"><strong id="sdrs_05_0802__b291522611">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.42424242424242%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="sdrs_05_0802__p2098952584613"><strong id="sdrs_05_0802__b368348528">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0802__row9989725114615"><td class="cellrowborder" valign="top" width="12.12121212121212%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="sdrs_05_0802__p698952514619">action</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.2020202020202%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="sdrs_05_0802__p14989152514460">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.25252525252525%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="sdrs_05_0802__p1598982514461">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.42424242424242%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="sdrs_05_0802__p134981385164">Identifies the operation. The value can be <strong id="sdrs_05_0802__b842352706112823">create</strong> or <strong id="sdrs_05_0802__b842352706112836">delete</strong>.</p>
|
|
<ul id="sdrs_05_0802__ul1313055620166"><li id="sdrs_05_0802__li313075611610"><strong id="sdrs_05_0802__b842352706104918">create</strong>: indicates to create a tag.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row1255715497467"><td class="cellrowborder" valign="top" width="12.12121212121212%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="sdrs_05_0802__p2098952554610">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.2020202020202%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="sdrs_05_0802__p15989325194612">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.25252525252525%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="sdrs_05_0802__p18989825144619">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.42424242424242%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="sdrs_05_0802__p199891025184612">Specifies the tag list.</p>
|
|
<p id="sdrs_05_0802__p5238016101319">For details, see <a href="#sdrs_05_0802__table6785202564616">Table 1</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="sdrs_05_0802__table6785202564616"></a><a name="table6785202564616"></a><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0802__table6785202564616" frame="border" border="1" rules="all"><caption><b>Table 1 </b><strong id="sdrs_05_0802__b124214262920">resource_tag</strong> field description</caption><thead align="left"><tr id="sdrs_05_0802__row8989112518468"><th align="left" class="cellrowborder" valign="top" width="11%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="sdrs_05_0802__p3989152544617"><strong id="sdrs_05_0802__b907551064">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="34%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="sdrs_05_0802__p69891253464"><strong id="sdrs_05_0802__b2065941605">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="sdrs_05_0802__p1298910251462"><strong id="sdrs_05_0802__b1370914262">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="sdrs_05_0802__p1798918259466"><strong id="sdrs_05_0802__b270133133">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0802__row1998918251468"><td class="cellrowborder" valign="top" width="11%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="sdrs_05_0802__p16989225134616">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="sdrs_05_0802__p16989122518462">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="sdrs_05_0802__p0989102514466">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="sdrs_05_0802__p20255101518620">Specifies the tag key. The tag key of a resource must be unique.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row1399152510466"><td class="cellrowborder" valign="top" width="11%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="sdrs_05_0802__p17991725204610">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="sdrs_05_0802__p199162504610">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="sdrs_05_0802__p899142564618">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="sdrs_05_0802__p14973122115616">Specifies the tag value.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="sdrs_05_0802__ul399192514463"><li id="sdrs_05_0802__li19919255464">Example request<div class="p" id="sdrs_05_0802__p1113681715211"><a name="sdrs_05_0802__li19919255464"></a><a name="li19919255464"></a>POST https://{Endpoint}/v1/{project_id}/protected-instances/67a2cc7e-fb87-41a8-ba28-9c032abcaee1/tags/action<pre class="screen" id="sdrs_05_0802__screen10267141212525">{
|
|
"action": "create",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key",
|
|
"value": "value3"
|
|
}
|
|
]
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0802__section58051725144613"><h4 class="sectiontitle">Response</h4><ul id="sdrs_05_0802__ul1899117256462"><li id="sdrs_05_0802__li11991142514620">Parameter description<p id="sdrs_05_0802__p1999152519467"><a name="sdrs_05_0802__li11991142514620"></a><a name="li11991142514620"></a>None</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0802__section4805102564610"><h4 class="sectiontitle"><strong id="sdrs_05_0802__b842352706175024">Returned Value</strong></h4><ul id="sdrs_05_0802__ul1099142594620"><li id="sdrs_05_0802__li149914259469">Normal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0802__table1380817254462" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0802__row10991425114619"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.2.1.1.1.3.1.1"><p id="sdrs_05_0802__p1199113253468"><strong id="sdrs_05_0802__b2056502621">Returned Value</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.5.2.1.1.1.3.1.2"><p id="sdrs_05_0802__p39911625134616"><strong id="sdrs_05_0802__b1843845969">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0802__row1099111252461"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.1.1.1.3.1.1 "><p id="sdrs_05_0802__p12991162510464">204</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.1.1.1.3.1.2 "><p id="sdrs_05_0802__p1299152510469">No Content</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="sdrs_05_0802__ul4991202534615"><li id="sdrs_05_0802__li0991112544611">Abnormal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0802__table19809152512466" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0802__row99913253465"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.3.1.1.1.3.1.1"><p id="sdrs_05_0802__p1699162564617"><strong id="sdrs_05_0802__b1409761197">Returned Value</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.5.3.1.1.1.3.1.2"><p id="sdrs_05_0802__p09911125194610"><strong id="sdrs_05_0802__b1257026712">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0802__row18991925164617"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0802__p7991225144614">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.3.1.1.1.3.1.2 "><p id="sdrs_05_0802__p199192514463">Invalid parameters.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row1799162534618"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0802__p9991725124620">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.3.1.1.1.3.1.2 "><p id="sdrs_05_0802__p119911825194616">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row10991132515466"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0802__p9991122514466">403</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.3.1.1.1.3.1.2 "><p id="sdrs_05_0802__p20991152574610">Insufficient permission.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row19911251467"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0802__p79918251467">404</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.3.1.1.1.3.1.2 "><p id="sdrs_05_0802__p6991172504612">The requested resource was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0802__row199142515468"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0802__p49911425194615">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.3.1.1.1.3.1.2 "><p id="sdrs_05_0802__p1299192504619">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="sdrs_05_0800.html">Tag Management</a></div>
|
|
</div>
|
|
</div>
|
|
|