forked from docs/doc-exports
Reviewed-by: Muller, Martin <martin.muller@t-systems.com> Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
161 lines
12 KiB
HTML
161 lines
12 KiB
HTML
<a name="evs_04_2036"></a><a name="evs_04_2036"></a>
|
|
|
|
<h1 class="topictitle1">Adding or Updating Tags for an EVS Resource (Deprecated)</h1>
|
|
<div id="body1501053401641"><div class="section" id="evs_04_2036__section17386310104128"><h4 class="sectiontitle">Function</h4><p id="evs_04_2036__p33047202151923">This API is used to add or update tags for an EVS resource.</p>
|
|
<div class="notice" id="evs_04_2036__note182951651102614"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="evs_04_2036__p29514165276">This API has been deprecated. Use another API. For details, see <a href="evs_04_3011.html">Batch Adding Tags for the Specified EVS Disk</a>.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="evs_04_2036__section58153866104128"><h4 class="sectiontitle">Constraints</h4><ul id="evs_04_2036__ul532574125517"><li id="evs_04_2036__li17231162092">A tag is composed of a key-value pair.<ul id="evs_04_2036__ul122415167919"><li id="evs_04_2036__li812515558919">Key:<ul id="evs_04_2036__ul10797172141011"><li id="evs_04_2036__li5265857497">Must be unique for each resource.</li><li id="evs_04_2036__li101753591999">Can contain a maximum of 36 characters.</li><li id="evs_04_2036__li62561612913">Can contain only digits, letters, hyphens (-), and underscores (_).</li></ul>
|
|
</li><li id="evs_04_2036__li1465414388108">Value:<ul id="evs_04_2036__ul16158406109"><li id="evs_04_2036__li7306115011101">Can contain a maximum of 43 characters.</li><li id="evs_04_2036__li826416293">Can contain only digits, letters, hyphens (-), and underscores (_).</li></ul>
|
|
</li></ul>
|
|
</li></ul>
|
|
<ul id="evs_04_2036__ul39193963153533"><li id="evs_04_2036__li67093010153619">A maximum of 10 tags can be created for an EVS resource.</li></ul>
|
|
</div>
|
|
<div class="section" id="evs_04_2036__section48475837104128"><h4 class="sectiontitle">URI</h4><ul id="evs_04_2036__ul34228737104128"><li id="evs_04_2036__li39623177104128">URI format<p id="evs_04_2036__p53776742152018"><a name="evs_04_2036__li39623177104128"></a><a name="li39623177104128"></a>POST /v2/{project_id}/os-vendor-tags/{resource_type}/{resource_id}</p>
|
|
</li><li id="evs_04_2036__li55360764104128">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="evs_04_2036__table28484833104128" frame="border" border="1" rules="all"><thead align="left"><tr id="evs_04_2036__row60547305104128"><th align="left" class="cellrowborder" valign="top" width="28.57%" id="mcps1.3.3.2.2.1.1.4.1.1"><p id="evs_04_2036__p5384679104128">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="26.529999999999998%" id="mcps1.3.3.2.2.1.1.4.1.2"><p id="evs_04_2036__p33505894104128">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="44.9%" id="mcps1.3.3.2.2.1.1.4.1.3"><p id="evs_04_2036__p29622926104128">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="evs_04_2036__row50646790104128"><td class="cellrowborder" valign="top" width="28.57%" headers="mcps1.3.3.2.2.1.1.4.1.1 "><p id="evs_04_2036__p8749302104128">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.529999999999998%" headers="mcps1.3.3.2.2.1.1.4.1.2 "><p id="evs_04_2036__p37604871104128">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.9%" headers="mcps1.3.3.2.2.1.1.4.1.3 "><p id="evs_04_2036__p26095712104128">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="evs_04_2036__row40869685152038"><td class="cellrowborder" valign="top" width="28.57%" headers="mcps1.3.3.2.2.1.1.4.1.1 "><p id="evs_04_2036__p33171521152058">resource_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.529999999999998%" headers="mcps1.3.3.2.2.1.1.4.1.2 "><p id="evs_04_2036__p2538652152058">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.9%" headers="mcps1.3.3.2.2.1.1.4.1.3 "><p id="evs_04_2036__p42707547152038">Specifies the resource type. The value can be <strong id="evs_04_2036__b842352706193556">volumes</strong>, <strong id="evs_04_2036__b84235270619367">snapshots</strong>, or <strong id="evs_04_2036__b842352706193615">backups</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="evs_04_2036__row255647152042"><td class="cellrowborder" valign="top" width="28.57%" headers="mcps1.3.3.2.2.1.1.4.1.1 "><p id="evs_04_2036__p38738380152058">resource_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.529999999999998%" headers="mcps1.3.3.2.2.1.1.4.1.2 "><p id="evs_04_2036__p50801043152058">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44.9%" headers="mcps1.3.3.2.2.1.1.4.1.3 "><p id="evs_04_2036__p33198438152042">Specifies the resource ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="evs_04_2036__section33377962104128"><h4 class="sectiontitle">Request</h4><ul id="evs_04_2036__ul19260429104128"><li id="evs_04_2036__li39126135104128">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="evs_04_2036__table16590896104128" frame="border" border="1" rules="all"><thead align="left"><tr id="evs_04_2036__row60389002104128"><th align="left" class="cellrowborder" valign="top" width="17.169999999999998%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="evs_04_2036__p1625381416113">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.59%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="evs_04_2036__p1513999104128">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.279999999999998%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="evs_04_2036__p55525100104128">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="46.96%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="evs_04_2036__p1239270104128">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="evs_04_2036__row33272036104128"><td class="cellrowborder" valign="top" width="17.169999999999998%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="evs_04_2036__p37459679152411">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.59%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="evs_04_2036__p59805966104128">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.279999999999998%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="evs_04_2036__p12445066104128">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="46.96%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="evs_04_2036__p1417386104128">Specifies the key-value pair of the tag.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="evs_04_2036__li2462312615261">Description of the request header parameter
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="evs_04_2036__table2028154215261" frame="border" border="1" rules="all"><thead align="left"><tr id="evs_04_2036__row5873922415261"><th align="left" class="cellrowborder" valign="top" width="17.23%" id="mcps1.3.4.2.2.1.1.5.1.1"><p id="evs_04_2036__p1076316158116">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.49%" id="mcps1.3.4.2.2.1.1.5.1.2"><p id="evs_04_2036__p1398844406">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.240000000000002%" id="mcps1.3.4.2.2.1.1.5.1.3"><p id="evs_04_2036__p69908410015">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="47.04%" id="mcps1.3.4.2.2.1.1.5.1.4"><p id="evs_04_2036__p1727312315261">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="evs_04_2036__row5694570715261"><td class="cellrowborder" valign="top" width="17.23%" headers="mcps1.3.4.2.2.1.1.5.1.1 "><p id="evs_04_2036__p4919953115261">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.49%" headers="mcps1.3.4.2.2.1.1.5.1.2 "><p id="evs_04_2036__p209931941909">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.240000000000002%" headers="mcps1.3.4.2.2.1.1.5.1.3 "><p id="evs_04_2036__p399418412010">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.04%" headers="mcps1.3.4.2.2.1.1.5.1.4 "><p id="evs_04_2036__p2823169515261">Specifies the type. The value can be <strong id="evs_04_2036__b842352706194129">application/json</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="evs_04_2036__ul36257715104128"><li id="evs_04_2036__li57883987104128">Example request<pre class="screen" id="evs_04_2036__screen2230201010536">{
|
|
"tags" : {
|
|
"key_0" : "value_0",
|
|
"key_1" : "value_1"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="note" id="evs_04_2036__note21105505154235"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="evs_04_2036__p55731819154235">If the request body contains an existing key of the resource, the original tag containing this key will be overwritten. For example, <strong id="evs_04_2036__b842352706194629">"key_1":"val_1"</strong> is an existing tag of the resource. If the request body contains <strong id="evs_04_2036__b84235270619474">"key_1":"val_11"</strong>, the tag of <strong id="evs_04_2036__b842352706194727">key_1</strong> for this resource is <strong id="evs_04_2036__b842352706194740">"key_1":"val_11"</strong>.</p>
|
|
</div></div>
|
|
<div class="section" id="evs_04_2036__section26860493104128"><h4 class="sectiontitle">Response</h4><ul id="evs_04_2036__ul28216342104128"><li id="evs_04_2036__li35000183152655">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="evs_04_2036__table37832011153258" frame="border" border="1" rules="all"><thead align="left"><tr id="evs_04_2036__row17828636153258"><th align="left" class="cellrowborder" valign="top" width="19.05%" id="mcps1.3.6.2.1.1.1.4.1.1"><p id="evs_04_2036__p34833401153258">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.810000000000002%" id="mcps1.3.6.2.1.1.1.4.1.2"><p id="evs_04_2036__p2933214153258">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.14%" id="mcps1.3.6.2.1.1.1.4.1.3"><p id="evs_04_2036__p51686370153258">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="evs_04_2036__row25846481153258"><td class="cellrowborder" valign="top" width="19.05%" headers="mcps1.3.6.2.1.1.1.4.1.1 "><p id="evs_04_2036__p13190249153258">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.810000000000002%" headers="mcps1.3.6.2.1.1.1.4.1.2 "><p id="evs_04_2036__p61777233153258">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.14%" headers="mcps1.3.6.2.1.1.1.4.1.3 "><p id="evs_04_2036__p49997362153258">Specifies the key-value pair of the tag.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="evs_04_2036__ul34412902104128"><li id="evs_04_2036__li41280666104128">Example response<pre class="screen" id="evs_04_2036__screen62330196153311">{
|
|
"tags" : {
|
|
"key_0" : "value_0",
|
|
"key_1" : "value_1"
|
|
}
|
|
}</pre>
|
|
<p id="evs_04_2036__p52821068113531">or</p>
|
|
<pre class="screen" id="evs_04_2036__screen140118015419">{
|
|
"error": {
|
|
"message": "XXXX",
|
|
"code": "XXX"
|
|
}
|
|
}</pre>
|
|
<p id="evs_04_2036__p5655715720175">In the preceding example, <strong id="evs_04_2036__b842352706143959">error</strong> indicates a general error, for example, <strong id="evs_04_2036__b842352706144438">badRequest</strong> or <strong id="evs_04_2036__b842352706144454">itemNotFound</strong>. An example is provided as follows:</p>
|
|
<pre class="screen" id="evs_04_2036__screen20321244154134">{
|
|
"badRequest": {
|
|
"message": "Invalid tags: Tags property value contains invalid characters.",
|
|
"code": 400
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="evs_04_2036__section46084594151835"><h4 class="sectiontitle">Status Codes</h4><ul id="evs_04_2036__ul18564055104128"><li id="evs_04_2036__li32858773104128">Normal<p id="evs_04_2036__p27293504104128"><a name="evs_04_2036__li32858773104128"></a><a name="li32858773104128"></a>200</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="evs_04_2036__section431317151242"><h4 class="sectiontitle">Error Codes</h4><p id="evs_04_2036__evs_04_2013_p783819215242">For details, see <a href="evs_04_0038.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="evs_04_2024.html">Tag Management</a></div>
|
|
</div>
|
|
</div>
|
|
|