• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. API Reference
  4. APIs
  5. Image (Extension APIs)
  6. Updating Image Information

Updating Image Information

Function

This API is used to modify image attributes and update image information.

NOTE:

Only information of images in active status can be changed.

URI

URI format

PATCH /v2/cloudimages/{image_id}

Table 1 describes the parameters in the URI.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

image_id

Yes

String

Specifies the image ID.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    op

    Yes

    String

    Specifies the operation. The value can be add, replace, or remove.

    path

    Yes

    String

    Specifies the name of the attribute to be updated. / needs to be added in front of it.

    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
    • hw_firmware_uefi

    You can add or delete extension attributes.

    value

    Yes

    Determined by the attribute value.

    Specifies the attribute to be modified. For detailed description, see Image Attributes.

  • Example request
    PATCH  /v2/cloudimages/33ad552d-1149-471c-8190-ff6776174a00
    [
        {
            "op": "replace",
            "path": "/name",
            "value": "ims_test"
        }
    ]

Response

  • Parameter description

    Name

    Type

    Description

    file

    String

    Specifies the URL for uploading and downloading the image file.

    owner

    String

    Specifies the image owner.

    id

    String

    Specifies the image ID.

    size

    Long

    This parameter is unavailable currently.

    self

    String

    Specifies the image URL.

    schema

    String

    Specifies the image schema.

    status

    String

    Specifies the image status. The value can be one of the following:

    • 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

    List<String>

    Lists the image tags, through which 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

    Specifies whether the image can be seen by other tenants. The value can be private, public, or shared.

    name

    String

    Specifies the image name. For detailed description, see Image Attributes.

    checksum

    String

    This parameter is unavailable currently.

    deleted

    Boolean

    Specifies whether the image has been deleted. The value can be true or false.

    protected

    Boolean

    Specifies whether the image is protected. A protected image cannot be deleted. The value can be true or false.

    container_format

    String

    Specifies the container type.

    min_ram

    Int

    Specifies the minimum memory size (MB) required for running the image. The parameter value depends on the ECS specifications limit. The default value is 0.

    max_ram

    String

    Specifies the maximum memory of the image in the unit of MB. The parameter value depends on the ECS flavor and is not configured by default.

    updated_at

    String

    Specifies the time when the image was updated. The value is in UTC format.

    __os_bit

    String

    Specifies the OS architecture, 32 bit or 64 bit.

    __os_version

    String

    Specifies the OS version.

    __description

    String

    Provides supplementary information about the image. For detailed description, see Image Attributes.

    disk_format

    String

    Specifies the image format. The value can be vhd, raw, zvhd, or qcow2. The default value is vhd.

    __isregistered

    String

    Specifies whether the image has been registered. The value can be true or false.

    __platform

    String

    Specifies the image platform type. The value can be Windows, Ubuntu, RedHat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, Other, CoreOS, or EulerOS.

    __os_type

    String

    Specifies the operating system type. The value can be Linux, Windows, or Other.

    min_disk

    Int

    Specifies the minimum disk space (GB) required for running the image. The value ranges from 1 GB to 1024 GB.

    virtual_env_type

    String

    Specifies the environment where the image is used. The value can be FusionCompute, Ironic, or DataImage.

    • For an ECS image, set the value to FusionCompute.
    • For a data disk image, set the value to DataImage.
    • For a BMS image, set the value to Ironic.

    __image_source_type

    String

    Specifies the image backend storage type. Only UDS is supported currently.

    __imagetype

    String

    Specifies the 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.

    created_at

    String

    Specifies the time when the image was created. The value is in UTC format.

    virtual_size

    Int

    This parameter is unavailable currently.

    deleted_at

    String

    Specifies the time when the image was deleted. The value is in UTC format.

    __originalimagename

    String

    Specifies the parent image ID.

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

    __backup_id

    String

    Specifies the backup ID. To create an image using a backup, set the value to the backup ID. Otherwise, this value is left empty.

    __productcode

    String

    Specifies the ID of the market image product.

    __image_size

    String

    Specifies the size (bytes) of the image file. Value: an integer greater than 0

    __data_origin

    String

    Specifies the image resource.

    If the image is a public image, this parameter is left empty.

    hw_firmware_type

    String

    Specifies the boot mode of an ECS. The following values are supported:

    • bios indicates the BIOS boot mode.
    • uefi indicates the UEFI boot mode.

    __support_kvm

    String

    Specifies whether the image supports KVM. If yes, the value is true. Otherwise, this attribute is not required.

    __support_xen

    String

    Specifies whether the image supports Xen. If yes, the value is true. Otherwise, this attribute is not required.

    __support_largememory

    String

    Specifies whether the image can be used to create large-memory ECSs. If the image supports large-memory ECSs, the value is true. Otherwise, this attribute is not required. For the supported OSs, see Table 3.

    __support_diskintensive

    String

    Specifies whether the image can be used to create disk-intensive ECSs. If the image supports disk-intensive ECSs, the value is true. Otherwise, this attribute is not required. For the supported OSs, see Table 3.

    __support_highperformance

    String

    Specifies whether the image can be used to create high-performance ECSs. If the image supports high-performance ECSs, the value is true. Otherwise, this attribute is not required. For the supported OSs, see Table 3.

    __support_xen_gpu_type

    String

    Specifies whether the image can be used to create GPU-optimized ECSs on the Xen platform. See Table 2 for its value. For the supported OSs, see Table 3. If the image does not support GPU-optimized ECSs on the Xen platform, this attribute is not required. This attribute cannot co-exist with __support_xen and __support_kvm.

    __support_kvm_gpu_type

    String

    Specifies whether the image supports GPU-optimized ECSs on the KVM platform. See Table 2 for its value.

    If the image does not support GPU-optimized ECSs on the KVM platform, this attribute is not required. This attribute cannot co-exist with __support_xen and __support_kvm.

    __support_xen_hana

    String

    Specifies whether the image supports HANA ECSs on the Xen platform. If yes, the value is true. Otherwise, this attribute is not required.

    This attribute cannot co-exist with __support_xen and __support_kvm.

    __support_kvm_infiniband

    String

    Specifies whether the image supports ECSs with the InfiniBand NIC on the KVM platform. If yes, the value is true. Otherwise, this attribute is not required.

    This attribute cannot co-exist with __support_xen.

  • Example response
    STATUS CODE 200
    {
        "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",
        "deleted": false,
        "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,
        "deleted_at": null,
        "__originalimagename": "33ad552d-1149-471c-8190-ff6776174a00",
        "__backup_id": "",
        "__productcode": "",
        "__image_size": "449261568",
        "__data_origin": null,
        "hw_firmware_type":"bios"
    }

Returned Value

  • 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.