top of page

Pull Cluster Capacity Remaining % via Aria Operations API

Brock Peterson

In the previous blog we talked about Cluster Capacity Remaining in Aria Operations and ultimately showed this to be a metric on the Cluster itself.

Can I access this metric via API, sure can, here's how! First, let's find our Cluster by running a GET /api/resources or alternatively this curl command (you'll need your own OpsToken).

curl -X GET "https://10.167.244.218/suite-api/api/resources?page=0&pageSize=1000&resourceKind=ClusterComputeResource&_no_links=true" -H  "accept: application/json" -H  "Authorization: OpsToken 98c5b2a0-1517-4104-9895-fd3faf5b77cc::10eccfb9-1cda-4f33-9ccd-eb25d18c0ef5"

In the Swagger UI it's this endpoint

If you're using Postman, it might look like this.

Scrolling through the Response Body, our Cluster is this one.



In Postman it looks like this.



Now that we have our resourceId, we need to determine the Key of the metric which we will then map to the statKey in order to pull its value via GET /api/resource/stats. You can find Operations metrics and their keys here, we're looking for Cluster Capacity Analytics Percent Remaining.

As you can see the Key is capacityRemainingPercentage, which we need to map to a statKey by exploring the available Cluster statKeys with GET /api/resources/statkeys.

In Postman it looks like this.

Our statKey is this: OnlineCapacityAnalytics|capacityRemainingPercentage, so let's go get the value via GET /api/resource/stats.

It'll look like this in Postman.

Let's compare the metric values in Operations to what we get via API, here they are.

You'll notice as I view the metric in Operations, both the Swagger API on the left and the Postman returns on the right are the same. This is how you get Cluster Capacity Remaining Percentage, you can use this same methodology for any Object Type and Metric or Property, enjoy!


Comments


    bottom of page