forked from docs/doc-exports
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>
114 lines
9.2 KiB
HTML
114 lines
9.2 KiB
HTML
<a name="EN-US_TOPIC_0025560298"></a><a name="EN-US_TOPIC_0025560298"></a>
|
|
|
|
<h1 class="topictitle1">Updating <span id="text1518614745211">ECS</span> Metadata</h1>
|
|
<div id="body1456128284942"><div class="section" id="EN-US_TOPIC_0025560298__section61558535185333"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0025560298__p64215781155447">This API is used to update <span id="EN-US_TOPIC_0025560298__text196036815219">ECS</span> metadata.</p>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0025560298__ul64284563155458"><li id="EN-US_TOPIC_0025560298__li48990849155458">If the metadata does not contain the target field, the field is automatically added.</li><li id="EN-US_TOPIC_0025560298__li44616756155458">If the metadata contains the target field, the field value is automatically updated.</li><li id="EN-US_TOPIC_0025560298__li29502109432">If the field in the metadata is not requested, the field value remains unchanged.</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section39865556127"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0025560298__p6603595212153">An <span id="EN-US_TOPIC_0025560298__text7204946101914">ECS</span> must be in active, stopped, paused, or suspended state, which is specified by <strong id="EN-US_TOPIC_0025560298__b720516467197">OS-EXT-STS:vm_state</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section47451206185333"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0025560298__p6869125145914">POST /v2.1/{project_id}/servers/{server_id}/metadata</p>
|
|
<p id="EN-US_TOPIC_0025560298__p746735123310">POST /v2/{project_id}/servers/{server_id}/metadata</p>
|
|
<div class="p" id="EN-US_TOPIC_0025560298__p15933181811133"><a href="#EN-US_TOPIC_0025560298__table18618337185333">Table 1</a> describes the parameters in the URI.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0025560298__table18618337185333"></a><a name="table18618337185333"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0025560298__table18618337185333" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0025560298__row17183202185333"><th align="left" class="cellrowborder" valign="top" width="16.79%" id="mcps1.3.4.4.2.2.4.1.1"><p id="EN-US_TOPIC_0025560298__p5187119">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.169999999999998%" id="mcps1.3.4.4.2.2.4.1.2"><p id="EN-US_TOPIC_0025560298__p17503500">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66.03999999999999%" id="mcps1.3.4.4.2.2.4.1.3"><p id="EN-US_TOPIC_0025560298__p8497414">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0025560298__row30151070185333"><td class="cellrowborder" valign="top" width="16.79%" headers="mcps1.3.4.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0025560298__p26317623185333">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.169999999999998%" headers="mcps1.3.4.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0025560298__p51352688185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.03999999999999%" headers="mcps1.3.4.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0025560298__p37593705">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0025560298__row56472316185333"><td class="cellrowborder" valign="top" width="16.79%" headers="mcps1.3.4.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0025560298__p10854909185333">server_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.169999999999998%" headers="mcps1.3.4.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0025560298__p6832475185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.03999999999999%" headers="mcps1.3.4.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0025560298__p16559613185333">Specifies the <span id="EN-US_TOPIC_0025560298__text12762316200">ECS</span> ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section14818796185333"><h4 class="sectiontitle">Request</h4><div class="p" id="EN-US_TOPIC_0025560298__p212665615134"><a href="#EN-US_TOPIC_0025560298__table52485804185333">Table 2</a> describes the request parameters.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0025560298__table52485804185333"></a><a name="table52485804185333"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0025560298__table52485804185333" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0025560298__row22430249185333"><th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.5.2.2.2.5.1.1"><p id="EN-US_TOPIC_0025560298__p4910858185333">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.29%" id="mcps1.3.5.2.2.2.5.1.2"><p id="EN-US_TOPIC_0025560298__p62235249185333">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="11.84%" id="mcps1.3.5.2.2.2.5.1.3"><p id="EN-US_TOPIC_0025560298__p7890371185333">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.14%" id="mcps1.3.5.2.2.2.5.1.4"><p id="EN-US_TOPIC_0025560298__p35140330185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0025560298__row27794510185333"><td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.5.2.2.2.5.1.1 "><p id="EN-US_TOPIC_0025560298__p36762838185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.29%" headers="mcps1.3.5.2.2.2.5.1.2 "><p id="EN-US_TOPIC_0025560298__p24999915185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.84%" headers="mcps1.3.5.2.2.2.5.1.3 "><p id="EN-US_TOPIC_0025560298__p11727220185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.14%" headers="mcps1.3.5.2.2.2.5.1.4 "><p id="EN-US_TOPIC_0025560298__p26317995185333">Specifies the user-defined metadata key-value pair.</p>
|
|
<p id="EN-US_TOPIC_0025560298__p19894192011457">For a metadata key:</p>
|
|
<p id="EN-US_TOPIC_0025560298__p191281254131620">It contains a maximum of 255 Unicode characters and cannot be left blank. A key can contain uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), hyphens (-), underscores (_), colons (:), and periods (.).</p>
|
|
<p id="EN-US_TOPIC_0025560298__p999582373317">For a metadata value:</p>
|
|
<p id="EN-US_TOPIC_0025560298__p10381459151619">A value contains a maximum of 255 Unicode characters.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section22254218185333"><h4 class="sectiontitle">Response</h4><div class="p" id="EN-US_TOPIC_0025560298__p33752183157"><a href="#EN-US_TOPIC_0025560298__table48150236185333">Table 3</a> describes the response parameters.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0025560298__table48150236185333"></a><a name="table48150236185333"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0025560298__table48150236185333" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0025560298__row64499137185333"><th align="left" class="cellrowborder" valign="top" width="16.74%" id="mcps1.3.6.2.2.2.4.1.1"><p id="EN-US_TOPIC_0025560298__p57047574185333">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.43%" id="mcps1.3.6.2.2.2.4.1.2"><p id="EN-US_TOPIC_0025560298__p57450759185333">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="67.83%" id="mcps1.3.6.2.2.2.4.1.3"><p id="EN-US_TOPIC_0025560298__p22999934185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0025560298__row51055328185333"><td class="cellrowborder" valign="top" width="16.74%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0025560298__p41840919185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.43%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0025560298__p33671307185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.83%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0025560298__p51647808185333">Specifies the user-defined metadata key-value pair.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section1124134931510"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0025560298__p16864210245">Update the metadata of a specified ECS to the user-defined metadata key-value pair.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0025560298__screen367330102216">POST https://{endpoint}/v2/{project_id}/servers/{server_id}/metadata
|
|
POST https://{endpoint}/v2.1/{project_id}/servers/{server_id}/metadata
|
|
|
|
{
|
|
"metadata": {
|
|
"key": "value"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section111751241184111"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0025560298__screen20180154119411">{
|
|
"metadata":{
|
|
"key":"value"
|
|
}
|
|
} </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0025560298__section46706088185333"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0025560298__p25096801185333">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>
|
|
|