Class: Chef::Knife::ClcIpDelete

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

Instance Method Summary collapse

Methods included from ClcBase

included

Instance Method Details

#executeObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/chef/knife/clc_ip_delete.rb', line 32

def execute
  ui.info 'Requesting IP deletion...'
  links = connection.delete_ip_address(config[:clc_server], name_args[0])

  if config[:clc_wait]
    connection.wait_for(links['operation']['id']) { putc '.' }
    ui.info "\n"
    ui.info 'IP address has been deleted'
    ui.info "You can look at new network configuration with `knife clc server show #{config[:clc_server]} --ports"
  else
    ui.info 'Deletion request has been sent'
    ui.info "You can check deletion operation status with 'knife clc operation show #{links['operation']['id']}'"
  end
end

#parse_and_validate_parametersObject



22
23
24
25
26
27
28
29
30
# File 'lib/chef/knife/clc_ip_delete.rb', line 22

def parse_and_validate_parameters
  unless name_args[0]
    errors << 'IP string is required'
  end

  unless config[:clc_server]
    errors << 'Server ID is required'
  end
end