forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: guoyanyan <guoyanyan3@huawei.com> Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
189 lines
18 KiB
HTML
189 lines
18 KiB
HTML
<a name="EN-US_TOPIC_0053158712"></a><a name="EN-US_TOPIC_0053158712"></a>
|
|
|
|
<h1 class="topictitle1">Updating <span id="text68606276113">BMS</span><span id="text17303237201810"></span><span id="text164008561353"></span> Metadata (Native OpenStack API)</h1>
|
|
<div id="body1456128284942"><div class="section" id="EN-US_TOPIC_0053158712__section61558535185333"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0053158712__p64215781155447">This API is used to update <span id="EN-US_TOPIC_0053158712__text811034151815">BMS</span><span id="EN-US_TOPIC_0053158712__text22941634181516"></span><span id="EN-US_TOPIC_0053158712__text148688319368"></span> metadata.</p>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0053158712__ul64284563155458"><li id="EN-US_TOPIC_0053158712__li48990849155458">If the metadata does not contain the target field, the field is automatically added to the field.</li><li id="EN-US_TOPIC_0053158712__li44616756155458">If the metadata contains the target field, the field value is automatically updated.</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0053158712__section57278039123222"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0053158712__p61948571792">The <span id="EN-US_TOPIC_0053158712__text1443494514181">BMS</span><span id="EN-US_TOPIC_0053158712__text843474512184"></span><span id="EN-US_TOPIC_0053158712__text194292119367"></span> <strong id="EN-US_TOPIC_0053158712__b875452713354">OS-EXT-STS:vm_state</strong> attribute (<span id="EN-US_TOPIC_0053158712__text7888746182118">BMS</span><span id="EN-US_TOPIC_0053158712__text1188814463211"></span><span id="EN-US_TOPIC_0053158712__text16889184617217"></span> status) must be <strong id="EN-US_TOPIC_0053158712__b48321441173514">active</strong>, <strong id="EN-US_TOPIC_0053158712__b672244314352">stopped</strong>, or <strong id="EN-US_TOPIC_0053158712__b156612455352">paused</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0053158712__section47451206185333"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0053158712__p9343405185333">POST /v2.1/{project_id}/servers/{server_id}/metadata</p>
|
|
<p id="EN-US_TOPIC_0053158712__p272519324336"><a href="#EN-US_TOPIC_0053158712__table560512381338">Table 1</a> lists the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158712__table560512381338"></a><a name="table560512381338"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__table560512381338" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158712__row960883873311"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.1"><p id="EN-US_TOPIC_0053158712__p55073076202321">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.2"><p id="EN-US_TOPIC_0053158712__p4027920716375">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.3"><p id="EN-US_TOPIC_0053158712__p19427838185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__row96081838143310"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0053158712__p26317623185333">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0053158712__p51352688185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0053158712__p65927025185333">Specifies the project ID.</p>
|
|
<p id="EN-US_TOPIC_0053158712__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_0053158712__row86081438153310"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0053158712__p10854909185333">server_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0053158712__p6832475185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0053158712__p16559613185333">Specifies the <span id="EN-US_TOPIC_0053158712__text574164961818">BMS</span><span id="EN-US_TOPIC_0053158712__text1374134981810"></span><span id="EN-US_TOPIC_0053158712__text298815180368"></span> ID.</p>
|
|
<p id="EN-US_TOPIC_0053158712__p29791113277">You can obtain the BMS ID from the <span id="EN-US_TOPIC_0053158712__en-us_topic_0113746489_text013014803615">BMS</span><span id="EN-US_TOPIC_0053158712__en-us_topic_0113746489_text10131448133612"></span> console or by calling the <a href="en-us_topic_0053158693.html">Querying BMSs (Native OpenStack API)</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0053158712__section14818796185333"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0053158712__ul59471791185333"><li id="EN-US_TOPIC_0053158712__li65484079185333">Request parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__table52485804185333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158712__row22430249185333"><th align="left" class="cellrowborder" valign="top" width="17.2%" id="mcps1.3.5.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0053158712__p59978491115233">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.95%" id="mcps1.3.5.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0053158712__p101184475910">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.59%" id="mcps1.3.5.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0053158712__p26419641115233">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.260000000000005%" id="mcps1.3.5.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0053158712__p64181866115233">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__row27794510185333"><td class="cellrowborder" valign="top" width="17.2%" headers="mcps1.3.5.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0053158712__p36762838185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.95%" headers="mcps1.3.5.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0053158712__p59522419181648">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.3.5.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0053158712__p11727220185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.260000000000005%" headers="mcps1.3.5.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0053158712__p26317995185333">Specifies the user-defined metadata key and value pair. For details, see <a href="#EN-US_TOPIC_0053158712__table59792218185333">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158712__table59792218185333"></a><a name="table59792218185333"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__table59792218185333" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="EN-US_TOPIC_0053158712__b03269458432">metadata</strong> field data structure description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158712__row39910345185333"><th align="left" class="cellrowborder" valign="top" width="17.531753175317533%" id="mcps1.3.5.2.1.2.2.5.1.1"><p id="EN-US_TOPIC_0053158712__p0999194316596">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.341734173417343%" id="mcps1.3.5.2.1.2.2.5.1.2"><p id="EN-US_TOPIC_0053158712__p1320161017416">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.912391239123913%" id="mcps1.3.5.2.1.2.2.5.1.3"><p id="EN-US_TOPIC_0053158712__p150244165912">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.21412141214121%" id="mcps1.3.5.2.1.2.2.5.1.4"><p id="EN-US_TOPIC_0053158712__p17344419599">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__row17903267185333"><td class="cellrowborder" valign="top" width="17.531753175317533%" headers="mcps1.3.5.2.1.2.2.5.1.1 "><p id="EN-US_TOPIC_0053158712__p40878540185333">User-defined field key and value pair</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.341734173417343%" headers="mcps1.3.5.2.1.2.2.5.1.2 "><p id="EN-US_TOPIC_0053158712__p4201410446">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.912391239123913%" headers="mcps1.3.5.2.1.2.2.5.1.3 "><p id="EN-US_TOPIC_0053158712__p37081126185333">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.21412141214121%" headers="mcps1.3.5.2.1.2.2.5.1.4 "><p id="EN-US_TOPIC_0053158712__p54377834185333">Specifies the user-defined metadata key and value pair.</p>
|
|
<ul id="EN-US_TOPIC_0053158712__ul12187816141520"><li id="EN-US_TOPIC_0053158712__li869142020243">Each key or value contains a maximum of 255 characters.</li><li id="EN-US_TOPIC_0053158712__li1628764312318">The key does not support the following special characters:<p id="EN-US_TOPIC_0053158712__p104281244172319"><a name="EN-US_TOPIC_0053158712__li1628764312318"></a><a name="li1628764312318"></a>:`~!@#$%^&*()=+<,>?/'";{[]}|\</p>
|
|
</li><li id="EN-US_TOPIC_0053158712__li12882162717238">The value does not support the following special characters:<p id="EN-US_TOPIC_0053158712__p15830162842312"><a name="EN-US_TOPIC_0053158712__li12882162717238"></a><a name="li12882162717238"></a>\"</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0053158712__ul2231242212648"><li id="EN-US_TOPIC_0053158712__li19638466185333">Example request<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158712__screen14730145903618"><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">POST</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{ECS Endpoint}/v2.1/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd/metadata</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158712__screen61671139194851"><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></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"metadata"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"key"</span><span class="p">:</span><span class="w"> </span><span class="s">"value"</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0053158712__section22254218185333"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0053158712__ul57761257185333"><li id="EN-US_TOPIC_0053158712__li50089268185333">Response parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__table48150236185333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158712__row64499137185333"><th align="left" class="cellrowborder" valign="top" width="23.82238223822382%" id="mcps1.3.6.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0053158712__p1697956135910">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.562456245624563%" id="mcps1.3.6.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0053158712__p598956135910">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="51.615161516151616%" id="mcps1.3.6.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0053158712__p1610045625911">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__row51055328185333"><td class="cellrowborder" valign="top" width="23.82238223822382%" headers="mcps1.3.6.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0053158712__p41840919185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.562456245624563%" headers="mcps1.3.6.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0053158712__p33671307185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51.615161516151616%" headers="mcps1.3.6.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0053158712__p51647808185333">Specifies the user-defined metadata key and value pair. For details, see <a href="#EN-US_TOPIC_0053158712__table22722954185333">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158712__table22722954185333"></a><a name="table22722954185333"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__table22722954185333" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0053158712__b8960110154412">metadata</strong> field data structure description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158712__row5305371185333"><th align="left" class="cellrowborder" valign="top" width="23.82%" id="mcps1.3.6.2.1.2.2.4.1.1"><p id="EN-US_TOPIC_0053158712__p893525865912">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.43%" id="mcps1.3.6.2.1.2.2.4.1.2"><p id="EN-US_TOPIC_0053158712__p99361858125912">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="51.74999999999999%" id="mcps1.3.6.2.1.2.2.4.1.3"><p id="EN-US_TOPIC_0053158712__p693905855910">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__row2696702185333"><td class="cellrowborder" valign="top" width="23.82%" headers="mcps1.3.6.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0053158712__p17106284185333">User-defined field key and value pair</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.43%" headers="mcps1.3.6.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0053158712__p43431730185333">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51.74999999999999%" headers="mcps1.3.6.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0053158712__p5719410617654">Specifies the key and value pair of the metadata.</p>
|
|
<ul id="EN-US_TOPIC_0053158712__ul1049861817191"><li id="EN-US_TOPIC_0053158712__li1413563592416">Each key or value contains a maximum of 255 characters.</li><li id="EN-US_TOPIC_0053158712__li2073683916242">The value does not support the following special characters:<p id="EN-US_TOPIC_0053158712__p1821315403243"><a name="EN-US_TOPIC_0053158712__li2073683916242"></a><a name="li2073683916242"></a>\"</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0053158712__li7375103614333">Example response<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158712__screen16375113693312"><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></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"metadata"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"key"</span><span class="p">:</span><span class="w"> </span><span class="s">"value"</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0053158712__section7610951"><h4 class="sectiontitle">Returned Values</h4><div class="p" id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_p193201622141412">Normal values
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_table753804619176" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_row10735134615172"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.7.2.1.1.3.1.1"><p id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_p19735204616177">Returned Values</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.7.2.1.1.3.1.2"><p id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_p207355465176">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_row1473514621713"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.7.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_p13735144611178">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.7.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0053158712__en-us_topic_0106040941_p207351246161711">The request has been successfully processed.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0053158712__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_0053158712__section14752650154917"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0053158712__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_0173933989.html">BMS Metadata Management</a></div>
|
|
</div>
|
|
</div>
|
|
|