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!

asked 2 years ago225 views
1 Answer
0

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

profile pictureAWS
EXPERT
kentrad
answered 2 years ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions