I am new to using the vrops rest api. I am trying to get a list of vm's for a host including the powered off ones. What I've noticed is that it only gives the running vm's. I would start by
getting the resources for the host via the resourceid, for example, "https://vrops_server/suite-api/api/resources/id_number", then to get the vm's, I would use the "relationsofResource" link that it returned. I see all the running vm's but not the powered off ones. Would anyone know how to achieve this?
thanks in advance,
Actually, I just found out all the unlisted vm's are "templates". Is there a way in the vrops rest api, to list out the templates for a host?
It's odd... I don't see any relationship between the templates and their host in vROps. Using relationsofResource is the right idea, but doesn't look like it will work for templates. You could try using the property "summary|parentHost". This is getting both VMs and templates for me. You'll have to query by the hostname as it appears in vROps like this:
If you want to handle the templates separately you can get all the templates using the isTemplate property:
And then get the parent host property for each template.