Easy way to backup all VMs via the API, without enumerating them one by one?

victorhooi

Well-Known Member
Apr 3, 2018
255
20
58
38
Hi,

We have a test lab for users to spin up VMs on demand.

Is there an easy way to call backup on all created VMs, without needing to explicitly specify the set?

(As a hack, I assume we can enumerate the VMs using the API, and then call backup individually on each one - but I wondered if there was perhaps a cleaner way, to just do a bulk "backup all my VMs please!")

Regards,
Victor
 
you can simply copy a curl command from your browser's dev console and adapt it..
 
Update: Nevermind... don't know why didn't work before but trying it again by adding vmids as a parameters works.

--

Is it possible with one curl command to copy several vmid using the API? I would like to replicate same behaviour than a backup job but with API. Now I have one curl per each backup and would like to simplify it a bit.
I tried to add vmid=XXX&vmid=YYY and so on but only first one is back it up.
 
Last edited: