Method: Oceanarium::Droplet.action
- Defined in:
- lib/oceanarium/resources/droplet.rb
.action(id, action) ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/oceanarium/resources/droplet.rb', line 131 def self.action(id, action) # Performs single action to a Droplet. Returns status OK or Error @approved_actions = ['reboot', 'power_cycle', 'shutdown', 'power_off', 'power_on', 'password_reset', 'enable_backups', 'disable_backups', 'destroy'] if @approved_actions.include? action @request = Oceanarium::Request.new @get = @request.get("/droplets/#{id}/#{action}") @get.parsed_response['status'] else 'ERROR' end end |