如何通过GCP API获取总VCPU计数
我想调用GCP API
来获取vCPU的
总数。如果我的所有实例都使用 280 vCPU
,我希望在响应中获得 280。 我可以使用 “/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus”
通过 API 指标获取 vCPU
限制,但不是当前的vCPU
计数。 是否有用于此目的的监控 API?
感谢帮助。 谢谢。
I would like to call GCP API
call to get vCPU's
total count. If all my instances use 280 vCPUs
, I want to get 280 in the response.
I can get the vCPU
limit via the API metrics using "/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus"
, but not the current vCPU
count.
Is there a monitoring API for that purpose?
Help is appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于
@guillaume blaquiere
目前无法使用 GCP API 来计算vCPU
。如果您认为有帮助,可以通过 Google 问题跟踪器 创建功能请求
特征。作为解决方法,您可以使用
Cloud Monitoring
并使用 绘制单个指标类型的图表。在
Metrics Explorer
中,您需要选择:资源类型:
VM 实例指标:
预留 vCPU聚合器:
求和如下所示:

As
@guillaume blaquiere
currently there is no way to countvCPU
using GCP API. You can createFeature Request
via Google Issue Tracker if you think it could be beneficial feature.As a workaround, you can use
Cloud Monitoring
and use Chart a single metric type.In
Metrics Explorer
you would need to choose:Resource type:
VM InstanceMetric:
Reserved vCPUsAggregator:
sumIt would look like below:
