When running Google Compute Engine I get unexpected results, different from gcutil, when querying images and kernels. Notably I do not get any results.
With gcutil I get the expected result of:
$ gcutil --project MYPROJECT listimages +----------------------------------------------------------------+----------------------------------------------------------------+----------------------------------------------+-------------+--------+ | name | description | kernel | deprecation | status | +----------------------------------------------------------------+----------------------------------------------------------------+----------------------------------------------+-------------+--------+ | projects/centos-cloud/global/images/centos-6-v20130731 | SCSI-enabled CentOS 6; Created Wed, 31 Jul 2013 00:00:00 +0000 | projects/google/global/kernels/gce-v20130603 | | READY | | projects/debian-cloud/global/images/debian-6-squeeze-v20130723 | Debian GNU/Linux 6.0.7 (squeeze) built on 2013-07-23 | projects/google/global/kernels/gce-v20130603 | | READY | | projects/debian-cloud/global/images/debian-7-wheezy-v20130723 | Debian GNU/Linux 7.1 (wheezy) built on 2013-07-23 | projects/google/global/kernels/gce-v20130603 | | READY | +----------------------------------------------------------------+----------------------------------------------------------------+----------------------------------------------+-------------+--------+
But when I use the web API or the Python API with something like this (abbreviated, but basically straight from the examples):
def _service():
flow = flow_from_clientsecrets(CLIENT_SECRETS, scope=GCE_SCOPE)
storage = Storage(OAUTH2_STORAGE)
credentials = storage.get()
if credentials is None or credentials.invalid:
credentials = run(flow, storage)
http = httplib2.Http()
auth_http = credentials.authorize(http)
gce_service = build('compute', API_VERSION)
return gce_service, credentials, auth_http
if __name__ == "__main__":
gce_service, credentials, auth_http = _service()
request = gce_service.images().list(project="MYPROJECT", filter=None)
response = request.execute(http=auth_http)
pprint(response)
Both the Web and Python API return something like this:
{
"kind": "compute#imageList",
"selfLink": "https://www.googleapis.com/compute/v1beta15/projects/MYPROJECT/global/images",
"id": "projects/MYPROJECt/global/images"
}
i.e. missing the items that one expects in the response.
What might I be doing wrong here?