storage pools, I can get total size and usage in one run:
/1.0/storage-pools/{name}/resources
{
"metadata": {
"inodes": {
"total": 30709993797,
"used": 23937695
},
"space": {
"total": 420100937728,
"used": 343537419776
}
},
storage volumes, to get similar results, need to run:
/1.0/storage-pools/{name}/volumes/{type}/{volume}
{
"metadata": {
"config": {
"size": "50GiB",
"zfs.remove_snapshots": "true"
},
and
/1.0/storage-pools/{name}/volumes/{type}/{volume}/state
{
"metadata": {
"usage": {
"used": 1693552640
}
},
Would be nice getting total and used in one query for storage volumes as well.
perhaps:
/1.0/storage-pools/{name}/volumes/{type}/{volume} recursion=1
or
/1.0/storage-pools/{name}/volumes/{type}/{volume}/state
would show total
or size
as well.
I recall a similar thread, where fetching size or used were considered expensive for some filesystems, yet zfs could deliver above with no efforts.