全部产品
Search
文档中心

Elastic Container Instance:kubernetes ImageCache API

更新时间:Jul 02, 2025

Topik ini menjelaskan Kubernetes ImageCache API.

Tipe data

ImageCacheList

Parameter

Tipe

Deskripsi

apiVersion

String

Versi dari API. Atur nilainya menjadi eci.alibabacloud.com/v1.

kind

String

Jenis sumber daya. Atur nilainya menjadi ImageCacheList.

metadata

ListMeta

Metadata daftar standar.

Items

ImageCache[]

Cache gambar.

ImageCache

Parameter

Tipe

Deskripsi

apiVersion

String

Versi dari API. Atur nilainya menjadi eci.alibabacloud.com/v1.

kind

String

Jenis sumber daya. Atur nilainya menjadi ImageCache.

metadata

ObjectMeta

Metadata objek.

spec

ImageCacheSpec

Detail cache gambar.

status

ImageCacheStatus

Status cache gambar.

ImageCacheSpec

Parameter

Tipe

Diperlukan

Deskripsi

images

String[]

Ya

Gambar dalam cache gambar.

imagePullSecrets

String[]

Tidak

Rahasia repositori gambar pribadi. Tentukan setiap rahasia dalam format namespace:secretName.

imageCacheSize

Int

Tidak

Ukuran cache gambar. Unit: GB. Rentang nilai: 20 hingga 32768. Nilai default: 20.

retentionDays

Int

Tidak

Periode retensi cache gambar dalam hari. Nilai parameter berkisar antara 1 hingga 65536. Secara default, parameter ini kosong, yang menunjukkan bahwa cache gambar tidak kedaluwarsa.

ImageCacheStatus

Parameter

Tipe

Deskripsi

phase

String

Status cache gambar.

progress

String

Progres pembuatan cache gambar.

imageCacheId

String

ID cache gambar.

startTime

Time

Waktu ketika cache gambar dibuat.

lastUpdatedTime

Time

Waktu terakhir cache gambar diperbarui.

events

Event[]

Detail peristiwa yang terjadi saat cache gambar dibuat.

expireDateTime

Time

Waktu ketika cache gambar kedaluwarsa. Cache gambar mungkin kedaluwarsa pada salah satu dari waktu berikut:

  • Waktu ketika periode retensi yang ditentukan selama pembuatan cache gambar berakhir.

  • 24 jam setelah cache gambar gagal dibuat.

CreateImageCache

Membuat cache gambar.

Permintaan HTTP

POST /apis/eci.alibabacloud.com/v1/imagecaches

Contoh permintaan curl

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

Contoh respons curl

{
  "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

Meminta informasi cache gambar.

Permintaan HTTP

GET /apis/eci.alibabacloud.com/v1/imagecaches

Contoh permintaan curl

curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches'

Contoh respons curl

{
  "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

Meminta informasi tentang cache gambar.

Permintaan HTTP

GET /apis/eci.alibabacloud.com/v1/imagecaches/{name}

Contoh permintaan curl

curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test'

Contoh respons curl

{
  "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

Menghapus cache gambar.

Permintaan HTTP

DELETE /apis/eci.alibabacloud.com/v1/imagecaches/{name}

Contoh permintaan curl

curl -X DELETE -H 'Content-Type: application/yaml' 'http://127.0.0.1:8001/apis/eci.alibabpacloud.com/v1/imagecaches/imagecache-secrets-test'

Contoh respons curl

{
	"kind": "Status",
	"apiVersion": "v1",
	"metadata": {},
	"status": "Success",
	"details": {
		"name": "imagecache-secrets-test",
		"group": "eci.alibabacloud.com",
		"kind": "imagecaches",
		"uid": "67460461-eaff-11e9-9774-b2c06862****"
	}
}