• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. OpenStack Cinder API v3
  5. EVS Disk Actions
  6. Setting Disk Image Metadata (Internal API)

Setting Disk Image Metadata (Internal API)

Function

This API is used to set the disk image metadata, that is, the volume_image_metadata field.

URI

  • URI format

    POST /v3/{project_id}/volumes/{volume_id}/action

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    volume_id

    Yes

    Specifies the disk ID.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    os-set_image_metadata

    map<string, map>

    Yes

    Specifies disk image metadata marker.

  • Parameter in the os-set_image_metadata field

    Parameter

    Type

    Mandatory

    Description

    metadata

    map<string, map>

    Yes

    Specifies the metadata object.

  • Parameter in the metadata field

    Parameter

    Type

    Mandatory

    Description

    key_val

    map<string, string>

    No

    Specifies the key-value pair of the metadata.

  • Example request
    {
        "os-set_image_metadata": {
            "metadata": {
                "key1": "value1", 
                "key2": "value2"
            }
        }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    metadata

    map<string, map>

    Specifies the metadata object.

  • Parameter in the metadata field

    Parameter

    Type

    Description

    key_val

    map<string, string>

    Specifies the key-value pair of the metadata.

  • Description of abnormal parameters

    Parameter

    Type

    Description

    message

    string

    Specifies the returned error message when an error occurs.

    code

    string

    Specifies the returned error code when an error occurs.

    For details about the error code, see Error Codes.

  • Example response
    {
        "metadata": {
            "key1": "value1", 
            "key2": "value2"
        }
    }
    or
    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }
    In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:
    {
        "itemNotFound": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Returned Values

  • Normal

    200

Error Codes

For details, see Error Codes.