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>
112 lines
8.8 KiB
HTML
112 lines
8.8 KiB
HTML
<a name="EN-US_TOPIC_0122110044"></a><a name="EN-US_TOPIC_0122110044"></a>
|
|
|
|
<h1 class="topictitle1">Updating ECS Metadata</h1>
|
|
<div id="body1531815821329"><div class="section" id="EN-US_TOPIC_0122110044__section61558535185333"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0122110044__p64215781155447">This API is used to update ECS metadata.</p>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0122110044__ul64284563155458"><li id="EN-US_TOPIC_0122110044__li48990849155458">If the metadata does not contain the target field, the field is automatically added.</li><li id="EN-US_TOPIC_0122110044__li44616756155458">If the metadata contains the target field, the field value is automatically updated.</li><li id="EN-US_TOPIC_0122110044__li29502109432">If the field in the metadata is not requested, the field value remains unchanged.</li></ul>
|
|
<div class="note" id="EN-US_TOPIC_0122110044__note1223863395"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0122110044__p107331439183812">If the metadata contains sensitive data, take appropriate measures to protect the sensitive data, for example, controlling access permissions and encrypting the data.</p>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__en-us_topic_0057973153_section32752180"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0122110044__en-us_topic_0057973153_p15728249">An <span id="EN-US_TOPIC_0122110044__text1182659123617">ECS</span> must be in active, stopped, paused, or suspended state, which is specified by <strong id="EN-US_TOPIC_0122110044__b752363119193">OS-EXT-STS:vm_state</strong>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section47451206185333"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0122110044__p9343405185333">POST /v1/{project_id}/cloudservers/{server_id}/metadata</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122110044__table18618337185333" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0122110044__row17183202185333"><th align="left" class="cellrowborder" valign="top" width="16.79167916791679%" id="mcps1.3.5.3.2.4.1.1"><p id="EN-US_TOPIC_0122110044__p49662088185333">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.54175417541754%" id="mcps1.3.5.3.2.4.1.2"><p id="EN-US_TOPIC_0122110044__p63206191185333">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="65.66656665666567%" id="mcps1.3.5.3.2.4.1.3"><p id="EN-US_TOPIC_0122110044__p19427838185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0122110044__row30151070185333"><td class="cellrowborder" valign="top" width="16.79167916791679%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0122110044__p26317623185333">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.54175417541754%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0122110044__p51352688185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.66656665666567%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0122110044__p37593705">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0122110044__row56472316185333"><td class="cellrowborder" valign="top" width="16.79167916791679%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0122110044__p10854909185333">server_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.54175417541754%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0122110044__p6832475185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.66656665666567%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0122110044__p16559613185333">Specifies the <span id="EN-US_TOPIC_0122110044__text316218362193">ECS</span> ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section14818796185333"><h4 class="sectiontitle">Request</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122110044__table52485804185333" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0122110044__row22430249185333"><th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.6.2.2.5.1.1"><p id="EN-US_TOPIC_0122110044__p4910858185333">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.669999999999998%" id="mcps1.3.6.2.2.5.1.2"><p id="EN-US_TOPIC_0122110044__p62235249185333">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.350000000000001%" id="mcps1.3.6.2.2.5.1.3"><p id="EN-US_TOPIC_0122110044__p7890371185333">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.25%" id="mcps1.3.6.2.2.5.1.4"><p id="EN-US_TOPIC_0122110044__p35140330185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0122110044__row27794510185333"><td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.6.2.2.5.1.1 "><p id="EN-US_TOPIC_0122110044__p36762838185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.669999999999998%" headers="mcps1.3.6.2.2.5.1.2 "><p id="EN-US_TOPIC_0122110044__p24999915185333">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.350000000000001%" headers="mcps1.3.6.2.2.5.1.3 "><p id="EN-US_TOPIC_0122110044__p11727220185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.25%" headers="mcps1.3.6.2.2.5.1.4 "><p id="EN-US_TOPIC_0122110044__p26317995185333">Specifies the user-defined metadata key-value pair.</p>
|
|
<p id="EN-US_TOPIC_0122110044__p8262254217">The data structure can be empty. If the value is empty, data is not updated.</p>
|
|
<p id="EN-US_TOPIC_0122110044__p107432571608">For a metadata tag:</p>
|
|
<p id="EN-US_TOPIC_0122110044__p1974335720010">It contains a maximum of 255 Unicode characters and cannot be left blank. A tag can contain uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), hyphens (-), underscores (_), colons (:), and periods (.).</p>
|
|
<p id="EN-US_TOPIC_0122110044__p524315313116">For a metadata value:</p>
|
|
<p id="EN-US_TOPIC_0122110044__p124313316112">It contains a maximum of 255 Unicode characters.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section22254218185333"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122110044__table48150236185333" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0122110044__row64499137185333"><th align="left" class="cellrowborder" valign="top" width="16.669999999999998%" id="mcps1.3.7.2.2.4.1.1"><p id="EN-US_TOPIC_0122110044__p57047574185333">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.79%" id="mcps1.3.7.2.2.4.1.2"><p id="EN-US_TOPIC_0122110044__p57450759185333">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="65.53999999999999%" id="mcps1.3.7.2.2.4.1.3"><p id="EN-US_TOPIC_0122110044__p22999934185333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0122110044__row51055328185333"><td class="cellrowborder" valign="top" width="16.669999999999998%" headers="mcps1.3.7.2.2.4.1.1 "><p id="EN-US_TOPIC_0122110044__p41840919185333">metadata</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.79%" headers="mcps1.3.7.2.2.4.1.2 "><p id="EN-US_TOPIC_0122110044__p33671307185333">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="65.53999999999999%" headers="mcps1.3.7.2.2.4.1.3 "><p id="EN-US_TOPIC_0122110044__p51647808185333">Specifies the user-defined metadata key-value pair.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section7698444111410"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0122110044__p4983184592912">Updated the metadata of an ECS to the user-defined metadata key-value pair.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0122110044__screen61671139194851">POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/metadata
|
|
|
|
{
|
|
"metadata": {
|
|
"key": "value"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section1877694911416"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0122110044__screen6174896919492">{
|
|
"metadata":{
|
|
"key":"value"
|
|
}
|
|
} </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0122110044__section46706088185333"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0122110044__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_0124385013.html">Metadata Management</a></div>
|
|
</div>
|
|
</div>
|
|
|