GetImageCache
Queries the status, digest, size, and deletion conditions of an image cache in a specified workspace.
Operation description
Queries the creation status and usage of an image cache to determine whether the cache is available and meets the deletion conditions.
Cache status
status | Description |
PENDING | Preparing. Continue querying. |
READY | Ready. |
FAILED | Preparation failed. Troubleshoot based on the error field. |
DELETING | Deleting. |
DISABLED | Disabled. |
The digest is provided after the source resolution is completed. The unit of cacheSizeBytes is bytes, and it may be empty when the cache is not yet available.
Usage and deletion
agentCount indicates the number of agents that have the cache switch enabled and reference this cache. canDelete and deleteBlockReason indicate whether the cache can be deleted and the reason for blocking deletion. Deletion requests will recheck the usage.
The query scope of this operation is determined by regionId, workspaceId, and imageId.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentcore:GetImageCache |
get |
*Workspace
|
None | None |
Request syntax
GET /image-caches/{imageId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| imageId |
string |
Yes |
The cache record ID. |
img-example |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| regionId |
string |
Yes |
The product entry region. It is passed as a query parameter and must be consistent with the selected region endpoint and the workspace region. |
cn-hangzhou |
| workspaceId |
string |
Yes |
The workspace ID. |
ws-example |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response for querying image cache details. |
||
| requestId |
string |
The request ID, which is used for troubleshooting. |
req-example |
| message |
string |
The response message. |
success |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| code |
string |
The business response code. |
SUCCESS |
| success |
boolean |
Indicates whether the request is successful. This does not mean that the cache creation is completed. |
true |
| data |
object |
The query result of the image cache details. |
|
| imageId |
string |
The image cache ID. |
img-example |
| workspaceId |
string |
The workspace ID. |
ws-example |
| acrInstanceId |
string |
The source ACR instance ID. |
cri-example |
| registry |
string |
The source image domain name. |
example-registry.cn-hangzhou.cr.aliyuncs.com |
| repository |
string |
The source image repository path. |
team/app |
| tag |
string |
The source image tag. |
v1 |
| digest |
string |
The current content digest. |
sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| status |
string |
The image cache status. Valid values:
|
READY |
| cacheSizeBytes |
integer |
The cache size in bytes. |
1073741824 |
| createdAt |
string |
The resource creation time. It uses the RFC 3339 format. The Z at the end of the example indicates the UTC time zone. |
2026-10-10T00:00:00Z |
| agentCount |
integer |
The number of agents using the cache. |
0 |
| canDelete |
boolean |
Indicates whether deletion is allowed. |
false |
| deleteBlockReason |
string |
The reason why deletion is blocked. Valid values:
|
INSTANCES_RELEASING |
| error |
object |
The reason for the cache failure. |
|
| code |
string |
The error code for the creation failure. |
ACSCacheBuildFailed |
| message |
string |
The description of the creation failure. |
Image cache creation failed. Please try again |
Examples
Success response
JSON format
{
"requestId": "req-example",
"message": "success",
"httpStatusCode": 200,
"code": "SUCCESS",
"success": true,
"data": {
"imageId": "img-example",
"workspaceId": "ws-example",
"acrInstanceId": "cri-example",
"registry": "example-registry.cn-hangzhou.cr.aliyuncs.com",
"repository": "team/app",
"tag": "v1",
"digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"status": "READY",
"cacheSizeBytes": 1073741824,
"createdAt": "2026-10-10T00:00:00Z",
"agentCount": 0,
"canDelete": false,
"deleteBlockReason": "INSTANCES_RELEASING",
"error": {
"code": "ACSCacheBuildFailed",
"message": "Image cache creation failed. Try again"
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidArgument | The specified request parameter is invalid. | |
| 403 | Forbidden | The caller is not allowed to perform this operation. | |
| 404 | ImageCacheNotFound | The specified image cache does not exist. | |
| 404 | NotFound | The specified Workspace or source resource does not exist. | |
| 503 | ImageCacheUnavailable | No image cache execution resources are available in the requested cache region. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.