GetImageCache

Updated at:
Copy as MD

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

statusDescription
PENDINGPreparing. Continue querying.
READYReady.
FAILEDPreparation failed. Troubleshoot based on the error field.
DELETINGDeleting.
DISABLEDDisabled.

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

agentcore:GetImageCache

get

*Workspace

acs:agentcore:{#regionId}:{#accountId}:workspace/{#WorkspaceId}

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 :

    Ready.

  • FAILED :

    Failed.

  • DELETING :

    Deleting.

  • PENDING :

    Pending.

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 :

    Instances are being released.

  • DELETING :

    Deleting.

  • AGENT_ENABLED :

    Agents still have this cache enabled.

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.