ONTAP Rest API Discussions

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

kbhonagiri
1,520 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
1,464 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
1,465 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
1,438 Views

Thanks that helps

Public