2 Replies Latest reply on May 3, 2018 7:15 PM by kcross

    VROps API:  Mapping from a statkey instance to its resource

    kcross Lurker



      I'm attempting to use the API to extract some monitoring data about VM's.  I'm interested in getting the allocated space in a datastore for each VM.


      I can get the required stat for each datastore by first listing the statkeys for the VM, then running the query below for each statkey that matches config|hardware:*|disk_Space




      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <ops:stat-query xmlns:ops="http://webservice.vmware.com/vRealizeOpsMgr/1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


      I get a response back like this with the stats that I need:




      The issue I am facing is how do I resolve the statkey with instance, eg 3351 back to the datastore resource, or even just its name?  This happens in the UI, but I cannot figure out where the reference is