forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com> Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
149 lines
17 KiB
HTML
149 lines
17 KiB
HTML
<a name="EN-US_TOPIC_0000002340222824"></a><a name="EN-US_TOPIC_0000002340222824"></a>
|
|
|
|
<h1 class="topictitle1">Adding Tags for a <span id="en-us_topic_0060410927_text93761115448">BMS</span><span id="en-us_topic_0060410927_text1584841915431"></span><span id="en-us_topic_0060410927_text1949044318108"></span></h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section59539732104217"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p57988992104217">This API is used to add tags for a <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text11857830164313">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text1947382572"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text13854184919104"></span>.</p>
|
|
<p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p14391227112818">You are required to use the HTTP header <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0060410926_b842352706165643">X-OpenStack-Nova-API-Version: 2.26</strong> to specify the micro version on the client.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section12956040151655"><h4 class="sectiontitle">Constraints</h4><div class="p" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p12351240132119">A BMS can have a maximum of 50 tags.<div class="note" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_note65604746151638"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_ul20910143374618"><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li1791023324610">It is recommended that you add the <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_b195965579311">__type_baremetal</strong> tag to <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text19410143464310">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text541013341439"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text126505586103"></span>s to distinguish <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text14756836114310">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text4756123614435"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text634511891110"></span>s from ECSs. Otherwise, <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text395213811436">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text3953938144311"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text217717561150"></span>s will be available only on the ECS console.</li><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li660983644611">A new tag will overwrite the existing one. If you want to retain the original tag, add it to the list of new tags. You are advised to add <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_b10204174010182">__type_baremetal</strong> to the added tags list each time you add a tag.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section52138884104217"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p29338743104217">PUT /v2.1/{project_id}/servers/{server_id}/tags</p>
|
|
<p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p117143114593"><a href="#EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_table7714219185912">Table 1</a> lists the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_table7714219185912"></a><a name="en-us_topic_0060410927_table7714219185912"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_table7714219185912" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row1271511905917"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.1"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p17653616104217">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.2"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p20656767104217">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.3"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p62585419104217">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row12715101918599"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p50904119104217">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p29593000104217">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p48222838104217">Specifies the project ID.</p>
|
|
<p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p9141450142010">For how to obtain the project ID, see <a href="https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328009.html" target="_blank" rel="noopener noreferrer">Obtaining Required Information</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row107151219135910"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p56513487104217">server_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p14189698104217">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p8514927104217">Specifies the <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text75201646104311">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text5520134614311"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text196714715223"></span> ID.</p>
|
|
<p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p29791113277">You can obtain the BMS ID from the <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0113746489_text895314101319">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0113746489_text1695320481317"></span> console or by calling the API <a href="en-us_topic_0000002340063012.html">Querying BMSs</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section18620476104217"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_table40018745105534" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row48164488105534"><th align="left" class="cellrowborder" valign="top" width="19.37%" id="mcps1.3.4.2.1.5.1.1"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p19987085">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.150000000000002%" id="mcps1.3.4.2.1.5.1.2"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p1275716381498">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.61%" id="mcps1.3.4.2.1.5.1.3"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p4546697">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.870000000000005%" id="mcps1.3.4.2.1.5.1.4"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p32738149">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row6972410105534"><td class="cellrowborder" valign="top" width="19.37%" headers="mcps1.3.4.2.1.5.1.1 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p27894300105534">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.150000000000002%" headers="mcps1.3.4.2.1.5.1.2 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p9756153811911">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.4.2.1.5.1.3 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p8634695105534">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.870000000000005%" headers="mcps1.3.4.2.1.5.1.4 "><ul id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_ul1785812112408"><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li1085811114402">Specifies the tags to be added. Each tag can contain a maximum of 80 characters.</li><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li10858131164015">The tag cannot start with a period (.).</li><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li1285831117407">A BMS can have a maximum of 50 tags.</li><li id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_li385861111407">An empty tag cannot be created.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section163605892616"><h4 class="sectiontitle">Example Request</h4><div class="p" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p13490135210342">Adding tags <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_b174031037184811">baz</strong>, <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_b153999401482">foo</strong>, and <strong id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_b15469104514820">qux</strong> for a <span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text8992548111218">BMS</span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text15803221423"></span><span id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_text205161451161216"></span> (ID: 53206ed0-56de-4d6b-b7ee-ffc62ca26f43)<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_screen178781447143912"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">PUT</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers/53206ed0-56de-4d6b-b7ee-ffc62ca26f43/tags</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_screen3921366121443"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"tags"</span><span class="p">:</span><span class="w"> </span><span class="o">[</span>
|
|
<span class="w"> </span><span class="s">"baz"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"foo"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"qux"</span>
|
|
<span class="w"> </span><span class="o">]</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section6196486814321"><h4 class="sectiontitle">Response Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_table600597414321" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row5646441114321"><th align="left" class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.3.6.2.1.4.1.1"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p2639349142614">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25.61%" id="mcps1.3.6.2.1.4.1.2"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p13639114902610">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="51.22%" id="mcps1.3.6.2.1.4.1.3"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p1864164972614">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_row4038057614321"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.6.2.1.4.1.1 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p4960123314321">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.6.2.1.4.1.2 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p5827693814321">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.6.2.1.4.1.3 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_p2281157214321">Specifies user-defined tags of a BMS.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section354162262612"><h4 class="sectiontitle">Example Response</h4><div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_screen5374718514321"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"tags"</span><span class="p">:</span><span class="w"> </span><span class="o">[</span>
|
|
<span class="w"> </span><span class="s">"baz"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"foo"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"qux"</span>
|
|
<span class="w"> </span><span class="o">]</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section7610951"><h4 class="sectiontitle">Returned Values</h4><div class="p" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p193201622141412">Normal values
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_table753804619176" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_row10735134615172"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.8.2.1.1.3.1.1"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p19735204616177">Returned Values</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.8.2.1.1.3.1.2"><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p207355465176">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_row1473514621713"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.8.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p13735144611178">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.8.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p207351246161711">The request has been successfully processed.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p47633965">For details about other returned values, see <a href="en-us_topic_0053158690.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_section14752650154917"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0000002340222824__en-us_topic_0060410927_en-us_topic_0106040941_p10243161417491">See <a href="en-us_topic_0107541808.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000002374101045.html">BMS 1D Tag Management (OpenStack Nova APIs)</a></div>
|
|
</div>
|
|
</div>
|
|
|