0

gcutilGoogle Compute Engine を実行しているときに、イメージとカーネルをクエリすると、 とは異なる予期しない結果が得られます。特に、結果は得られません。

gcutil次の期待される結果が得られます。

$ gcutil --project MYPROJECT listimages

+---------------------------------------------------------------- ---------------+---------------------------------- ------------------------------+---------------------------------- ---------------------------+-------------+-------- +
| | 名前 | 説明 | カーネル | 廃止予定 | ステータス |
+---------------------------------------------------------------- ---------------+---------------------------------- ------------------------------+---------------------------------- ---------------------------+-------------+-------- +
| | プロジェクト/centos-cloud/global/images/centos-6-v20130731 | SCSI 対応の CentOS 6; Created Wed, 31 Jul 2013 00:00:00 +0000 | プロジェクト/グーグル/グローバル/カーネル/gce-v20130603 | | | 準備完了 |
| | プロジェクト/debian-cloud/global/images/debian-6-squeeze-v20130723 | 2013 年 7 月 23 日にビルドされた Debian GNU/Linux 6.0.7 (squeeze) | プロジェクト/グーグル/グローバル/カーネル/gce-v20130603 | | | 準備完了 |
| | プロジェクト/debian-cloud/global/images/debian-7-wheezy-v20130723 | 2013 年 7 月 23 日にビルドされた Debian GNU/Linux 7.1 (wheezy) | プロジェクト/グーグル/グローバル/カーネル/gce-v20130603 | | | 準備完了 |
+---------------------------------------------------------------- ---------------+---------------------------------- ------------------------------+---------------------------------- ---------------------------+-------------+-------- +

しかし、Web APIまたは Python API を次のようなもので使用すると (省略されていますが、基本的にはからそのまま):

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)

Web API と Python API の両方が次のようなものを返します。

{
 "kind": "compute#imageList",
 "selfLink": "https://www.googleapis.com/compute/v1beta15/projects/MYPROJECT/global/images",
 "id": "projects/MYPROJECt/global/images"
}

つまり、応答に期待するものがありitemsません。

ここで何が間違っているのでしょうか?

4

2 に答える 2