1

Is there any Google Cloud API which can be used to fetch project specific regions, instead of getting all regions where Google Cloud operates?

Currently, when I try to list using v1/projects/{project}/regions/list (Regions List API), it always returns all the regions where Google Cloud operates.

Any help is appreciated.

Purusottam
  • 611
  • 6
  • 19
  • What do you mean by `project specific regions`? All regions are available to a project. If you review VPCs, you will find that a VPC spans all regions. Google Cloud does not have the concept that you must enable a region to use it. – John Hanley May 19 '21 at 18:03
  • I share the doubts of the previous comment. All regions are available to a project. Do you intend to get a list of the regions that your project is using? – Roger May 20 '21 at 11:25
  • Let me clarify. I am looking for all regions where resources are provisioned and consumed for a specific project vs all regions applicable for Google Cloud. Generally, Cloud Users do not use services from all regions. But, use specific regions. I am looking for an api which can return all the regions where the Cloud user has provisioned resources. – Purusottam May 20 '21 at 21:21
  • Consider Cloud Asset Inventory https://cloud.google.com/asset-inventory/docs/overview – John Hanley May 20 '21 at 21:33
  • @JohnHanley Cloud Asset Inventory does not seem to have any APIs for regions utilized by a specific project :( – Purusottam May 23 '21 at 01:23
  • 2
    Have you tried executing something like this?: "gcloud asset search-all-resources --scope projects/ | grep zone" . At least in my case, I only obtain the regions used by my project. – acarrion May 24 '21 at 13:02

0 Answers0