Reputation: 121
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.
Upvotes: 2
Views: 1997
Reputation: 14112
As @guillaume blaquiere
currently there is no way to count vCPU
using GCP API. You can create Feature 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:
sumUpvotes: 0