forked from laiweijian4/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>
173 lines
12 KiB
HTML
173 lines
12 KiB
HTML
<a name="sdrs_05_0803"></a><a name="sdrs_05_0803"></a>
|
|
|
|
<h1 class="topictitle1">Adding a Protected Instance Tag</h1>
|
|
<div id="body1548216603525"><div class="section" id="sdrs_05_0803__section156711130476"><h4 class="sectiontitle">Function</h4><p id="sdrs_05_0803__p48411324717">You can add a maximum of 20 tags to a protected instance.</p>
|
|
<p id="sdrs_05_0803__p78416314718">This API is idempotent.</p>
|
|
<p id="sdrs_05_0803__p19841635476">If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.</p>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0803__section196717394711"><h4 class="sectiontitle">URI</h4><ul id="sdrs_05_0803__ul118411136474"><li id="sdrs_05_0803__li1784153104717">URI format<p id="sdrs_05_0803__p1484119311474"><a name="sdrs_05_0803__li1784153104717"></a><a name="li1784153104717"></a>POST /v1/{project_id}/protected-instances/{protected_instance_id}/tags</p>
|
|
</li><li id="sdrs_05_0803__li198414384716">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0803__table9673183114717" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0803__row684110384719"><th align="left" class="cellrowborder" valign="top" width="20.41%" id="mcps1.3.2.2.2.1.1.5.1.1"><p id="sdrs_05_0803__p198411438476"><strong id="sdrs_05_0803__b842352706162023">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.490000000000002%" id="mcps1.3.2.2.2.1.1.5.1.2"><p id="sdrs_05_0803__p684113154719"><strong id="sdrs_05_0803__b84235270615447">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.24%" id="mcps1.3.2.2.2.1.1.5.1.3"><p id="sdrs_05_0803__p2841183164713"><strong id="sdrs_05_0803__b84235270615453">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.86%" id="mcps1.3.2.2.2.1.1.5.1.4"><p id="sdrs_05_0803__p2084114334716"><strong id="sdrs_05_0803__b84235270615457">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0803__row15841133194710"><td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="sdrs_05_0803__p584118334716">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="sdrs_05_0803__p58410374720">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="sdrs_05_0803__p168417310472">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="sdrs_05_0803__p5841143134717">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row784114310474"><td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="sdrs_05_0803__p684219394716">protected_instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="sdrs_05_0803__p13842153184713">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="sdrs_05_0803__p18421933474">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="sdrs_05_0803__p68426318470">Specifies the ID of a protected instance.</p>
|
|
<p id="sdrs_05_0803__p1288981015716">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_0803__section11681936470"><h4 class="sectiontitle">Request</h4><ul id="sdrs_05_0803__ul198426312470"><li id="sdrs_05_0803__li38422030472">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0803__table1868414316477" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0803__row084203134717"><th align="left" class="cellrowborder" valign="top" width="10.31%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="sdrs_05_0803__p684215334712"><strong id="sdrs_05_0803__b818188931">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.65%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="sdrs_05_0803__p3842239473"><strong id="sdrs_05_0803__b388932829">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.4%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="sdrs_05_0803__p138426324720"><strong id="sdrs_05_0803__b380496678">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.64%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="sdrs_05_0803__p1884212320477"><strong id="sdrs_05_0803__b2111934147">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0803__row7842113194717"><td class="cellrowborder" valign="top" width="10.31%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="sdrs_05_0803__p16842193134720">tag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.65%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="sdrs_05_0803__p188421364714">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.4%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="sdrs_05_0803__p48421439473">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.64%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="sdrs_05_0803__p98428394716">Specifies the tag to be added.</p>
|
|
<p id="sdrs_05_0803__p105811647181312">For details, see <a href="#sdrs_05_0803__table1569003154718">Table 1</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="sdrs_05_0803__table1569003154718"></a><a name="table1569003154718"></a><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0803__table1569003154718" frame="border" border="1" rules="all"><caption><b>Table 1 </b><strong id="sdrs_05_0803__b15996192714111">tag</strong> field description</caption><thead align="left"><tr id="sdrs_05_0803__row13842636476"><th align="left" class="cellrowborder" valign="top" width="10.2%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="sdrs_05_0803__p1584214311477"><strong id="sdrs_05_0803__b209374686">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.45%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="sdrs_05_0803__p684214314714"><strong id="sdrs_05_0803__b632102689">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.270000000000001%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="sdrs_05_0803__p10842123134718"><strong id="sdrs_05_0803__b544648277">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.08%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="sdrs_05_0803__p38427317473"><strong id="sdrs_05_0803__b1429312309">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0803__row1584218314471"><td class="cellrowborder" valign="top" width="10.2%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="sdrs_05_0803__p6842732471">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.45%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="sdrs_05_0803__p384363164719">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="sdrs_05_0803__p68431334478">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.08%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="sdrs_05_0803__p1333413193">Specifies the tag key. The tag key of a resource must be unique.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row5843338477"><td class="cellrowborder" valign="top" width="10.2%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="sdrs_05_0803__p884315311475">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.45%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="sdrs_05_0803__p5843932476">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.270000000000001%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="sdrs_05_0803__p1784312334715">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.08%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="sdrs_05_0803__p2703810913">Specifies the tag value.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="sdrs_05_0803__ul884363174714"><li id="sdrs_05_0803__li784312394716">Example request<div class="p" id="sdrs_05_0803__p1791153175918"><a name="sdrs_05_0803__li784312394716"></a><a name="li784312394716"></a>POST https://{Endpoint}/v1/{project_id}/protected-instances/67a2cc7e-fb87-41a8-ba28-9c032abcaee1/tags<pre class="screen" id="sdrs_05_0803__screen609293599">{
|
|
"tag": {
|
|
"key": "DEV",
|
|
"value": "DEV1"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0803__section8560173116203"><h4 class="sectiontitle">Response</h4><ul id="sdrs_05_0803__ul472037172318"><li id="sdrs_05_0803__li14783720232">Example response<p id="sdrs_05_0803__p196054415247"><a name="sdrs_05_0803__li14783720232"></a><a name="li14783720232"></a>None</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="sdrs_05_0803__section12705237478"><h4 class="sectiontitle"><strong id="sdrs_05_0803__b842352706175024">Returned Value</strong></h4><ul id="sdrs_05_0803__ul68435314720"><li id="sdrs_05_0803__li188431231472">Normal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0803__table14707131479" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0803__row2084313164712"><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_0803__p184453104711"><strong id="sdrs_05_0803__b249388803">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_0803__p98441039474"><strong id="sdrs_05_0803__b846009528">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0803__row1884418312473"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.1.1.1.3.1.1 "><p id="sdrs_05_0803__p20844638476">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_0803__p13844334479">No Content</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="sdrs_05_0803__ul584483174717"><li id="sdrs_05_0803__li384403114712">Abnormal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sdrs_05_0803__table127107354710" frame="border" border="1" rules="all"><thead align="left"><tr id="sdrs_05_0803__row168447364714"><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_0803__p108447316477"><strong id="sdrs_05_0803__b651153558">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_0803__p1884419394717"><strong id="sdrs_05_0803__b1940785264">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="sdrs_05_0803__row2084415320479"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0803__p58444364717">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_0803__p148441533470">Invalid parameters.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row5844183114718"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0803__p384418314475">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_0803__p1684413310472">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row38443316475"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0803__p12844431478">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_0803__p188442313474">Insufficient permission.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row184423204712"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0803__p2084410316474">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_0803__p108447384710">The requested resource was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="sdrs_05_0803__row48447318472"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.3.1.1.1.3.1.1 "><p id="sdrs_05_0803__p3845639471">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_0803__p1584518354710">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>
|
|
|