How to get used VCPU's by calling API

0

I would like to call the API to get back the number of VCPU's used by all running instances in the region, so I can run some preflight checks before I create new instances, to see if there are enough VCPU's available, without increasing the quota. Is there a way to do that, instead of iterating all vm instances and getting their used VCPU's? Thanks!

已提问 2 年前228 查看次数
1 回答
0

I think you can find the code to do this in this solution: AWS Limit Monitor.

profile pictureAWS
专家
kentrad
已回答 2 年前
  • Could not find it. Could you please be more specific? I have also found that I can do: 'client.servicequotasClient.GetServiceQuota(ctx, &servicequotas.GetServiceQuotaInput{ QuotaCode: aws.String(quotaCode), ServiceCode: aws.String(serviceCode)})' However, the returned quota value, is the current limit. But not the utilization, which I need.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则