DeleteImageCache

Updated at:
Copy as MD

Deletes the image cache association in a workspace and checks agent references and instance usage before submission.

Operation description

Deletes the image cache association in a workspace and checks agent references and instance usage before submission.

Deletion conditions

The deletion request is rejected if the cache is still referenced by an agent with the cache switch enabled, or if the cache is still in use by instances or being released. You can first query agentCount, canDelete, and deleteBlockReason by calling GetImageCache.

Query results

The imageId in the response corresponds to this request. The current implementation of deletionPending returns false. To check whether the cache is still visible, call GetImageCache or ListImageCaches.

This operation deletes the cache association in the specified workspace. It does not delete the source ACR repository or the source image.

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:DeleteImageCache

delete

*Workspace

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

None None

Request syntax

DELETE /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. This parameter 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 delete image cache response.

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. A successful request does not indicate that the cache creation is complete.

true

data

object

The delete image cache result.

imageId

string

The image cache ID.

img-example

deletionPending

boolean

Indicates whether the deletion is in progress. The current implementation always returns false. To check the cache visibility, call GetImageCache or ListImageCaches.

false

Examples

Success response

JSON format

{
  "requestId": "req-example",
  "message": "success",
  "httpStatusCode": 200,
  "code": "SUCCESS",
  "success": true,
  "data": {
    "imageId": "img-example",
    "deletionPending": false
  }
}

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 NotFound The specified Workspace or source resource does not exist.
503 ImageCacheUnavailable No image cache execution resources are available in the requested cache region.
409 ImageCacheInUse The image cache is in use and cannot be deleted.
409 ImageCacheBusy A concurrent operation conflicts with deleting the image cache. Refresh its status and try again.
409 ImageCacheDeleting The image cache is being deleted.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.