2.6.3. Update server metadata items

 
MethodURIDescription
POST/v2/{tenant_id}/servers/{server_id}/metadata

Updates metadata items by key for a specified server.

Replaces items that match the specified keys and does not modify items not specified in the request.

An overLimit (413) fault might be thrown if the operation causes the quota for metadata items to be exceeded.

Normal response codes: 200

Error response codes: computeFault (400, 500, ), serviceUnavailable (503), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), itemNotFound (404), badMediaType (415), buildInProgress (409)

 2.6.3.1. Request

This table shows the URI parameters for the update server metadata items request:

NameTypeDescription

{tenant_id}

​U​U​ID

The tenant ID in a multi-tenancy cloud.

{server_id}

​U​U​ID

The UUID for the server.

 

Example 2.55. Update server metadata items: JSON request

{
   "metadata":{
      "name":"test_server"
   }
}

 

Example 2.56. Update server metadata items: XML request

<?xml version='1.0' encoding='UTF-8'?>
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
    <meta key="type">staging_server</meta>
</metadata>

 2.6.3.2. Response

 

Example 2.57. Update server metadata items: JSON response

{
   "metadata":{
      "name":"test_server",
      "server_type":"test"
   }
}

 

Example 2.58. Update server metadata items: XML response

<?xml version='1.0' encoding='UTF-8'?>
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
    <meta key="type">staging_server</meta>
</metadata>

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...