2.6.11. Create or update image metadata item

 
MethodURIDescription
PUT/v2/images/{image_id}/metadata/{key}

Creates or updates a metadata item by key for a specified image.

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.11.1. Request

This table shows the URI parameters for the create or update image metadata item request:

NameTypeDescription

{image_id}

​U​U​ID

The UUID for the image.

{key}

​Image​Metadata​Key

A string. Maximum length is 255 characters.

 

Example 2.77. Create or update image metadata item: JSON request

{
    "metadata": {
        "auto_disk_config": "True",
        "Label": "Changed"
    }
}

 

Example 2.78. Create or update image metadata item: XML request

<?xml version="1.0" encoding="UTF-8"?>

<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
    <meta key="auto_disk_config">True</meta>
    <meta key="Label">Changed</meta>
</metadata>

 2.6.11.2. Response

 

Example 2.79. Create or update image metadata item: JSON response

{
    "metadata": {
        "Label": "Changed",
        "auto_disk_config": "True"
    }
}

 

Example 2.80. Create or update image metadata item: XML response

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

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


loading table of contents...