Class: Chef::Knife::ClcServerPowerOn

Inherits:
Chef::Knife show all
Includes:
ClcBase
Defined in:
lib/chef/knife/clc_server_power_on.rb

Instance Method Summary collapse

Methods included from ClcBase

included

Instance Method Details

#executeObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/chef/knife/clc_server_power_on.rb', line 23

def execute
  ui.info 'Requesting server power on...'
  links = connection.power_on_server(name_args[0])

  if config[:clc_wait]
    connection.wait_for(links['operation']['id']) { putc '.' }
    ui.info "\n"
    ui.info 'Server has been powered on'
  else
    ui.info 'Power on request has been sent'
    ui.info "You can check power on operation status with 'knife clc operation show #{links['operation']['id']}'"
  end
end

#parse_and_validate_parametersObject



17
18
19
20
21
# File 'lib/chef/knife/clc_server_power_on.rb', line 17

def parse_and_validate_parameters
  unless name_args[0]
    errors << 'Server ID is required'
  end
end