• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. Developer Guide
  4. Updating Image Information

Updating Image Information

Scenario

Image attributes can be modified to update image information.

NOTE:
  • Only the name and description of private images can be changed.
  • The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequently calling the IAM API.

Involved APIs

If you use a token for authentication, you must obtain the token and add X-Auth-Token to the request header of the IMS API when making an API call.

  • IAM API used to obtain the token

    URI format: POST https://IAM endpoint/v3/auth/tokens

  • IMS API used to update image information (Native OpenStack API)

    URI format: PATCH /v2/images/{image_id}

Procedure

  1. Obtain the token by referring to Token Authentication.
  2. Send PATCH https://IMS endpoint/v2/cloudimages/{image_id}.
  3. Specify the following parameters in the request body:

    Parameter

    Mandatory

    Type

    Description

    op

    Yes

    String

    Specifies the operation. The value can be addreplace, or remove.

    path

    Yes

    String

    Specifies the attribute to be updated. A slash / needs to be added at the beginning of the attribute name.

    You can modify the following attributes:

    • name
    • __description
    • __support_xen
    • __support_largememory
    • __support_diskintensive
    • __support_highperformance
    • __support_xen_gpu_type
    • __support_xen_hana
    • min_ram
    • hw_vif_multiqueue_enabled

    You can add or delete some extended attributes.

    value

    Yes

    Determined by the attribute value

    Specifies the attribute value to be updated.

    Example request:

    [
        {
            "op": "replace", 
            "path": "/name", 
            "value": "ims_test" 
        }
    ]
  4. Refer to "Updating Image Information" in the Image Management Service API Reference for details about the request response parameters.
  5. Refer to Status Code for details about the returned values if an abnormal value is returned.