The NetApp Community is moving to a new platform and is in Read-Only mode. Click to learn more.
Stay connected during the transition - Join our Discord community today.

ONTAP Rest API Discussions

Looking for ONTAP API to get metrics of individual volume like last_accessed_time and last_io_acces_

kbhonagiri
2,824 Views

Hi Everyone,

 

I'm looking for ONTAP API to get metrics of individual volume like last_accessed_time and last_io_accessed_time similar . Thanks in advance

 

Kalyan

1 ACCEPTED SOLUTION

ddegraaf
2,768 Views

Hi,

There is no last_accessed_time variable for the whole volume, however you can get the access time from the FileInfo object and you could iterate over each FileInfo object in the volume to find the last_access_time for the whole volume. Something like this:

 

volume = FileInfo.get_collection(vol_uuid, return_metadata=True)
for file in volume:
if hasattr(file, "accessed_time"):
print(file.accessed_time)

 

Let me know if that helps!
Thanks,
Daniel

View solution in original post

2 REPLIES 2

ddegraaf
2,769 Views

Hi,

There is no last_accessed_time variable for the whole volume, however you can get the access time from the FileInfo object and you could iterate over each FileInfo object in the volume to find the last_access_time for the whole volume. Something like this:

 

volume = FileInfo.get_collection(vol_uuid, return_metadata=True)
for file in volume:
if hasattr(file, "accessed_time"):
print(file.accessed_time)

 

Let me know if that helps!
Thanks,
Daniel

kbhonagiri
2,742 Views

Thanks that helps

Public