Querying Images
Function
This API is used to query images using search criteria.
Windows images can no longer be queried.
URI
GET /v1/cloudimages/fuzzy {?__isregistered,__imagetype,__whole_image,__system__cmkid,protected,visibility,owner,id,status,name,flavor_id,container_format,disk_format,min_ram,min_disk,__os_bit,__platform,marker,limit,sort_key,sort_dir,__os_type,tag,member_status,__support_kvm,__support_xen,__support_largememory,__support_diskintensive,__support_highperformance,__support_xen_gpu_type,__support_kvm_gpu_type,__support_xen_hana,__support_kvm_infiniband,virtual_env_type,enterprise_project_id,created_at,updated_at,architecture}
You can type a question mark (?) and an ampersand (&) at the end of the URI to define multiple search criteria. For details, see the example request.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| __isregistered | No | String | Whether an image is available. The value is true. It is true for extended APIs by default. Common users can only query images whose value is true. |
| __imagetype | No | String | Image type. The following types are supported:
NOTE: __imagetype is shared for both the images you shared with other tenants and those you accepted from them. Use the owner field to distinguish the two types of shared images. You can use member_status to filter out shared images you have accepted. |
| __whole_image | No | Boolean | Whether an image is a full-ECS image. The value can be true or false. |
| __system__cmkid | No | String | ID of the key used for image encryption. You can obtain the ID from the IMS console or by calling the Querying Images API. |
| protected | No | Boolean | Whether an image is protected. The value can be true or false. Set it to true when you query public images. This parameter is optional when you query private images. |
| visibility | No | String | Whether an image is visible to other tenants. The value can be:
|
| owner | No | String | Tenant that an image belongs to. |
| id | No | String | Image ID. |
| status | No | String | Image status. The value can be:
|
| name | No | String | Image name. Exact matching is used. For details about a name, see Image Attributes. |
| flavor_id | No | String | Cloud server flavor ID used to filter available public images. Note:
|
| container_format | No | String | Container type. The value is bare. |
| disk_format | No | String | Image format. The value can be zvhd2, vhd, zvhd, raw, iso, or qcow2. The default value is zvhd2 for a non-ISO image. |
| min_ram | No | Integer | Minimum memory (MB) required for running an image. The value depends on cloud server specifications. Generally, the value is 0. |
| min_disk | No | 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. |
| __os_bit | No | String | OS bitness. Generally, the value is 32 or 64. |
| __platform | No | String | Image platform. The value can be Windows, Ubuntu, Red Hat, SUSE, CentOS, Debian, OpenSUSE, Oracle Linux, Fedora, CoreOS, EulerOS, Huawei Cloud EulerOS, or Other. |
| marker | No | String | Start number from which images are queried. The value is an image ID. |
| limit | No | Integer | Number of images to be queried. The value is an integer and is 500 by default. |
| sort_key | No | String | Field used for sorting the query results. The value can be an attribute of images: name, container_format, disk_format, status, id, size, or created_at. The default value is created_at. |
| sort_dir | No | String | Whether the query results are sorted in ascending or descending order. The value can be asc or desc. This parameter is used together with parameter sort_key. The default value is desc. |
| __os_type | No | String | Image OS type. The value can be:
|
| tag | No | String | Tag. Tags can be used as a filter to query images. NOTE: The tagging function has been upgraded. If the tags added before the function upgrade are in the format of "Key.Value", query tags using "Key=Value". For example, an existing tag is a.b. After the tag function upgrade, query the tag using "tag=a=b". |
| member_status | No | String | Image sharing status. The value can be accepted, rejected, or pending. accepted indicates that a shared image is accepted. rejected indicates that a shared image is rejected. pending indicates a shared image is waiting to be accepted. To use this parameter, set visibility to shared during the query. |
| __support_kvm | No | String | Whether an image supports KVM. If yes, the value is true. Otherwise, this parameter is not required. |
| __support_xen | No | String | Whether an image supports Xen. If yes, the value is true. Otherwise, this parameter is not required. |
| __support_largememory | No | String | Whether an image supports large memory. If yes, the value is true. Otherwise, this parameter is not required. For details, see OSs Supported by Different Types of ECSs. |
| __support_diskintensive | No | 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 | No | String | Whether an image supports high-performance computing. If yes, the value is true. Otherwise, this parameter is not required. |
| __support_xen_gpu_type | No | String | Whether an image supports GPUs on the Xen platform. See __support_xen_gpu_type Values for its value. If it does not, this parameter is not required. This parameter cannot co-exist with __support_xen or __support_kvm. |
| __support_kvm_gpu_type | No | String | Whether an image supports GPUs on the KVM platform. See __support_kvm_gpu_type Values for its value. If it does not, this parameter is not required. This parameter cannot co-exist with __support_xen or __support_kvm. |
| __support_xen_hana | No | 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 | No | 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. |
| virtual_env_type | No | String | Environment where an image is used. The value can be FusionCompute, Ironic, DataImage, or IsoImage.
|
| enterprise_project_id | No | String | Enterprise project that the queried images belong to.
|
| created_at | No | String | Image creation time. Images can be queried by time. The value is in the format of Operator:UTC time. The following operators can be used:
|
| updated_at | No | String | Image update time. Images can be queried by time. The value is in the format of Operator:UTC time. The following operators can be used:
|
| architecture | No | String | Image architecture. The value can be:
|
Request
Request parameters
None
Example Request
Querying public images (the results will be sorted by image name and only one image will be returned)
GET https://{Endpoint}/v1/cloudimages/fuzzy?__imagetype=gold&sort_key=name&limit=1 Response
- Response parameters
Parameter
Type
Description
images
Array of objects
Resource type.
For details, see Table 2.
Table 2 Data structure description of the images field 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 image metadata has already been created, and it is ready for an image file to upload.
- saving: indicates that an image file is being uploaded to the backend storage.
- deleted: indicates that an image has been deleted.
- killed: indicates that an error occurs during image upload.
- active: indicates that an 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 value depends on ECS specifications. Generally, the value is 0.
max_ram
String
Maximum memory (MB) supported by an image. The value depends on cloud server specifications. Generally, this parameter is not specified.
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 details about _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.
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, 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:
- gold: public image
- private: private image
- shared: shared image
- market: KooGallery image
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. To create an image using a backup, set the value to the backup ID. Otherwise, this value is left empty.
__productcode
String
Product ID of a KooGallery image.
__image_size
String
Image file size, in bytes.
__data_origin
String
Image source.
For a public image, the value is left empty.
__lazyloading
String
Whether an image supports lazy loading. The value can be true, false, True, or False.
active_at
String
Time when the image status became active.
__image_displayname
String
Image display name.
__os_feature_list
String
Additional image attributes. The value is a list (in JSON format) of advanced features supported by the image.
__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 yes, the value is true. Otherwise, this parameter is not required.
__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 yes, 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 it does not, 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 it does not, 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.
__system_support_market
Boolean
Whether an image can be published in KooGallery.
- true: The image can be published in KooGallery.
- false: The image cannot be published in KooGallery.
__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.
__root_origin
String
Origin of an image. The value is file.
__sequence_num
String
ECS system disk slot of an image.
Example value: 0
__support_fc_inject
String
Whether an image supports password/private key injection with Cloud-Init.
true indicates the injection is not supported. Other values indicate that the injection is supported.
NOTE:This parameter is only valid for ECS system disk images.
hw_firmware_type
String
ECS boot mode. The value can be:
- bios indicates the BIOS boot mode.
- 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_arm
String
Whether an image uses the Arm architecture. The value can be true or false.
__support_agent_list
String
Agents configured for an image.
- hss: server security
- ces: server monitoring
Example:
"__support_agent_list": "hss,ces"
NOTE:If the response does not contain this field, the server security and monitoring agents are not configured for the image.
__system__cmkid
String
ID of the key used for image encryption.
__account_code
String
Image charging flag.
__support_amd
String
Whether the image architecture is AMD. The value can be true or false.
__support_kvm_hi1822_hisriov
String
Whether an image supports SR-IOV passthrough. If yes, the value is true. Otherwise, this parameter is not required.
__support_kvm_hi1822_hivirtionet
String
Whether an image supports VirtIO-Net passthrough. If yes, 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
{ "images": [ { "schema": "/v2/schemas/image", "min_disk": 100, "created_at": "2018-09-06T14:03:27Z", "__image_source_type": "uds", "container_format": "bare", "file": "/v2/images/bc6bed6e-ba3a-4447-afcc-449174a3eb52/file", "updated_at": "2018-09-06T15:17:33Z", "protected": true, "checksum": "d41d8cd98f00b204e9800998ecf8427e", "id": "bc6bed6e-ba3a-4447-afcc-449174a3eb52", "__isregistered": "true", "min_ram": 2048, "__lazyloading": "true", "owner": "1bed856811654c1cb661a6ca845ebc77", "__os_type": "Linux", "__imagetype": "gold", "visibility": "public", "virtual_env_type": "FusionCompute", "tags": [], "__platform": "CentOS", "size": 0, "__os_bit": "64", "__os_version": "CentOS 7.3 64bit", "name": "CentOS 7.3 64bit vivado", "self": "/v2/images/bc6bed6e-ba3a-4447-afcc-449174a3eb52", "disk_format": "zvhd2", "virtual_size": null, "hw_firmware_type": "bios", "status": "active", "__support_fc_inject":"true" }, { "schema": "/v2/schemas/image", "min_disk": 100, "created_at": "2018-09-06T14:03:05Z", "__image_source_type": "uds", "container_format": "bare", "file": "/v2/images/0328c25e-c840-4496-81ac-c4e01b214b1f/file", "updated_at": "2018-09-25T14:27:40Z", "protected": true, "checksum": "d41d8cd98f00b204e9800998ecf8427e", "id": "0328c25e-c840-4496-81ac-c4e01b214b1f", "__isregistered": "true", "min_ram": 2048, "__lazyloading": "true", "owner": "1bed856811654c1cb661a6ca845ebc77", "__os_type": "Linux", "__imagetype": "gold", "visibility": "public", "virtual_env_type": "FusionCompute", "tags": [], "__platform": "CentOS", "size": 0, "__os_bit": "64", "__os_version": "CentOS 7.3 64bit", "name": "CentOS 7.3 64bit with sdx", "self": "/v2/images/0328c25e-c840-4496-81ac-c4e01b214b1f", "disk_format": "zvhd2", "virtual_size": null, "hw_firmware_type": "bios", "status": "active", "__support_fc_inject":"true" } ] }
Returned Values
- Normal
- Abnormal
Returned Value
Description
400 Bad Request
Request error. For the error code, see Error Codes.
401 Unauthorized
Authentication failed.
403 Forbidden
No operation permissions.
404 Not Found
Resource not found.
500 Internal Server Error
Internal service error.
503 Service Unavailable
Service 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