Google API 客户:Container Registry API Python

Google API Client: Container Registry API Python

我想使用 Python 在 Google 容器引擎中获取图像列表,并最终启动其中一个的实例。我知道有 gcloud command to list images,但是使用 googleapiclient 可以做到吗?

我想应该是这样的:

from googleapiclient.discovery import build
gce_service =  build('container', 'v1')
# Now what?

对于图片列表,

Google Container Registry 是一个 Docker 注册表 API 因此您可能无法通过 googleapiclient 列出图像。

使用 Docker 注册表 API 的东西,例如 https://pypi.python.org/pypi/docker-registry-client/1.0 可能值得一试,但我还没有尝试过。