Help Center/ Image Management Service/ API Reference/ Historical APIs/ Image (Native OpenStack APIs)/ Modifying an Image (Native OpenStack API V2, Deprecated)
Updated on 2026-07-07 GMT+08:00

Modifying an Image (Native OpenStack API V2, Deprecated)

Function

This API is used to modify image information.

This API has been deprecated. You are advised to use the API in Updating an Image.

Constraints

Only customized attributes, image name, and image description can be modified.

URI

PATCH /v2/images/{image_id}

Table 1 lists the parameters in the URI.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

image_id

Yes

String

Image ID.

For details about how to obtain the image ID, see Querying Images.

Request

  • Request parameters

    Glance has two methods of updating image information. The method is specified by Content-Type in the HTTP header. application/openstack-images-v2.0-json-patch and application/openstack-images-v2.1-json-patch are supported. Content types differ only in the format of the request message body.

    Table 2 v2.1 request message body

    Parameter

    Mandatory

    Type

    Description

    [Array]

    Yes

    Array of objects

    For details, see Table 3.

    Table 3 Data structure description of the [Array] field

    Parameter

    Type

    Mandatory

    Description

    op

    String

    Yes

    Operation type, including replacing, adding, or deleting an attribute.

    The value can be replace, add, or remove.

    path

    String

    Yes

    Name of an attribute to be operated.

    For replace and remove, the value can only be an existing attribute of the image. For add, the value can be an existing or a new attribute. If the value is an existing attribute, add takes the same effect as replace. If the value is a new attribute, the add operation is performed. Add a slash (/) before the attribute name.

    value

    String

    No

    Value of an attribute to be added or updated.

    Mandatory for replace and add, and not for remove

    Table 4 v2.0 request message body

    Parameter

    Mandatory

    Type

    Description

    [Array]

    Yes

    Array of objects

    For details, see Table 5.

    Table 5 Data structure description of the [Array] field

    Parameter

    Type

    Mandatory

    Description

    replace

    String

    Mandatory for any of the three values

    An image attribute will be replaced. The value is the attribute to be replaced and a slash (/) must be added in front of the attribute name.

    add

    String

    An image attribute will be added. The value is the attribute to be added and a slash (/) must be added in front of the attribute name.

    remove

    String

    An image attribute will be deleted. The value is the attribute to be deleted and a slash (/) must be added in front of the attribute name.

    value

    String

    Mandatory for replace and add, and not for remove

    Value of an attribute to be added or updated. For detailed description, see Image Attributes.

Example Request

  • Changing the name of an image to ims_test01 (V2.1 request)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    PATCH https://{Endpoint}/v2/images/33ad552d-1149-471c-8190-ff6776174a00
    "Content-Type:application/openstack-images-v2.1-json-patch"   
    [
         {
             "op": "replace",
             "path": "/name",
             "value": "test01"
         }
    ]
    
  • Changing the name of an image to ims_test01 (V2.0 request)
    1
    2
    3
    4
    5
    6
    7
    8
    PATCH https://{Endpoint}/v2/images/33ad552d-1149-471c-8190-ff6776174a00
    "Content-Type:application/openstack-images-v2.0-json-patch"
    [
         {
             "replace": "/name",
             "value": "test01"       
         }
    ]     
    

