How do I get Google Cloud costs for this month programmatically?

时光毁灭记忆、已成空白 提交于 2019-12-12 01:39:39

问题


My current Google Cloud billing dashboard shows me the charges for this month, for all my Google Services: Storage, BigQuery, etc.

How do I get this information programmatically? The Cloud Billing API only gives me billing details, but that is not what I want.

I also tried looking into Google Storage for the billing file they periodically update, but it contains information for 2 days ago only.

What should I do?


回答1:


If you enable 'Billing Export' in the 'Billing' tab, a new JSON or CSV file will be exported everyday into Google Cloud Storage. It will have that days' usage and cost information. I have files there since the beginning of my project.



来源:https://stackoverflow.com/questions/41036071/how-do-i-get-google-cloud-costs-for-this-month-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!