Class: Chef::Knife::Cloud::VcairVmDelete

Inherits:
ServerDeleteCommand
  • Object
show all
Includes:
VcairHelpers, VcairServiceOptions, ServerDeleteOptions
Defined in:
lib/chef/knife/vcair_vm_delete.rb

Direct Known Subclasses

VcairServerDelete

Instance Method Summary collapse

Methods included from VcairHelpers

#config_value, #create_service_instance, #get_id, #msg_pair, #net, #network_config, #org, #template, #validate!, #vapp, #vdc, #vm

Methods included from VcairServiceOptions

included

Instance Method Details

#execute_commandObject



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/chef/knife/vcair_vm_delete.rb', line 35

def execute_command
  @name_args.each do |server_name|
    vapp = vdc.vapps.get_by_name(server_name)
    if vapp
      vapp.power_off
      vapp.undeploy
      vapp.destroy
    else
      ui.warn("No VApp named '#{server_name}' was found.")
    end
    delete_from_chef(server_name)
  end
end