我想使用 Python 获取 Google Container Engine 中的图像列表,并最终启动其中一个实例。我知道有一个gcloud 命令来列出图像,但是这可以使用 googleapiclient 吗?
我想它会是这样的:
from googleapiclient.discovery import build
gce_service = build('container', 'v1')
# Now what?
我想使用 Python 获取 Google Container Engine 中的图像列表,并最终启动其中一个实例。我知道有一个gcloud 命令来列出图像,但是这可以使用 googleapiclient 吗?
我想它会是这样的:
from googleapiclient.discovery import build
gce_service = build('container', 'v1')
# Now what?
对于图像列表,
Google Container Registry 是一个 Docker Registry API,因此您可能无法通过 googleapiclient 列出图像。
像https://pypi.python.org/pypi/docker-registry-client/1.0这样使用 Docker Registry API 的东西 可能值得一试,但我还没有尝试过。