Additional instanced metrics returned when using the GET /api/resources/stats/latest API
search cancel

Additional instanced metrics returned when using the GET /api/resources/stats/latest API

book

Article ID: 400706

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

When using API call /api/resources/stats/latest/query with a VM resourceID and the statKey net|usage_average the API server returns not only the requested key net|usage_average, but also net:4000|usage_average, net:vmnic0|usage_average,net:vmnic1|usage_average... statkeys. Is there any way to prevent returning the extra keys?

Environment

VMware Aria Operations 8.x

Cause

The metrics boolean was not part of the API call and defaulted to a value of false. The metrics boolean indicates whether specified statKey-s of query should be forcibly treated as metrics (does not include instanced stats.)

Resolution

  1. Navigate in the UI to Home > Developer Center and click API Documentation
  2. Click Authorize and provide credentials
  3. Expand Resources and expand GET /api/resources/stats/latest
  4. Click Try it out
  5. Click the dropdown selector for the metrics boolen and select true
  6. Click Add Item for resourceID and type the resourceId(s) for a VM
  7. Click Add Item for statKey and type net|usage_average
  8. Click Execute