Updating an Image
Function
This API is used to update image information.
Only active images can be updated.
Debugging
You can debug this API in API Explorer.
Authorization
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned. For details about the required permissions, see Permissions and Supported Actions.
URI
PATCH /v2/cloudimages/{image_id}
Table 1 lists the parameters in the URI.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| image_id | Yes | String | Definition Private image ID. For details about how to obtain an image ID, see Querying Images. Constraints N/A Range N/A Default Value N/A |
Request
- Request parameters
Parameter
Mandatory
Type
Description
[Array]
Yes
Array of objects
Definition
For details, see Table 2.
Constraints
N/A
Table 2 Data structure description of the [Array] field Parameter
Mandatory
Type
Description
op
Yes
String
Definition
Operation.
Constraints
N/A
Range
The value can be:
add
replace (modify)
remove
Default Value
N/A
path
Yes
String
Definition
Name of an attribute to be updated. / needs to be added in front of it.
Constraints
N/A
Range
You can update the following attributes:
- name: specifies an image name.
- __description: specifies image description.
- __support_kvm: KVM is supported.
- __support_xen: Xen is supported.
- __support_largememory: Ultra-large memory is supported. If an image supports large memory, the value is true. Otherwise, this parameter is not required.
- __support_diskintensive: Intensive storage is supported.
- __support_highperformance: High-performance computing (HPC) is supported.
- __support_xen_gpu_type: GPUs are supported on the Xen platform.
- __support_kvm_gpu_type: GPUs are supported on the KVM platform.
- __support_xen_hana: 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.
- __is_config_init: specifies whether initialization is completed.
- enterprise_project_id: specifies an enterprise project ID.
- min_ram: specifies the minimum memory (MB) of an image. You can set this parameter based on the ECS specifications. Generally, you do not need to set this parameter.
- max_ram: specifies the maximum memory (MB) supported by an image. You can set this parameter based on the ECS specifications. Generally, you do not need to set this parameter.
- hw_vif_multiqueue_enabled: NIC multi-queue is supported.
- hw_firmware_type: specifies the boot mode. The value can be bios or uefi.
- __support_kvm_infiniband: specifies whether an image supports InfiniBand NICs on the KVM platform. If yes, the value is true. Otherwise, this parameter is not required. This attribute cannot co-exist with __support_xen.
- __support_fc_inject: specifies whether an image supports password/private key injection with Cloud-Init. If the value is set to true, the injection is not supported. Otherwise, it is supported.
- __support_amd: specifies whether an image uses the AMD architecture. The value can be true or false.
- __support_kvm_hi1822_hisriov: SR-IOV is supported. If it is supported, the value is true. Otherwise, this parameter is not required.
- __support_kvm_hi1822_hivirtionet: Virtio-Net is supported. If it is supported, the value is true. Otherwise, this parameter is not required.
- os_shutdown_timeout:
specifies the timeout duration for a graceful shutdown. The value is an integer ranging from 60 to 1200, in seconds. The default value is 60. You are advised to set it to 120 for Linux images and 600 for Windows images.
After a graceful shutdown times out, a forced shutdown will be triggered to prevent a cloud server from staying in a pending shutdown state for a long time. Your cloud server may keep staying in a graceful shutdown state due to running software or unsaved work when you stop the server. This will trigger a forced shutdown. You can set this parameter to a larger value to provide a longer graceful shutdown timeout duration.
This parameter only applies to ECSs and does not apply to BMSs.
You can add or delete extended attributes.
NOTE:Extended attribute names cannot contain uppercase letters.
Default Value
N/A
value
Yes
String
Definition
New value of an attribute. For detailed description, see Image Attributes.
Constraints
N/A
Range
New value of attribute specified by the path parameter. For details, see the value range of path in Table 2.
Default Value
N/A
Example Request
Changing an image name to ims_test
1 2 3 4 5 6 7 8 | PATCH https://{Endpoint}/v2/cloudimages/33ad552d-1149-471c-8190-ff6776174a00 [ { "op": "replace", "path": "/name", "value": "ims_test" } ] |
Response
- Response parameters
Parameter
Type
Description
file
String
Definition
URL for uploading and downloading an image file.
Range
N/A
owner
String
Definition
Tenant that an image belongs to.
Range
N/A
id
String
Definition
Image ID. For details about how to obtain an image ID, see Querying Images.
Range
N/A
size
Long
This is a reserved field.
self
String
Definition
Image URL.
Range
N/A
schema
String
Definition
Image schema.
Range
N/A
status
String
Definition
Image status.
Range
- 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
Definition
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.
Range
N/A
visibility
String
Definition
Whether an image is visible to other tenants.
Range
- private: private image
- public: public image
- shared: shared image
name
String
Definition
Image name. For details about name, see Image Attributes.
Range
N/A
checksum
String
This is a reserved field.
protected
Boolean
Definition
Whether an image is protected. A protected image cannot be deleted.
Range
The value can be true or false.
- true: protected
- false: unprotected
container_format
String
Definition
Container type.
Range
The value is bare.
min_ram
Integer
Definition
Minimum memory (MB) required for running an image.
Range
The value depends on cloud server specifications. By default, the value is 0.
For details about cloud server specifications, see ECS Specifications.
max_ram
String
Definition
Maximum memory (MB) supported by an image.
Range
The value depends on cloud server specifications. By default, this parameter is not specified.
For details about cloud server specifications, see ECS Specifications.
updated_at
String
Definition
Image update time. The value is in UTC format: yyyy-MM-ddTHH:mm:ssZ. Example value: 2015-12-08T02:30:49Z
Range
N/A
__os_bit
String
Definition
OS bitness.
Range
Generally, the value is 32 or 64.
__os_version
String
Definition
OS version.
Range
N/A
__description
String
Definition
Provides supplementary information about the image. For details about _description, see Image Attributes.
Range
N/A
disk_format
String
Definition
Image format.
Range
The value can be ZVHD2, VHD, ZVHD, RAW, ISO, and QCOW2. The default value is ZVHD2 for a non-ISO image.
__isregistered
String
Definition
Whether an image is registered.
Range
The value can be true or false.
__platform
String
Definition
Image platform.
Range
The value can be Windows, Ubuntu, Red Hat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, CoreOS, or Other.
__os_type
String
Definition
OS type.
Range
The value can be Linux, Windows, or Other.
__system__cmkid
String
Definition
ID of the key used for image encryption.
Range
N/A
min_disk
Integer
Definition
Minimum disk space (GB) required for running an image.
Range
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
Definition
Environment where an image is used.
Range
- FusionCompute: system disk image
- DataImage: data disk image
- Ironic: BMS image
- IsoImage: ISO image
__image_source_type
String
Definition
Backend storage type of an image.
Range
Currently, only uds is available.
__imagetype
String
Definition
Image type.
Range
- gold: public image
- private: private image
- shared: shared image
- market: KooGallery image
created_at
String
Definition
Image creation time. The value is in UTC format: yyyy-MM-ddTHH:mm:ssZ. Example value: 2015-12-04T09:45:33Z
Range
N/A
__image_displayname
String
Definition
Image display name.
Range
N/A
virtual_size
Integer
This is a reserved field.
__originalimagename
String
Definition
Parent image ID. For a public image or an image created from an image file, the value is left blank.
Range
N/A
__backup_id
String
Definition
Backup ID. If the image is created from a backup, set the value to the backup ID. Otherwise, this parameter is not required.
Range
N/A
__productcode
String
Definition
Product ID of a KooGallery image.
Range
N/A
__image_size
String
Definition
Image file size, in bytes. The value must be greater than 0.
Range
N/A
__data_origin
String
Definition
Image source. For a public image, the value is left blank.
Range
N/A
__root_origin
String
Definition
Origin of an image.
Range
The value is file.
__lazyloading
String
Definition
Whether an image supports lazy loading.
Range
The value can be true, false, True, or False.
active_at
String
Definition
Time when the image status became active.
The value is in UTC format: yyyy-MM-ddTHH:mm:ssZ. Example value: 2026-07-06T02:30:49Z
Range
N/A
__os_feature_list
String
Definition
Additional image attributes. The value is a list (in JSON format) of advanced features supported by the image.
Range
N/A
__account_code
String
Definition
Image charging flag.
Range
N/A
hw_firmware_type
String
Definition
Cloud server boot mode.
Range
- bios indicates the BIOS boot mode. This value will be used by default if this parameter does not exist in the response.
- uefi indicates the UEFI boot mode.
hw_vif_multiqueue_enabled
String
Definition
Whether an image supports NIC multi-queue.
Range
The value can be true or false.
__support_kvm
String
Definition
Whether an image supports KVM.
Range
If an image supports KVM, the value is true. Otherwise, this parameter is not required.
__support_xen
String
Definition
Whether an image supports Xen.
Range
If an image supports Xen, the value is true. Otherwise, this parameter is not required.
__support_largememory
String
Definition
Whether an image supports large memory.
For details, see OSs Supported by Different Types of ECSs.
Range
If an image supports large memory, the value is true. Otherwise, this parameter is not required.
__support_diskintensive
String
Definition
Whether an image supports intensive storage.
Range
If an image supports intensive storage, the value is true. Otherwise, this parameter is not required.
__support_highperformance
String
Definition
Whether an image supports high-performance computing.
Range
If an image supports high-performance computing, the value is true. Otherwise, this parameter is not required.
__support_xen_gpu_type
String
Definition
Whether an image supports GPUs on the Xen platform. For details, see Table 2.
This parameter cannot co-exist with __support_xen or __support_kvm.
Range
If an image supports GPUs on the Xen platform, the value is true. Otherwise, this parameter is not required.
__support_kvm_gpu_type
String
Definition
Whether an image supports GPUs on the KVM platform. For details, see Table 3.
This parameter cannot co-exist with __support_xen or __support_kvm.
Range
If an image supports GPUs on the KVM platform, the value is true. Otherwise, this parameter is not required.
__support_xen_hana
String
Definition
Whether an image supports HANA on the Xen platform.
This parameter cannot co-exist with __support_xen or __support_kvm.
Range
If an image supports HANA on the Xen platform, the value is true. Otherwise, this parameter is not required.
__support_kvm_infiniband
String
Definition
Whether an image supports InfiniBand NICs on the KVM platform.
This attribute cannot co-exist with __support_xen.
Range
If an image supports InfiniBand NICs on the KVM platform, the value is true. Otherwise, this parameter is not required.
__system_support_market
Boolean
Definition
Whether an image can be published in KooGallery.
Range
- true: The image can be published in KooGallery.
- false: The image cannot be published in KooGallery.
__is_offshelved
String
Definition
Whether the KooGallery image has been taken offline.
Range
- true: The image has been taken offline.
- false: The image has not been taken offline.
enterprise_project_id
String
Definition
Enterprise project that an image belongs to.
Range
- 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. For details about how to obtain an enterprise project ID, see How Do I Obtain an Enterprise Project ID?
__sequence_num
String
Definition
Cloud server system disk slot.
This parameter is unavailable currently.
Range
N/A
__support_fc_inject
String
Definition
Whether an image supports password/private key injection with Cloud-Init.
Range
If the value is set to true, the injection is not supported. Otherwise, it is supported.
NOTE:This parameter is valid only for ECS system disk images.
__support_arm
String
Definition
Whether the image architecture is Arm.
Range
The value can be true or false.
__support_agent_list
String
Definition
Agents configured for an image.
Range
- hss: server security
- ces: server monitoring
Example value:
"__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.
__support_amd
String
Definition
Whether the image architecture is AMD.
Range
The value can be true or false.
__support_kvm_hi1822_hisriov
String
Definition
Whether an image supports SR-IOV passthrough.
Range
If an image supports SR-IOV passthrough, the value is true. Otherwise, this parameter is not required.
__support_kvm_hi1822_hivirtionet
String
Definition
Whether an image supports VirtIO-Net passthrough.
Range
If an image supports VirtIO-Net passthrough, the value is true. Otherwise, this parameter is not required.
os_shutdown_timeout
String
Definition
Graceful shutdown timeout period.
After a graceful shutdown times out, a forced shutdown will be triggered to prevent a cloud server from staying in a pending shutdown state for a long time.
Your cloud server may keep staying in a graceful shutdown state due to running software or unsaved work when you stop the server. This will trigger a forced shutdown. You can set this parameter to a larger value to provide a longer graceful shutdown timeout duration.
This parameter only applies to ECSs and does not apply to BMSs.
Range
The value is an integer ranging from 60 to 1200, in seconds. The default value is 60. You are advised to set this parameter to 120 for Linux images and 600 for Windows images.
- 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 37 38
{ "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", "hw_vif_multiqueue_enabled": "true", "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", "__support_fc_inject":"true", "__data_origin": null, "hw_firmware_type": "bios" }
Returned Values
- Normal
- Abnormal
Returned Value
Description
400 Bad Request
Request error. For details about the returned error code, 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot