All Products
Search
Document Center

Elastic Container Instance:UpdateImageCache

Last Updated:Jul 22, 2024

Updates an image cache.

Operation description

Only image caches that are in the Ready or UpdateFailed state can be updated.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the image cache.

cn-hangzhou
ImageCacheIdstringYes

The ID of the image cache.

imc-bp195erqe9o2pb09****
SecurityGroupIdstringNo

The ID of the security group to which the image cache belongs.

sg-uf66jeqopgqa9hdn****
VSwitchIdstringNo

The ID of the vSwitch to which the image cache is connected.

vsw-uf6h3rbwbm90urjwa****
ImageCacheNamestringYes

The name of the image cache.

testcache
EipInstanceIdstringNo

The ID of the elastic IP address (EIP). If you want to pull public images, you must make sure that the elastic container instance can access the Internet. To enable Internet access, you can configure an EIP or a NAT gateway for the instance.

eip-2zedsm5mfl3uhdj2d****
ResourceGroupIdstringNo

The ID of the resource group to which the image cache belongs.

rg-aekzh43v*****
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token 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 the idempotence of a request?

123e4567-xxx-xxx-xxxx-42665544xxxx
ImageCacheSizeintegerNo

The size of the image cache. Unit: GiB. Default value: 20.

20
RetentionDaysintegerNo

The retention period of the image cache. Unit: days. When the retention period elapses, the image cache expires and is deleted. By default, image caches never expire.

Note The image caches that fail to be created are retained for only 1 day.
7
AutoMatchImageCachebooleanNo

Specifies whether to enable reuse of image cache layers. If you enable this feature and the image cache that you want to create and an existing image cache contain duplicate image layers, the system reuses the duplicate image layers to create the new image cache. This accelerates the creation of the image cache. Valid values:

  • true
  • false

Default value: false.

true
ImageRegistryCredentialarray<object>No

The information about the image repository.

objectNo

The information about the image repository.

PasswordstringNo

The password that is used to access the image repository.

password
ServerstringNo

The image repository address without http:// or https:// as a prefix.

registry-vpc.cn-hangzhou.aliyuncs.com
UserNamestringNo

The username that is used to access the image repository.

username
ImagearrayNo

Container images that are used to create the image cache.

stringNo

The container image that is used to create the image cache.

registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.15.10-perl
Tagarray<object>No

The tags to add to the image cache. A maximum of 20 tags can be added to the image cache.

objectNo

The information about the tag. A maximum of 20 tags can be added to the image cache.

KeystringNo

The key of tag N to add to the image cache.

imc
ValuestringNo

The value of tag N to add to the image cache.

test
FlashbooleanNo

Specifies whether to enable the instant image cache feature. The feature can accelerate the creation of image caches. Valid values:

  • true
  • false

Default value: false.

true
AcrRegistryInfoarray<object>No

The information about the Container Registry Enterprise Edition instance.

objectNo

The information about the Container Registry Enterprise Edition instance.

DomainarrayNo

The domain names of the Container Registry Enterprise Edition instance. By default, all domain names of the instance are displayed. You can specify multiple domain names. Separate multiple domain names with commas (,).

stringNo

The domain names of the Container Registry Enterprise Edition instance. By default, all domain names of the instance are displayed. You can specify multiple domain names. Separate multiple domain names with commas (,).

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

The name of the Container Registry Enterprise Edition instance.

test****
InstanceIdstringNo

The ID of the Container Registry Enterprise Edition instance.

cri-nwj395hgf6f3****
RegionIdstringNo

The region ID of the Container Registry Enterprise Edition instance.

cn-hangzhou
StandardCopyCountintegerNo

The number of duplicates of regular snapshots. By default, the system creates one snapshot for each image cache. If you use the image cache to create multiple elastic container instances at a time, we recommend that you configure this parameter to create multiple snapshot duplicates for the image cache. We recommend that you create one snapshot duplicate for creation of every 1,000 elastic container instances.

