【问题标题】:how to list the images stored by google compute engine using PHP?如何使用 PHP 列出谷歌计算引擎存储的图像?
【发布时间】:2014-09-24 07:35:56
【问题描述】:

我正在使用 PHP sdk 来列出 Google 计算引擎帐户中可用的所有图像。 这是我的代码:

$images= $this->service->listImages($projectID, $optionalArray);    
$image = $images->getItems();

即使我的帐户中有图像,它也会返回空数组

【问题讨论】:

  • 您能在 Pastebin.com 上分享您的代码,以便我可以尝试在我的帐户上复制吗?
  • 谢谢,只是确认一下:您使用的是github.com/google/google-api-php-client 吗?
  • 是的,我使用的是同一个 github 链接
  • 能否请您粘贴所有包含类和身份验证的代码(省略密钥和秘密)?谢谢

标签: php google-compute-engine


【解决方案1】:

我确认 listImages() 函数将仅列出您使用命令“gcloud compute images create ...”创建的私有图像。

[1] 中记录了私有图像供您参考。

链接:
[1] - https://cloud.google.com/compute/docs/images#private_images

问候,
保罗

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-17
    • 1970-01-01
    • 2015-02-18
    • 1970-01-01
    • 2012-03-03
    • 2011-02-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多