doc-exports/docs/bms/api-ref/en-us_topic_0060402469.html
guoyanyan c311ecafe3 bms_api_0510
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2023-10-11 08:28:11 +00:00

106 lines
9.9 KiB
HTML

<a name="EN-US_TOPIC_0060402469"></a><a name="EN-US_TOPIC_0060402469"></a>
<h1 class="topictitle1">Querying <span id="text68606276113">BMS</span><span id="text108059594348"></span> Metadata (Native OpenStack API)</h1>
<div id="body1495510231709"><div class="section" id="EN-US_TOPIC_0060402469__section61558535185333"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0060402469__p64215781155447">The <span id="EN-US_TOPIC_0060402469__text1921515371818">BMS</span><span id="EN-US_TOPIC_0060402469__text22941634181516"></span><span id="EN-US_TOPIC_0060402469__text16517181493513"></span> metadata includes <span id="EN-US_TOPIC_0060402469__text9925752187">BMS</span><span id="EN-US_TOPIC_0060402469__text1892515515181"></span><span id="EN-US_TOPIC_0060402469__text956713219350"></span> basic information on the cloud platform, such as the BMS ID, hostname, and network information. This API is used to query the <span id="EN-US_TOPIC_0060402469__text167271171810">BMS</span><span id="EN-US_TOPIC_0060402469__text9726116182"></span><span id="EN-US_TOPIC_0060402469__text1017833720353"></span> metadata.</p>
</div>
<div class="section" id="EN-US_TOPIC_0060402469__section57278039123222"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0060402469__p5608503101">Pagination query is not supported.</p>
</div>
<div class="section" id="EN-US_TOPIC_0060402469__section47451206185333"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0060402469__p9343405185333">GET /v2.1/{project_id}/servers/{server_id}/metadata</p>
<p id="EN-US_TOPIC_0060402469__p351551033210"><a href="#EN-US_TOPIC_0060402469__table3831319143216">Table 1</a> lists the parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0060402469__table3831319143216"></a><a name="table3831319143216"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0060402469__table3831319143216" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0060402469__row38322019153219"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.1"><p id="EN-US_TOPIC_0060402469__p49662088185333">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_0060402469__p63206191185333">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_0060402469__p19427838185333">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0060402469__row15832181913211"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0060402469__p26317623185333">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_0060402469__p51352688185333">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_0060402469__p65927025185333">Specifies the project ID.</p>
<p id="EN-US_TOPIC_0060402469__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_0060402469__row78321619103218"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0060402469__p10854909185333">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_0060402469__p6832475185333">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_0060402469__p16559613185333">Specifies the <span id="EN-US_TOPIC_0060402469__text956081517186">BMS</span><span id="EN-US_TOPIC_0060402469__text11560151581814"></span><span id="EN-US_TOPIC_0060402469__text133159442353"></span> ID.</p>
<p id="EN-US_TOPIC_0060402469__p29791113277">You can obtain the BMS ID from the <span id="EN-US_TOPIC_0060402469__en-us_topic_0113746489_text013014803615">BMS</span><span id="EN-US_TOPIC_0060402469__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_0060402469__section14818796185333"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0060402469__ul1994205513516"><li id="EN-US_TOPIC_0060402469__li731064111317">Request parameters<p id="EN-US_TOPIC_0060402469__p73202451634"><a name="EN-US_TOPIC_0060402469__li731064111317"></a><a name="li731064111317"></a>None</p>
</li><li id="EN-US_TOPIC_0060402469__li3941055455">Example request<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0060402469__screen15946721864"><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">GET</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>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0060402469__section22254218185333"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0060402469__ul57761257185333"><li id="EN-US_TOPIC_0060402469__li50089268185333">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0060402469__table48150236185333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0060402469__row64499137185333"><th align="left" class="cellrowborder" valign="top" width="22.259999999999998%" id="mcps1.3.5.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0060402469__p59978491115233">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.24%" id="mcps1.3.5.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0060402469__p26419641115233">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.50000000000001%" id="mcps1.3.5.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0060402469__p64181866115233">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0060402469__row51055328185333"><td class="cellrowborder" valign="top" width="22.259999999999998%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0060402469__p41840919185333">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0060402469__p10823141973520">Map&lt;String,String&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="55.50000000000001%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0060402469__p1016610293355">Specifies a user-defined metadata key-value pair. Each key or value contains a maximum of 255 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0060402469__li1948320703219">Example response<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0060402469__screen5483277322"><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">&quot;metadata&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;key&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;value&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span><span class="w"> </span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0060402469__section7610951"><h4 class="sectiontitle">Returned Values</h4><div class="p" id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_p193201622141412">Normal values
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_table753804619176" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_row10735134615172"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.6.2.1.1.3.1.1"><p id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_p19735204616177">Returned Values</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.6.2.1.1.3.1.2"><p id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_p207355465176">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_row1473514621713"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.6.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_p13735144611178">200</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.6.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0060402469__en-us_topic_0106040941_p207351246161711">The request has been successfully processed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0060402469__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_0060402469__section14752650154917"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0060402469__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>