【发布时间】:2018-05-17 13:35:46
【问题描述】:
我如何使用 Google Cloud Billing API 来检索我目前的预期总账单/累计账单?
是否有一个 API 调用可以简单地返回某个结算帐户到目前为止的费用?
或者,也可以组合调用(一个用于检索使用数据,另一个用于获取各种 Google Cloud 服务的价格)来自行计算成本?
谢谢
【问题讨论】:
标签: google-cloud-platform google-api google-cloud-billing
我如何使用 Google Cloud Billing API 来检索我目前的预期总账单/累计账单?
是否有一个 API 调用可以简单地返回某个结算帐户到目前为止的费用?
或者,也可以组合调用(一个用于检索使用数据,另一个用于获取各种 Google Cloud 服务的价格)来自行计算成本?
谢谢
【问题讨论】:
标签: google-cloud-platform google-api google-cloud-billing
您尝试过 Google Cloud Billing Report 吗? https://cloudplatform.googleblog.com/2018/03/understand-your-spending-at-a-glance-with-Google-Cloud-Billing-reports-beta.html
【讨论】:
是的,有一个 API 可以完成你想要的。
您可以控制成本、跟踪费用并创建警报以通知账单管理员this guide
根据 Alexandre 回答下方的评论,您可以使用 Google Cloud Billing API 设置预算通知来获取程序化预算通知,如this tutorial 中所述。
我建议您开始尝试quickstart,它执行更简单的 API 调用。
【讨论】: