I need to list all the snapshots in all my containers. I am about to write a script (awk, golang or else) to extract out and parse the snapshots table that is displayed at the end of 'lxc info '.
However, I am wondering if there is something that me and my googling missed.
Ideally a command that would give out a snapshot list in a parsable format (json or similar), or an API that I could use in a go program.
Hi lyderic,
It is not an elegant method, it is a little bit old school way. for k in $(lxc ls -c"n" -fcsv) ; do curl -s --unix-socket /var/snap/lxd/common/lxd/unix.socket a/1.0/instances/$k/snapshots? | jq .metadata[]; done
Thanks for the source code by the way.
Regards.