2.6.8. Create or replace image metadata

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

Creates or replaces metadata for a specified image.

Replaces items that match the specified keys. If you omit a key that already exists, this key retains its value.

If the number of metadata items exceeds the quota for metadata items, an overLimit (413) fault might be thrown.

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

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

NameTypeDescription

{image_id}

​U​U​ID

The UUID for the image.

 

Example 2.67. Create or replace image metadata: JSON request

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

 

Example 2.68. Create or replace image metadata: 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.8.2. Response

 

Example 2.69. Create or replace image metadata: JSON response

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

 

Example 2.70. Create or replace image metadata: 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...