Hi Folks
Within an particular organisation i have to automate the shutdown of all vApps
1. which are partially running and all VMs within the vAPP are Powered OFF or Suspended
2. count all running VMs within an entire ORG (many vCDs)
How can i realize this and how would be an API call using REST CLI script (using curl e.g.)?
For the action 2. i cannot see the posibility to call an vCD API call for VM state (running) can i realize this using VCD API or do i need access to vSphere API?
Thanks Dominik
You should be able to do this from REST API in vCD or PowerCLI (i think). REST API pseudo code would look something like this:
start script (input is org name or ID)
login to REST API as System Admin
use the query service to get a list of all vApps for a specific organization (you might have to parse multiple pages of results depending on how many vApps there are)
for each vApp in the array
move to next vApp
Logout of REST API
end script
shorter alternative is to just loop through each vApp and issue a power off command at the vApp level as well.
i guess it just depends on how you want to approach it.