The fastest way to sort in chronological order is to request only names and createtxg and order by the latter.
Appreciate the replies!
I'm testing this against my backup server so no worries.
I probably should have specified that I'm using the REST API, right.
This is going to be used for Nagios monitoring checks eventually, but right now I'm just playing around with the functions in the API I want to use to get a better idea of how they work.
This command works:
curl -vk -H "Content-Type: application/json" -H "Authorization: Bearer APIKEY" \ ─╯
-X GET "https://truenas.domain.com/api/v2.0/zfs/snapshot" \
-d '{"query-filters": [["dataset", "=", "Pool_1/personal"]],"query-options": { "extra": { "properties": "name, createtxg"}}}'
But adding the "sort" parameter makes it break, giving me a errno 22 response, "field was not expected."
curl -vk -H "Content-Type: application/json" -H "Authorization: Bearer APIKEY" \ ─╯
-X GET "https://truenas.domain.com/api/v2.0/zfs/snapshot" \
-d '{"query-filters": [["dataset", "=", "Pool_1/personal"]],"query-options": { "extra": { "properties": "name, createtxg"}, "sort": "createtxg"}}'
I also tried adding the parameter to the API URL like below, but same error.
https://truenas.domain.com/api/v2.0/zfs/snapshot?sort=createtxg