全部產品
Search
文件中心

Elastic Container Instance:kubernetes ImageCache API

更新時間:Jul 06, 2024

本文提供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

鏡像緩衝的到期時間。包括以下兩種來源:

  • 建立鏡像緩衝時設定的retentionDays。

  • 建立失敗的鏡像緩衝將自動在24小時後到期。

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****"
	}
}