Pulling vSphere World Metrics from VCF Operations via API
- Brock Peterson
- Aug 18
- 2 min read
vSphere World is a powerful construct in VCF Operations, I think of it as the bucket that contains everything. For example, maybe you want to see the number of Clusters, ESXi Hosts, and VMs in your environment. Those are just metrics on the vSphere World object, like this.

You can pull these metrics from the VCF Operations API surface, here's how. Go to https://vcfoperationsfqdnhere/suite-api and authenticate.

There are other ways to do this, which we've discussed previously here. Once authenticated, you'll need the vSphere World ResourceId, which you can find via GET /api/resources with the ResourceKind of vSphere World. My call looks like this.

Scroll down and click Execute to run it, which will give you the associated Curl command as well.

The identifier is at the bottom, this is what we'll use to get the metrics we want from vSphere World, but first we need to determine the StatKeys, which I think of as the metrics themselves. Do this with GET /api/resources/statkeys and your resourceId, mine looks like this. Note: you can use the searchstring field if you know what you want, for example I might have used total here.

We now have the StatKeys for the metrics we want:
- Clusters: summary|total_number_clusters 
- ESXi Hosts: summary|total_number_hosts 
- VMs: summary|total_number_vms 
Now we can get the latest values for them by using GET /api/resources/stats/latest as follows.

Notice I provided the resourceId for vSphere World and the statKeys we previously captured.

Click Execute and you'll be given the latest values (along with the Curl command if you wany to use that elsewhere).

Now if you compare these to the latest values in the UI, they match!

This same methodology can be used to pull metrics/properties against any object you want. Use the VCF Operations API, it's powerful!