1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloud/examples/more_on_vapps.md

24 lines
716 B
Markdown
Raw Normal View History

# More on vApps
## Checking running or stopped
selected_vapp = connection.servers.service.vapps.detect { |n| n.name == 'vapp-name' }
selected_vapp.on?
selected_vapp.off?
## Wait for app to come up or stop
selected_vapp.wait_for { selected_vapp.on? }
selected_vapp.wait_for { selected_vapp.off? }
## Delete vApp
selected_vapp = connection.servers.service.vapps.detect { |n| n.name == 'vapp-name' }
vapp = connection.servers.service.get_vapp(selected_vapp.href)
if vapp.on?
vapp.service.undeploy selected_vapp.href #undeploy to stop vApp
vapp.wait_for { vapp.off? }
end
vapp.wait_for { vapp.off? } #double check
vapp.service.delete_vapp selected_vapp.href