本文提供ImageCache API供您參考使用。
數據類型
ImageCacheList
字段 | 類型 | 描述 |
apiVersion | String | API版本。取值為eci.alibabacloud.com/v1。 |
kind | String | 資源類別。取值為ImageCacheList。 |
metadata | ListMeta | 元數據列表(Standard list metadata)。 |
Items | ImageCache[] | 鏡像緩存列表。 |
ImageCache
字段 | 類型 | 描述 |
apiVersion | String | API版本。取值為eci.alibabacloud.com/v1。 |
kind | String | 資源類別。取值為ImageCache。 |
metadata | ObjectMeta | 對象metadata。 |
spec | ImageCacheSpec | 鏡像緩存詳細信息。 |
status | ImageCacheStatus | 鏡像緩存狀態信息。 |
ImageCacheSpec
字段 | 類型 | 是否必選 | 描述 |
images | String[] | 是 | 鏡像緩存的鏡像列表。 |
imagePullSecrets | String[] | 否 | 私有鏡像倉庫對應的Secret列表,格式:namespace:secretName。 |
imageCacheSize | Int | 否 | 鏡像緩存的大小,取值范圍為20~32768,單位為GB。默認為20 GB。 |
retentionDays | Int | 否 | 鏡像緩存保留時間,取值范圍為1~65536,單位為天,默認永不過期。 |
ImageCacheStatus
字段 | 類型 | 描述 |
phase | String | 鏡像緩存狀態。 |
progress | String | 鏡像緩存的制作進度。 |
imageCacheId | String | 鏡像緩存ID。 |
startTime | Time | 鏡像緩存創建時間。 |
lastUpdatedTime | Time | 鏡像緩存最后更新時間。 |
events | Event[] | 創建鏡像緩存過程中的事件信息。 |
expireDateTime | Time | 鏡像緩存的過期時間。包括以下兩種來源:
|
CreateImageCache
本接口用于創建鏡像緩存。
HTTP request
POST /apis/eci.alibabacloud.com/v1/imagecaches
curl request example
curl -X POST -H 'Content-Type: application/yaml' --data '
apiVersion: eci.alibabacloud.com/v1
kind: ImageCache
metadata:
name: imagecache-secrets-test
spec:
images:
- registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0
imagePullSecrets:
- default:acr-test
' http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches
curl response example
{
"apiVersion": "eci.alibabacloud.com/v1",
"kind": "ImageCache",
"metadata": {
"creationTimestamp": "2019-10-10T03:50:47Z",
"generation": 1,
"name": "imagecache-secrets-test",
"resourceVersion": "647052328",
"selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test11",
"uid": "2506ba37-eb11-11e9-9576-f2ef49bf****"
},
"spec": {
"imagePullSecrets": [
"default:acr-test"
],
"images": [
"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
]
}
}
ListImageCache
本接口用于獲取鏡像緩存列表。
HTTP request
GET /apis/eci.alibabacloud.com/v1/imagecaches
curl request example
curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches'
curl response example
{
"apiVersion": "eci.alibabacloud.com/v1",
"items": [
{
"apiVersion": "eci.alibabacloud.com/v1",
"kind": "ImageCache",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"eci.alibabacloud.com/v1\",\"kind\":\"ImageCache\",\"metadata\":{\"annotations\":{},\"name\":\"imagecache-secrets-test\"},\"spec\":{\"imagePullSecrets\":[\"default:acr-test\"],\"images\":[\"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0\"]}}\n"
},
"creationTimestamp": "2019-10-10T01:43:48Z",
"generation": 1,
"name": "imagecache-secrets-test",
"resourceVersion": "646375979",
"selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test",
"uid": "67460461-eaff-11e9-9774-b2c06862****"
},
"spec": {
"imagePullSecrets": [
"default:acr-test"
],
"images": [
"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
]
},
"status": {
"imageCacheId": "imc-2ze5xnx4yiply807****",
"lastUpdatedTime": "2019-10-10T01:47:14Z",
"phase": "Ready",
"progress": "100%",
"startTime": "2019-10-10T01:43:49Z"
}
}
],
"kind": "ImageCacheList",
"metadata": {
"continue": "",
"resourceVersion": "647062964",
"selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches"
}
}
GetImageCache
本接口用于獲取某一個鏡像緩存的相關信息。
HTTP request
GET /apis/eci.alibabacloud.com/v1/imagecaches/{name}
curl request example
curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test'
curl response example
{
"apiVersion": "eci.alibabacloud.com/v1",
"kind": "ImageCache",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"eci.alibabacloud.com/v1\",\"kind\":\"ImageCache\",\"metadata\":{\"annotations\":{},\"name\":\"imagecache-secrets-test\"},\"spec\":{\"imagePullSecrets\":[\"default:acr-test\"],\"images\":[\"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0\"]}}\n"
},
"creationTimestamp": "2019-10-10T01:43:48Z",
"generation": 1,
"name": "imagecache-secrets-test",
"resourceVersion": "646375979",
"selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test",
"uid": "67460461-eaff-11e9-9774-b2c06862****"
},
"spec": {
"imagePullSecrets": [
"default:acr-test"
],
"images": [
"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
]
},
"status": {
"imageCacheId": "imc-2ze5xnx4yiply807****",
"lastUpdatedTime": "2019-10-10T01:47:14Z",
"phase": "Ready",
"progress": "100%",
"startTime": "2019-10-10T01:43:49Z"
}
}
DeleteImageCache
本接口用于刪除鏡像緩存。
HTTP request
DELETE /apis/eci.alibabacloud.com/v1/imagecaches/{name}
curl request example
curl -X DELETE -H 'Content-Type: application/yaml' 'http://127.0.0.1:8001/apis/eci.alibabpacloud.com/v1/imagecaches/imagecache-secrets-test'
curl response example
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Success",
"details": {
"name": "imagecache-secrets-test",
"group": "eci.alibabacloud.com",
"kind": "imagecaches",
"uid": "67460461-eaff-11e9-9774-b2c06862****"
}
}