Search code examples
pythongoogle-api-clientgoogle-kubernetes-enginegoogle-container-registry

Google API Client: Container Registry API Python


I want to get a list of images in the Google Container Engine using Python, and eventually, start an instance of one of them. I know there's a gcloud command to list images, but is this possible to do using the googleapiclient?

I imagine it would be something like this:

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

Solution

  • For image listing,

    Google Container Registry is a Docker Registry API so you probably won't be able to list images through googleapiclient.

    Something that uses the Docker Registry API like https://pypi.python.org/pypi/docker-registry-client/1.0 may be worth a try but I have not tried it.