Note If you disable the instant image cache feature by setting Flash to false, only regular snapshots are generated when you create an image cache.
7
FlashCopyCountintegerNo

The number of duplicates of temporary local snapshots. By default, the system creates one snapshot for each image cache. If you use the image cache to create multiple elastic container instances at a time, we recommend that you configure this parameter to create multiple snapshot duplicates for the image cache. We recommend that you create one snapshot duplicate for creation of every 1,000 elastic container instances.

Note If you enable the instant image cache feature by setting Flash to true, a local snapshot is first created during the creation of the image cache. After the local snapshot is created, regular snapshots start to be created. After the regular snapshots are created, the local snapshot is automatically deleted.
7
EliminationStrategystringNo

The elimination policy for the image cache. This parameter is empty by default, which indicates that the image cache is always retained.

You can set this parameter to LRU, which indicates that the image cache can be automatically deleted. When the number of image caches reaches the quota, the system automatically deletes the image caches whose EliminationStrategy parameter is set to LRU and that are least recently used.

LRU

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400Account.ArrearageYour account has an outstanding payment.Your account has an outstanding payment.
400DryRunOperationRequest validation has been passed with DryRun flag set.Request validation has been passed with DryRun flag set.
400InvalidParameter.CPU.MemoryThe specified cpu and memory are not allowed-
400IncorrectStatus%s-
400ServiceNotEnabled%sYou have not activated the service that is required for processing this request.
400DiskVolume.NotSupportThe disk volume is not supported.Disk volume does not support your structure. If you want to enable this function, contact us.
400RamRole.NotSupportThe RAM role is not supported.The RAM role is not supported.
400ImageCache.IncorrectStatus%s-
400ImageCacheNotSupportImage 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.
400OperationConflictRequest was denied due to conflict with a previous request.Request was denied due to conflict with a previous request.
400NoNeedUpdateThere are no changes to be updated for current resource.There are no changes to be updated for current resource.
403OperationDenied.VswZoneMisMatchThe specified VSwitchId is not in the specified Zone.-
403QuotaExceeded%s quota exceeded.-
403Zone.NotOnSaleThe specified zone is not available for purchase.-
403Forbidden.RiskControlThis operation has been identified as an abnormal operation and cannot be processed.-
403Forbidden.SubUserThe specified action is not available for you.The specified action is not available for you.
403Forbidden.OnlyForInvitedTestEci create action is only open to invited users during public beta.Eci create action is only open to invited users during public beta.
403OperationDenied.SecurityGroupMisMatchThe specified VSwitchId and SecurityGroupId are not in the same VPC.The specified VSwitchId and SecurityGroupId are not in the same VPC.
403InvalidVSwitchId.IpNotEnoughThe specified VSwitch does not have enough IP addresses.-
403Forbidden.UserBussinessStatusThis operation is not allowed, because you have overdue bills. Pay the overdue bill and try again.-
403Forbidden.UserNotRealNameAuthenticationThis operation is not allowed, because you have not passed the real-name verification.-
403InvalidUser.PassRoleForbiddenThe RAM user is not authorized to assume a RAM role.The RAM user is not authorized to assume a RAM role.
403OperationDenied.NoStockSales 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-
403NoPermissionThe RAM role AliyunECIContainerGroupRole does not belong to eci.aliyuncs.com. Please check and try again.-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.-
403CreateServiceLinkedRole.DeniedPlease make sure the account has ram:CreateServiceLinkedRole permission.Please make sure the account has ram:CreateServiceLinkedRole permission.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-18The Error code has changedView Change Details
2022-03-01The Error code has changed. The request parameters of the API has changedView Change Details
2022-03-01The Error code has changed. The request parameters of the API has changedView Change Details
2021-09-10The Error code has changed. The request parameters of the API has changedView Change Details
2021-08-20Add OperationView Change Details