def delete_server(name, expunge)
      server = get_server(name)
      if !server || !server['id'] then
        puts "\nError: Virtual machine '#{name}' does not exist"
        exit 1
      end

      params = {
          'command' => 'destroyVirtualMachine',
          'id' => server['id'],
          'expunge' => expunge
      }

      json = send_async_request(params)
      json['virtualmachine']
    end
def delete_server(name, expunge)
      server = get_server(name)
      if !server || !server['id'] then
        puts "\nError: Virtual machine '#{name}' does not exist"
        exit 1
      end

      params = {
          'command' => 'destroyVirtualMachine',
          'id' => server['id'],
          'expunge' => expunge
      }

      json = send_async_request(params)
      json['virtualmachine']
    end
Deletes the server with the specified name.