2
votes

I'm planning to create a table in bigquery which would categorize the SKU's of each cloud services in billing. Basically I'd like to replicate the strategy suggested in one of the presentation at last Cloud Next '19, specifically this one -> https://youtu.be/UocD6uY2-js

Since there's a lot of sku's available, i'm planning to fetch this data directly from the billing api ( GET https://cloudbilling.googleapis.com/v1/{parent=services/*}/skus ), but the problem is, it requires for me to provide the service id of the cloud service I'd like to list down the SKU's. Now I don't know where can I find those service id's.

Does anybody know where can I find the service id's for each of the cloud services in google cloud? let's say for GAE or GCE, etc. ?

Here's the link to the Cloud Billing API explorer, https://developers.google.com/apis-explorer/#search/%20billing/cloudbilling/v1/cloudbilling.services.skus.list

1
I wrote an article that shows how to use the APIs: jhanley.com/google-cloud-billing-catalog-apiJohn Hanley

1 Answers

3
votes

There appears to be a an API called services.list. This API returns the services as a JSON array of service objects. Each object instance includes a field called serviceId which appears to the identifier of the service (eg. DA34-426B-A397) and I believe that this is what you are looking for.