doc-exports/docs/ecs/api-ref/en-us_topic_0065817713.html
Zaoxu, Li 4edaa4a4cc ECS API 20231016 version
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-04-29 11:04:13 +00:00

84 lines
7.3 KiB
HTML

<a name="EN-US_TOPIC_0065817713"></a><a name="EN-US_TOPIC_0065817713"></a>
<h1 class="topictitle1">Querying <span id="text94821026105216">ECS</span> Metadata</h1>
<div id="body1499652824862"><div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_section15255933"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p18695416">This API is used to query <span id="EN-US_TOPIC_0065817713__text1733213181128">ECS</span> metadata.</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_section3085673"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p17816132418199">GET /v2.1/{project_id}/servers/{server_id}/metadata</p>
<p id="EN-US_TOPIC_0065817713__p147646321307">GET /v2/{project_id}/servers/{server_id}/metadata</p>
<div class="p" id="EN-US_TOPIC_0065817713__p846625615208"><a href="#EN-US_TOPIC_0065817713__en-us_topic_0057973165_table32475667">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817713__en-us_topic_0057973165_table32475667"></a><a name="en-us_topic_0057973165_table32475667"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_table32475667" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_row44937496"><th align="left" class="cellrowborder" valign="top" width="22.24%" id="mcps1.3.2.4.2.2.4.1.1"><p id="EN-US_TOPIC_0065817713__p5187119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.87%" id="mcps1.3.2.4.2.2.4.1.2"><p id="EN-US_TOPIC_0065817713__p17503500">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.88999999999999%" id="mcps1.3.2.4.2.2.4.1.3"><p id="EN-US_TOPIC_0065817713__p8497414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_row1664874"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p637140">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p51608407">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817713__p37593705">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_row41565035"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p11324657">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p44882061">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p11568292">Specifies the <span id="EN-US_TOPIC_0065817713__text14968151015292">ECS</span> ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="note" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_note14932665211922"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p176258211922">Pagination query is not supported.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_section34863789"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p9712789">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_section45338652"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0065817713__p278520308218"><a href="#EN-US_TOPIC_0065817713__en-us_topic_0057973165_table48538422">Table 2</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817713__en-us_topic_0057973165_table48538422"></a><a name="en-us_topic_0057973165_table48538422"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_table48538422" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_row25630477"><th align="left" class="cellrowborder" valign="top" width="20.25202520252025%" id="mcps1.3.4.3.2.5.1.1"><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p62802766">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.6019601960196%" id="mcps1.3.4.3.2.5.1.2"><p id="EN-US_TOPIC_0065817713__p1018311433156">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.073007300730076%" id="mcps1.3.4.3.2.5.1.3"><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p53859287">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.073007300730076%" id="mcps1.3.4.3.2.5.1.4"><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p42619108">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_row29595703"><td class="cellrowborder" valign="top" width="20.25202520252025%" headers="mcps1.3.4.3.2.5.1.1 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p48441714">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="19.6019601960196%" headers="mcps1.3.4.3.2.5.1.2 "><p id="EN-US_TOPIC_0065817713__p91831743181514">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.073007300730076%" headers="mcps1.3.4.3.2.5.1.3 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p31464766">Object</p>
</td>
<td class="cellrowborder" valign="top" width="30.073007300730076%" headers="mcps1.3.4.3.2.5.1.4 "><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_p13467047">Specifies the user-defined metadata key-value pair.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_section5394690"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0065817713__p12310715132810">Query metadata details of a specified ECS.</p>
<pre class="screen" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_screen17089045">GET https://{endpoint}/v2/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2/metadata
GET https://{endpoint}/v2.1/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2/metadata</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__section12127142810430"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0065817713__screen51331428124312">{
"metadata": {
"wj": "True"
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0065817713__en-us_topic_0057973165_en-us_topic_0020212692_p23670760">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0065817681.html">Metadata Management</a></div>
</div>
</div>