NSX Edge dashboard statistics API query do not return exact value
search cancel

NSX Edge dashboard statistics API query do not return exact value

book

Article ID: 339122

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • NSX Edge dashboard statistics API query is do not return exact value

https://<NSX Mgr IP>/api/4.0/edges/<edge-id>/statistics/dashboard/interface?interval=<30>&startTime=<EEEE>&endTime=<####>

Environment

VMware NSX for vSphere 6.x

Resolution

  1. Real time type: if range is not specified, it will return 1 hour stats, with 20 seconds interval, so it will have 180 data returned. If range is specified, it will return range/20 data.
  2. Archive type: currently one-year, one-month, one-week and one-day supported, you can't specify the range with seconds but strings like "oneYear", "oneDay", etc.
    All of them will return fix number of data, for example, one-year will return 365 data, 1 data per day, one-month will return 360 data, 1 data per 2 hours, etc. You have to specify the query type in your API otherwise by default it's realtime type

    This input is either 1 - 60 minutes or 'oneDay|oneWeek|oneMonth|oneYear'

    For Example:

    https://192.168.110.42/api/4.0/edges/edge-2/statistics/dashboard/interface?interval=oneMonth

    <startTime>1487059200</startTime> “Tue, 14 Feb 2017 08:00:00 GMT”
    <endTime>1489651200</endTime> “Thu, 16 Mar 2017 08:00:00 GMT”
    <interval>7200</interval>