storagenetapp

Which API do I query to get system uptime using ontap API and Java?


I am using netapp-manageability-sdk-ontap-api-documentation and Java.

I just want to know API name to get storage systems uptime.

Can anybody answer with API name to which I query to storage system??


Solution

  • Do something like following: First find out counter name and if it matches to uptime then get assiciated value...

    PerfObjectGetInstancesRequest p = new PerfObjectGetInstancesRequest();
    PerfObjectGetInstancesResponse resp = apirunner.run(p.withObjectname("system"));
    Long uptime = null;
    for ( InstanceData instanceInfo : (resp.getInstances()) ) {
      for ( int i = 0 ; i < instanceInfo.getCounters().size() ; i++ ) {
        if ( instanceInfo.getCounters().get(i).getName().equalsIgnoreCase("uptime") ) {
          uptime = Long.parseLong(instanceInfo.getCounters().get(i).getValue());
        }
      }
    }