#How to use API to filter bytes.used?

1 messages · Page 1 of 1 (latest)

fiery needle
#

Hi All,
I am using the following API url:
https://cluster/api/storage/volumes/{{vol_uuid))/files/%2F{{path}}?fields=name,path,analytics.bytes_used,size,type,owner_id,group_id,unix_permissions&order_by=analytics.bytes_used+desc,size+desc&is_snapshot=false&return_timeout=30&max_records=1000

This is what I need:
In some specific paths, there are over 10000 records,
And I need to order them by analytics.bytes_used
And I need only 1000 top data.

After running this API, it takes too much time.
I assume that it is because it needs to sort all the 10000+ records and then extract the top 1000 records.
We do not have the option to filter something like analytics.bytes_used > 1TB right?
Any suggestion to shorten the API request time?

fringe void
#

Hi Tony, you should be able to filter by size. This example below should work:

https://cluster/api/storage/volumes/{{vol_uuid))/files/%2F%7B%7Bpath%7D%7D?fields=name,path,analytics.bytes_used,size,type,owner_id,group_id,unix_permissions&analytics.bytes_used.size>1000000000000&order_by=analytics.bytes_used+desc,size+desc&is_snapshot=false