API检索Google API使用

发布于 2025-01-30 04:00:18 字数 784 浏览 2 评论 0原文

我正在寻找Google Rest端点或SDK,该端点将报告特定项目和Google API的配额使用情况。例如,如果我编写一个查询,

{
  "project": "my-project",
  "api": "searchconsole.googleapis.com",
  "function": "/urlInspection/index:inspect"
}

则会返回该API的配额用法,例如,

{
  "qpd": {
    "used": 20,
    "limit": 200
  }
}

我找到了 so so post 2018年使用limeseries查询 conitoring.googleapis.com ,但这似乎是“骇人听闻的”,而且虽然很老,所以我想知道是否有更好的方法。我试图研究 https://cloud.google.com/monitoring/monitoring/api/api/metrics/metrics_gcp 但是由于我没有监视的经验,因此该文档令人困惑。

I am looking for a Google REST endpoint or SDK that will report the quota usage of a specific project and Google API. For example, if I write a query like

{
  "project": "my-project",
  "api": "searchconsole.googleapis.com",
  "function": "/urlInspection/index:inspect"
}

it will return the quota usage for that API, e.g.

{
  "qpd": {
    "used": 20,
    "limit": 200
  }
}

I've found this SO post from 2018 that uses a timeseries query to monitoring.googleapis.com, but it seems "hacky" and as it's old, I'm wondering if there's a better way. I tried looking into https://cloud.google.com/monitoring/api/metrics_gcp but as I have no prior experience with monitoring, the documentation is confusing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文