Module: OnlyofficeDigitaloceanWrapper::PowerActions
- Included in:
- DigitalOceanWrapper
- Defined in:
- lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/power_actions.rb
Overview
Actions with power (turn on/off, reboot)
Instance Method Summary collapse
-
#power_off_droplet(droplet_name) ⇒ Symbol
Turn off droplet.
-
#power_on_droplet(droplet_name) ⇒ Symbol
Turn on droplet.
-
#reboot_droplet(droplet_name) ⇒ Symbol
Reboot droplet.
Instance Method Details
#power_off_droplet(droplet_name) ⇒ Symbol
Turn off droplet
9 10 11 12 13 |
# File 'lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/power_actions.rb', line 9 def power_off_droplet(droplet_name) droplet_id = get_droplet_id_by_name(droplet_name) client.droplet_actions.power_off(droplet_id: droplet_id) wait_until_droplet_have_status(droplet_name, 'off') end |
#power_on_droplet(droplet_name) ⇒ Symbol
Turn on droplet
18 19 20 21 22 |
# File 'lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/power_actions.rb', line 18 def power_on_droplet(droplet_name) droplet_id = get_droplet_id_by_name(droplet_name) client.droplet_actions.power_on(droplet_id: droplet_id) wait_until_droplet_have_status(droplet_name) end |
#reboot_droplet(droplet_name) ⇒ Symbol
Reboot droplet
27 28 29 30 31 |
# File 'lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/power_actions.rb', line 27 def reboot_droplet(droplet_name) droplet_id = get_droplet_id_by_name(droplet_name) client.droplet_actions.reboot(droplet_id: droplet_id) wait_until_droplet_have_status(droplet_name) end |