Response

  • Response parameters

    Parameter

    Type

    Description

    file

    String

    URL for uploading and downloading an image file.

    owner

    String

    Tenant that an image belongs to.

    id

    String

    Image ID.

    size

    Long

    This is a reserved field.

    self

    String

    Image URL.

    schema

    String

    Image schema.

    status

    String

    Image status. The value can be:

    • queued: indicates that the image metadata has already been created, and it is ready for the image file to upload.
    • saving: indicates that the image file is being uploaded to the backend storage.
    • deleted: indicates that the image has been deleted.
    • killed: indicates that an error occurs on the image uploading.
    • active: indicates that the image is available for use.

    tags

    Array of strings

    Image tags. With tags, you can manage private images in your own way. You can use the image tag API to add different tags to each image and filter images by tag.

    visibility

    String

    Whether an image is visible to other tenants. The value can be:

    • private: private image
    • public: public image
    • shared: shared image

    name

    String

    Image name. For details about name, see Image Attributes.

    checksum

    String

    This is a reserved field.

    protected

    Boolean

    Whether an image is protected. A protected image cannot be deleted. The value can be true or false.

    container_format

    String

    Container type.

    min_ram

    Integer

    Minimum memory (MB) required for running an image. The parameter value depends on the ECS specifications. The default value is 0.

    max_ram

    String

    Maximum memory (MB) supported by an image. The parameter value depends on the ECS specifications and is not configured by default.

    updated_at

    String

    Image update time. The value is in UTC format.

    __os_bit

    String

    OS bitness. Generally, the value is 32 or 64.

    __os_version

    String

    OS version.

    __description

    String

    Image description. For detailed description, see Image Attributes.

    disk_format

    String

    Image format. The value can be zvhd2, vhd, zvhd, raw, iso, or qcow2. The default value is zvhd2 for a non-ISO image.

    __isregistered

    String

    Whether an image is registered. The value can be true or false.

    __platform

    String

    Image platform. The value can be Windows, Ubuntu, Red Hat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, CoreOS, EulerOS, or Other.

    __os_type

    String

    OS type. The value can be Linux, Windows, or Other.

    __system__cmkid

    String

    ID of the key used for image encryption.

    min_disk

    Integer

    Minimum disk space (GB) required for running an image. For Linux, the value ranges from 10 GB to 1,024 GB. For Windows, the value ranges from 20 GB to 1,024 GB.

    virtual_env_type

    String

    Environment where an image is used. The value can be FusionCompute, Ironic, DataImage, or IsoImage.

    • For an ECS image (system disk image), the value is FusionCompute.
    • For a data disk image, the value is DataImage.
    • For a BMS image, the value is Ironic.
    • For an ISO image, the value is IsoImage.

    __image_source_type

    String

    Image backend storage type. Only UDS is supported currently.

    __imagetype

    String

    Image type. The following types are supported:

    • Public image: The value is gold.
    • Private image: The value is private.
    • Shared image: The value is shared.
    • KooGallery image: The value is market.

    created_at

    String

    Image creation time. The value is in UTC format.

    virtual_size

    Integer

    This is a reserved field.

    __originalimagename

    String

    Parent image ID.

    If the image is a public image or created from an image file, the value is left empty.

    __backup_id

    String

    Backup ID. If the image is created from a backup, set the value to the backup ID. Otherwise, this parameter is not required.

    __productcode

    String

    Product ID of a KooGallery image.

    __image_size

    String

    Image file size, in bytes. The value must be greater than 0.

    __data_origin

    String

    Image source.

    If the image is a public image, the value is left empty.

    __root_origin

    String

    Origin of an image. The value is file.

    __lazyloading

    String

    The value can be true, false, True, or False.

    active_at

    String

    Time when the image status became active.

    __os_feature_list

    String

    Additional image attributes. The value is a list (in JSON format) of advanced features supported by the image.

    __account_code

    String

    Image charging flag.

    hw_firmware_type

    String

    ECS boot mode. The value can be:

    • bios indicates the BIOS boot mode. This value will be used by fault if this parameter does not exist in the response.
    • uefi indicates the UEFI boot mode.

    hw_vif_multiqueue_enabled

    String

    Whether an image supports NIC multi-queue. The value can be true or false.

    __support_kvm

    String

    Whether an image supports KVM. If yes, the value is true. Otherwise, this parameter is not required.

    __support_xen

    String

    Whether an image supports Xen. If yes, the value is true. Otherwise, this parameter is not required.

    __support_largememory

    String

    Whether an image supports large memory. If an image supports large memory, the value is true. Otherwise, this parameter is not required.

    For details, see OSs Supported by Different Types of ECSs.

    __support_diskintensive

    String

    Whether an image supports intensive storage. If an image supports intensive storage, the value is true. Otherwise, this parameter is not required.

    __support_highperformance

    String

    Whether an image supports high-performance computing. If an image supports high-performance computing, the value is true. Otherwise, this parameter is not required.

    __support_xen_gpu_type

    String

    Whether an image supports GPUs on the Xen platform. See Table 2 for its value. If the image does not support GPUs on the Xen platform, this parameter is not required. This parameter cannot co-exist with __support_xen or __support_kvm.

    __support_kvm_gpu_type

    String

    Whether an image supports GPUs on the KVM platform. See Table 3 for its value.

    If an image does not support GPUs on the KVM platform, this parameter is not required. This parameter cannot co-exist with __support_xen or __support_kvm.

    __support_xen_hana

    String

    If an image supports HANA on the Xen platform, the value is true. Otherwise, this parameter is not required.

    This parameter cannot co-exist with __support_xen or __support_kvm.

    __support_kvm_infiniband

    String

    If an image supports InfiniBand NICs on the KVM platform, the value is true. Otherwise, this parameter is not required.

    This parameter cannot co-exist with __support_xen.

    __is_offshelved

    String

    Whether the KooGallery image has been taken offline.

    • true: The image has been taken offline.
    • false: The image has not been taken offline.

    enterprise_project_id

    String

    Enterprise project that an image belongs to.

    • If the value is 0 or left blank, an image belongs to the default enterprise project.
    • If the value is a UUID, an image belongs to the enterprise project with this UUID.

      For more information about enterprise projects, see Enterprise Center.

    __sequence_num

    String

    ECS system disk slot of an image.

    This parameter is unavailable currently.

    __support_fc_inject

    String

    Whether an image supports password/private key injection with Cloud-Init.

    true indicates password/private key injection using Cloud-Init is not supported. Other values indicate the injection is supported.

    NOTE:

    This parameter is valid only for ECS system disk images.

    __support_arm

    String

    Whether the image architecture is Arm. The value can be true or false.

    __image_location

    String

    Image storage location.

    __is_config_init

    String

    Whether initial configuration is completed. The value can be true or false.

    __support_amd

    String

    Whether the image architecture is AMD. The value can be true or false.

    __support_agent_list

    String

    Agents configured for an image.

    • hss: server security

      Host Security Service (HSS) helps you identify and manage the assets on your servers, eliminate risks, and defend against intrusions and web page tampering. There are also advanced protection and security operations available to help you easily detect and handle threats.

    • ces: server monitoring

      Monitoring is key for ensuring ECS performance, reliability, and availability. Using monitored data, you can determine ECS resource utilization. The cloud platform provides Cloud Eye to help you obtain the running statuses of your ECSs. You can use Cloud Eye to automatically monitor ECSs in real time and manage alarms and notifications to keep track of ECS performance metrics.

    Example:

    "__support_agent_list": "hss,ces"

    NOTE:

    If the response does not contain this field, the HSS or host monitoring agents are not configured for the image.

  • Example response
    STATUS CODE 200
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    {  
        "file": "/v2/images/33ad552d-1149-471c-8190-ff6776174a00/file",  
        "owner": "0b1e494e2660441a957313163095fe5c",  
        "id": "33ad552d-1149-471c-8190-ff6776174a00",  
        "size": 2,  
        "self": "/v2/images/33ad552d-1149-471c-8190-ff6776174a00",  
        "schema": "/v2/schemas/image",  
        "status": "active",  
        "tags": [],  
        "visibility": "private",  
        "name": "ims_test",  
        "checksum": "99914b932bd37a50b983c5e7c90ae93b",  
        "protected": false,  
        "container_format": "bare",  
        "min_ram": 0,  
        "updated_at": "2015-12-08T02:30:49Z",  
        "__os_bit": "64",  
        "__os_version": "Ubuntu 14.04 server 64bit",  
        "__description": "ims test",  
        "disk_format": "vhd",  
        "__isregistered": "true",  
        "__platform": "Ubuntu",  
        "__os_type": "Linux",  
        "min_disk": 40,  
        "virtual_env_type": "FusionCompute",  
        "__image_source_type": "uds",  
        "__imagetype": "private",  
        "created_at": "2015-12-04T09:45:33Z",  
        "virtual_size": 0,  
        "__originalimagename": "33ad552d-1149-471c-8190-ff6776174a00",  
        "__backup_id": "",  
        "__productcode": "",  
        "__image_size": "449261568",  
        "__data_origin": null,
        "hw_firmware_type":"bios"
    }
    

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    Request error. For details, see Error Codes.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights to perform the operation.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.