All Products
Search
Document Center

Elastic Container Instance:UpdateImageCache

Last Updated:Oct 17, 2025

Updates an image cache.

Operation description

You can update only image caches that are in the Ready or UpdateFailed state.

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

eci:UpdateImageCache

update

*ImageCache

acs:eci:{#regionId}:{#accountId}:imagecache/{#ImageCacheId}

  • eci:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

cn-hangzhou

RegionId

string

Yes

The region ID.

cn-hangzhou

ImageCacheId

string

Yes

The ID of the image cache.

imc-bp195erqe9o2pb09****

SecurityGroupId

string

No

The ID of the security group.

sg-uf66jeqopgqa9hdn****

VSwitchId

string

No

The ID of the vSwitch.

vsw-uf6h3rbwbm90urjwa****

ImageCacheName

string

No

The name of the image cache.

testcache

EipInstanceId

string

No

The elastic IP address (EIP). To pull images from the Internet, ensure that the ECI instance has Internet access. Configure an EIP or a NAT Gateway to enable Internet access.

eip-2zedsm5mfl3uhdj2d****

ResourceGroupId

string

No

The ID of the resource group.

rg-aekzh43v*****

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. Generate a value that is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-xxx-xxx-xxxx-42665544xxxx

ImageCacheSize

integer

No

The size of the image cache. The default value is 20 GiB.

20

RetentionDays

integer

No

The retention period of the image cache in days. The image cache expires and is cleared after the retention period ends. By default, the image cache never expires.

Note

Image caches that failed to be created are retained for only one day.

7

AutoMatchImageCache

boolean

No

Specifies whether to enable reuse of image cache layers. If you enable this feature, the system reuses the image layers of existing image caches to accelerate the creation of image caches. Valid values:

  • true

  • false

Default value: false.

true

ImageRegistryCredential

array<object>

No

The credentials of the image repository.

object

No

The credentials of the image repository.

Password

string

No

The password for the image repository.

password

Server

string

No

The address of the image repository. Do not include the http:// or https:// prefix.

registry-vpc.cn-hangzhou.aliyuncs.com

UserName

string

No

The username for the image repository.

username

Image

array

No

The list of container images used to create the image cache.

Note

If you want to trigger an in-place upgrade of the image cache without updating the image list, you must still pass the image list. Otherwise, the image data is not updated to the latest version. Only the metadata is refreshed.

registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.15.10-perl

string

No

The container image used to create the image cache.

registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.15.10-perl

Tag

array<object>

No

The tags to attach to the image cache. You can attach up to 20 tags.

object

No

The tags to attach to the image cache. You can attach up to 20 tags.

Key

string

No

The key of the tag.

imc

Value

string

No

The value of the tag.

test

Flash

boolean

No

Specifies whether to enable the instant image cache feature. This feature accelerates the creation of image caches. Valid values:

  • true

  • false

Default value: false.

true

AcrRegistryInfo

array<object>

No

The information about the Container Registry (ACR) Enterprise Edition instance.

object

No

The information about the ACR Enterprise Edition instance.

Domain

array

No

The domain names of the ACR Enterprise Edition instance. By default, all domain names of the instance are used. You can specify one or more domain names. Separate multiple domain names with commas (,).

test****-registry.cn-hangzhou.cr.aliyuncs.com

string

No

The domain names of the ACR Enterprise Edition instance. By default, all domain names of the instance are used. You can specify one or more domain names. Separate multiple domain names with commas (,).

test****-registry.cn-hangzhou.cr.aliyuncs.com

InstanceName

string

No

The name of the ACR Enterprise Edition instance.

test****

InstanceId

string

No

The ID of the ACR Enterprise Edition instance.

cri-nwj395hgf6f3****

RegionId

string

No

The region where the ACR Enterprise Edition instance is located.

cn-hangzhou

StandardCopyCount

integer

No

The number of standard snapshot replicas. By default, one snapshot is created for one image cache. If the image cache is used to create multiple ECI instances in batches, configure this parameter to create multiple snapshot replicas. We recommend creating one snapshot replica for every 1,000 ECI instances.

Note

If the instant image cache feature is disabled (Flash is set to false), only standard snapshots are created when the image cache is being created.

7

FlashCopyCount

integer

No

The number of local snapshot replicas. By default, one snapshot is created for one image cache. If the image cache is used to create multiple ECI instances in batches, configure this parameter to create multiple snapshot replicas. We recommend creating one snapshot replica for every 1,000 ECI instances.

Note

If the instant image cache feature is enabled (Flash is set to true), the system first creates local snapshots. After the local snapshots are created, the system starts to create standard snapshots. After the standard snapshots are created, the local snapshots are automatically deleted.

7

EliminationStrategy

string

No

The eviction policy for the image cache. By default, the image cache is never evicted.

Set this parameter to `LRU` to allow automatic deletion. If you set the policy to `LRU`, when the number of image caches reaches the quota, the system automatically deletes the least recently used caches.

LRU

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

0E234675-3465-4CC3-9D0F-9A864BC391DD

Examples

Success response

JSON format

{
  "RequestId": "0E234675-3465-4CC3-9D0F-9A864BC391DD"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Account.Arrearage Your account has an outstanding payment. Your account has an outstanding payment.
400 DryRunOperation Request validation has been passed with DryRun flag set. Request validation has been passed with DryRun flag set.
400 InvalidParameter.CPU.Memory The specified cpu and memory are not allowed
400 IncorrectStatus %s
400 ServiceNotEnabled %s The service on which this request depends has not been activated. Please activate and try again.
400 DiskVolume.NotSupport The disk volume is not supported. Disk volume does not support your structure. If you want to enable this function, contact us.
400 RamRole.NotSupport The RAM role is not supported. The RAM role is not supported.
400 ImageCache.IncorrectStatus %s
400 ImageCacheNotSupport Image cache is not available for all users. If you want to enable this function, contact us. Container image cache is currently not available to all users. Submit a ticket if you need to use the feature.
400 OperationConflict Request was denied due to conflict with a previous request. Request was denied due to conflict with a previous request.
400 NoNeedUpdate There are no changes to be updated for current resource. There are no changes to be updated for current resource.
403 OperationDenied.VswZoneMisMatch The specified VSwitchId is not in the specified Zone.
403 QuotaExceeded %s quota exceeded.
403 Zone.NotOnSale The specified zone is not available for purchase.
403 Forbidden.RiskControl This operation has been identified as an abnormal operation and cannot be processed.
403 Forbidden.SubUser The specified action is not available for you.
403 Forbidden.OnlyForInvitedTest Eci create action is only open to invited users during public beta.
403 OperationDenied.SecurityGroupMisMatch The specified VSwitchId and SecurityGroupId are not in the same VPC.
403 InvalidVSwitchId.IpNotEnough The specified VSwitch does not have enough IP addresses.
403 Forbidden.UserBussinessStatus This operation is not allowed, because you have overdue bills. Pay the overdue bill and try again.
403 Forbidden.UserNotRealNameAuthentication This operation is not allowed, because you have not passed the real-name verification.
403 InvalidUser.PassRoleForbidden The RAM user is not authorized to assume a RAM role. The RAM user is not authorized to assume a RAM role.
403 OperationDenied.NoStock Sales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://help.aliyun.com/document_detail/157290.html
403 NoPermission The RAM role AliyunECIContainerGroupRole does not belong to eci.aliyuncs.com. Please check and try again.
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.
403 CreateServiceLinkedRole.Denied Please make sure the account has ram:CreateServiceLinkedRole permission. Please make sure the account has ram:CreateServiceLinkedRole permission.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.