All Products
Search
Document Center

Elastic Container Instance:DescribeImageCaches

Last Updated:Nov 14, 2024

Queries information about image caches.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eci:DescribeImageCachesget
*ImageCache
acs:eci:{#regionId}:{#accountId}:imagecache/*
*ImageCache
acs:eci:{#regionId}:{#accountId}:imagecache/{#imagecacheId}
  • eci:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the image caches.

cn-hangzhou
ImageCacheIdstringNo

The IDs of the image caches.

imc-bp195erqe9o2pb09****
ImageCacheNamestringNo

The names of the image caches.

testcache
SnapshotIdstringNo

The IDs of the snapshots that correspond to the image caches.

s-2zec5oj8e1yhxijt****
ImagestringNo

The container images.

nginx
ResourceGroupIdstringNo

The ID of the resource group to which the image caches belong.

rg-2df3isufhi38****
Tagarray<object>No

The tags to add to the image caches.

objectNo

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

KeystringNo

The key of tag N of the image cache.

imc
ValuestringNo

The value of tag N of the image cache.

test
MatchImagearrayNo

The container images used to match the image caches that you want to query. You can specify a maximum of 100 container images.

stringNo

The container image used to match the image caches that you want to query.

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

The maximum entries of query results that are allowed to be displayed.

20
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken.

AAAAAdDWBF2****
ImageFullMatchbooleanNo

Specifies whether the image layers of the image caches must contain all image layers of the container image.
If you configure MatchImage, you can configure this parameter to further filter query results.

true
ImageMatchCountRequestintegerNo

The quantity of image caches whose image layers contain all image layers of the container image.
If you configure MatchImage, you can configure this parameter to further filter query results.

3

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

39FC2E43-3DD7-4CEF-9EF4-E4AD6E635301
ImageCachesarray<object>

The information about image caches.

ImageCacheobject

The information about an image cache.

Imagesarray

The images contained in the image cache.

Imagestring

The images contained in the image cache.

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

The time when the image cache was created.

2021-02-09T02:24:07Z
Statusstring

The status of the image cache. Valid values:

  • Preparing: The image cache is being prepared.
  • Creating: The image is being created.
  • Ready: The image cache is created.
  • Failed: The image cache failed to be created.
  • Updating: The image cache is being updated.
  • UpdateFailed: The image cache failed to be updated.

The image cache is ready for use when it is in the Ready state.

Ready
Progressstring

The progress of creating the snapshot that is used to create the image cache.

Note If the instant image cache feature is enabled, the system creates a temporary local snapshot and then a regular snapshot. In this case, this parameter indicates the progress of creating the regular snapshot.
100%
ExpireDateTimestring

The time when the image cache expires.

2019-11-10T09:00:48Z
LastMatchedTimestring

The time when the image cache was last matched.

2021-08-18T03:48:10Z
ContainerGroupIdstring

The ID of the elastic container instance.

eci-bp18oq3m15prd9jb****
Tagsarray<object>

The tags of the image cache.

Tagobject

The information about the tag.

Keystring

The tag key.

imc
Valuestring

The tag value.

test
Eventsarray<object>

The events of pulling an image to create the image cache.

Eventobject

The information about the event.

Typestring

The type of the event. Valid values:

Normal
LastTimestampstring

The time when the event ended.

2021-02-09T02:24:48Z
Messagestring

The message about the event.

Successfully check image cache resource.
Namestring

The name of the event.

imagetest.1661f31f851a****
Countinteger

The number of events.

1
FirstTimestampstring

The time when the event started.

2021-02-09T02:24:48Z
Reasonstring

The cause of the event.

Started
ImageCacheIdstring

The ID of the image cache.

imc-bp195erqe9o2pb09****
RegionIdstring

The region ID of the image cache.

cn-beijing
SnapshotIdstring

The ID of the snapshot that corresponds to the image cache.

s-2zec5oj8e1yhxijt****
FlashSnapshotIdstring

The ID of the local snapshot. A temporary local snapshot is created if the instant image cache feature is enabled.

s-bp12w3v37sit96t6****
ResourceGroupIdstring

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

rg-2df3isufhi38****
ImageCacheSizeinteger

The size of the image cache. Unit: GiB.

20
ImageCacheNamestring

The name of the image cache.

imagetest
EliminationStrategystring

The elimination policy of 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 regularly used.

LRU
NextTokenstring

The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results.

AAAAAdDWBF2****
TotalCountinteger

The total number of entries returned.

15

Examples

Sample success responses

JSONformat

{
  "RequestId": "39FC2E43-3DD7-4CEF-9EF4-E4AD6E635301",
  "ImageCaches": [
    {
      "Images": [
        "registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.15.10-perl"
      ],
      "CreationTime": "2021-02-09T02:24:07Z",
      "Status": "Ready",
      "Progress": "100%",
      "ExpireDateTime": "2019-11-10T09:00:48Z",
      "LastMatchedTime": "2021-08-18T03:48:10Z",
      "ContainerGroupId": "eci-bp18oq3m15prd9jb****",
      "Tags": [
        {
          "Key": "imc",
          "Value": "test"
        }
      ],
      "Events": [
        {
          "Type": "Normal",
          "LastTimestamp": "2021-02-09T02:24:48Z",
          "Message": "Successfully check image cache resource.",
          "Name": "imagetest.1661f31f851a****",
          "Count": 1,
          "FirstTimestamp": "2021-02-09T02:24:48Z",
          "Reason": "Started"
        }
      ],
      "ImageCacheId": "imc-bp195erqe9o2pb09****",
      "RegionId": "cn-beijing",
      "SnapshotId": "s-2zec5oj8e1yhxijt****",
      "FlashSnapshotId": "s-bp12w3v37sit96t6****",
      "ResourceGroupId": "rg-2df3isufhi38****",
      "ImageCacheSize": 20,
      "ImageCacheName": "imagetest",
      "EliminationStrategy": "LRU"
    }
  ],
  "NextToken": "AAAAAdDWBF2****",
  "TotalCount": 15
}

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.
400ServiceNotEnabled%sYou have not activated the service that is required for processing this request.
403Forbidden.SubUserThe specified action is not available for you.The specified action is not available for you.
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.-
403NoPermissionThe RAM role does not belong to ECS.-

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

Change history

Change timeSummary of changesOperation
2023-09-05The Error code has changed. The response structure of the API has changedView Change Details
2023-04-17The Error code has changed. The request parameters of the API has changedView Change Details
2022-10-09The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2021-09-22The Error code has changed. The request parameters of the API has changedView Change Details
2021-09-22The Error code has changed. The response structure of the API has changedView Change Details
2021-08-10The Error code has changed. The response structure of the API has changedView Change Details