使用 Gcloud API 列出所有可用的 public 图像

List all available public images with Gcloud APIs

我想知道是否有与仅使用 Gcloud API 的此 Gcloud SDK 命令等效的命令:

gcloud compute images list

我已经尝试使用 images.list() 端点,但我知道这会检索您的自定义图像,而不是 public 图像。我需要所有 public 可用图像的完整列表。

感谢您的帮助!

目前 'compute.images.list' API 方法仅检索自定义图像,要获得 public 图像列表,您必须请求特定图像项目,例如 centos-clouddebian-cloud,从而对每个 public 图像项目进行多次调用。您可以使用代码示例 here and add an iteration to retrieve the public images as a workaround. There's a public feature request for this, you can follow it through this link.