xo-cli command list VMs which ha snapshots
-
Hey folks, i need some help:
Using WebUIi can list snapshots:snapshots:length:>2So how i could list snapshots use xo-cli command?
-
This command will provide a list of all existing snapshots --
xo-cli --list-objects type=VM-snapshotGuessing that you would need to take the results and process them for duplicate
$snapshot_ofproperties. -
Question for @julien-f I assume

-
@tadela Not possible,
xo-clidoes not support advanced filtering likexo-web. -
Another thing to add in the "interesting stuff" for a future public API
(pinging @marcungeschikts ) -
@julien-f Technically, it is possible with post processing as I mentioned above. Here's an example using
jqandawk--xo-cli --list-objects type=VM-snapshot | jq '.[]."$snapshot_of"' | sort | uniq -c | awk -F " " '{print "{\"uuid\":" $2 ",\"count\":" $1"}"}'| jq ' select( .count > 1)'Output looks like this --
{ "uuid": "07604606-e937-5147-2dac-c1b4280df234", "count": 2 } { "uuid": "0f11c701-c5e5-b09b-4c5f-00cf38153783", "count": 2 } { "uuid": "83139da5-48d5-33f6-79f9-79ea91a7163c", "count": 2 } { "uuid": "fb4703e4-bfd6-47b8-3fd1-f1f52f9ed234", "count": 2 } { "uuid": "ff8b29e3-4445-5b22-e475-450270f2a7f3", "count": 2 }Note: I am not proficient with these linux utilities so there may be better ways to accomplish this.

-
Nice! That's a pretty clear goal anyway, to provide this as more "turnkey"

-
I've added the support of advanced filtering in the API, it does no have first class support in
xo-cliyet but it's usable anyway:
xo-cli xo.getAllObjects limit=json:10 filter='type:/^VM$/ snapshots:length:>2'
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login