ONTAP Rest API Discussions

Is it possible to retrieve write,read and others IOPs at node level using Netapp Storage REST APIs

Juluri
2,512 Views

I am looking to retrieve write,read and others IOPs at node level using NetApp Storage REST APIs , Usually we get IOPs info on Oncommand unified manager or grafana , I am trying to automate however I couldn't find anything on this in REST APIs documentation,  Any idea how to do this. Kindly help.Thanks.

2 REPLIES 2

RobertBlackhart
2,348 Views

There are several metrics APIs depending on the object you are interested in. For example, if you want to see IOPs on aggregates, you could use the GET /storage/aggregates/{uuid}/metrics endpoint or for luns would be GET /storage/luns/{uuid}/metrics. These endpoints existing for clusters running ONTAP 9.7 or above.

 

You can see from the URL that they require asking about a specific object. There is no node level call that lets you summarize them all automatically. You could write your script to do this however. It might be something like this:

 

from netapp_ontap import HostConnection, config
from netapp_ontap.resources import Aggregate, PerformanceMetric

config.CONNECTION = HostConnection("1.2.3.4", username="admin", password="pass123", verify=False)

# get a list of all of the aggregate uuids on node1
node_name = "node1"
aggregate_uuids = [aggr.uuid for aggr in Aggregate.get_collection(**{"node.name": node_name})]

# for each aggregate, find its total IOPs and add it to the sum
total_iops = 0
for uuid in aggregate_uuids:
    total_iops += sum([m.iops.total for m in PerformanceMetric.get_collection(uuid, fields="iops.total")])

print(f"Total IOPs for node {node_name} is {total_iops}")

 

This example uses the netapp-ontap library (download, docs).

Juluri
2,318 Views

Thank you Robert for checking this and sharing your thoughts.

Public