distinguish VM from template via api

luphi

Renowned Member
Nov 9, 2015
83
5
73
Hello all,

is there a way to identify by the API, which VMs are templates or not?

Cheers,
Martin
 
in the api call /cluster/resources you can look for 'template' it should be 1 on templates, 0 otherwise
e.g. with pvesh

Code:
pvesh get /cluster/resources -type vm --output-format json | jq '.[] | select(.template == 1)'