List all available public images with Gcloud APIs

Viewed 1589

I was wondering if there is an equivalent to this Gcloud SDK command just using the Gcloud APIs:

gcloud compute images list

I have already tried with the images.list() endpoint, but I'm aware this retrieves your custom images, not the public ones. I need the whole list of all the publicly available images.

Thanks for your help!

1 Answers

Currently the 'compute.images.list' API method only retrieves custom images, to get a list of public images you have to request the specific image project such as centos-cloud or debian-cloud, thus making multiple call to each public image project. You can use the code examples 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.

Related