0

How can I use the Google Cloud Billing APIs to retrieve my total expected bill / accumulated bill so far?

Is there an API call that simply returns the cost so far for a certain billing account?

Or alternatively, a combination of calls - one for retrieving the usage data and the other with the prices for the various Google Cloud services - to calculate the costs myself?

Thank you

4

2 回答 2

1

您尝试过 Google Cloud Billing Report 吗? https://cloudplatform.googleblog.com/2018/03/understand-your-spending-at-a-glance-with-Google-Cloud-Billing-reports-beta.html

于 2018-05-17T15:25:03.330 回答
-1

是的,有一个 API 可以完成你想要的。

您可以按照本指南控制成本、跟踪费用并创建警报以通知计费管理员

根据 Alexandre 回答下方的评论,您可以使用 Google Cloud Billing API 设置预算通知来获取程序化预算通知,如本教程中所述。

我建议您开始尝试quickstart,它执行更简单的 API 调用。

于 2018-07-12T09:41:01.163 回答