Sort by integer doesnt seem to work on API call. Any ideas?

Hello,

I am working on an API call to show datastores in a vmware environment and I would like to sort by free space. Showing the datastores with the most space available first.

https://cloudforms.local/api/data_stores?expand=resources&attributes=id,name,free_space&filter[]=name!=‘datastore%’&filter[]=name!=‘epe%’&sort_by=free_space&sort_order=descending

Only thing I can think of is to try desc instead of descending, but otherwise it looks correct. @abellotti?

Just tried it locally, yes, sort_order=desc will do the trick.

Woohoo! YEP, that worked!! Thanks a million

1 Like