Class: CloudFlock::App::ServerProfile

Inherits:
Object
  • Object
show all
Includes:
Common, Remote
Defined in:
lib/cloudflock/app/server-profile.rb

Overview

Public: The ServerProfile class provides the interface to produce profiles describing hosts running Unix-like operating systems as a CLI application.

Constant Summary

Constants included from Common

Common::DATA_DIR, Common::EXCLUSIONS, Common::MOUNT_POINT, Common::PRIVATE_KEY, Common::PUBLIC_KEY, Common::SSH_ARGUMENTS

Instance Method Summary collapse

Methods included from Common

#check_hostkey, #cleanup_destination, #cleanup_rackspace_server, #configure_ips, #define_compute_flavor, #define_compute_image, #define_compute_name, #define_destination, #define_host, #define_source, #determine_target_address, #filter_compute_flavors, #filter_compute_images, #generate_keypair, #generate_selection_table, #get_host_details, #managed_wait, #migrate_server, #provision_compute, #provision_wait, #remediate_ip, #rescue_compute, #restore_rackspace_users, #restore_user, #retry_prompt, #setup_destination, #setup_source, #ssh_connect, #transfer_rsync

Methods included from CloudFlock::App

#check_option, #check_option_fs, #check_option_pw, #check_option_yn

Methods included from Rackspace

#define_rackspace_api, #define_rackspace_cloudservers_region, #define_rackspace_files_region, #define_rackspace_region, #define_rackspace_service_region

Constructor Details

#initializeServerProfile

Public: Connect to and profile a remote host, then display the gathered information.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cloudflock/app/server-profile.rb', line 14

def initialize
  options = parse_options

  source_host = define_source(options)
  source_ssh = UI.spinner("Logging in to #{source_host[:hostname]}") do
    SSH.new(source_host)
  end

  profile = UI.spinner("Checking source host") do
    CloudFlock::Task::ServerProfile.new(source_ssh)
  end

  puts generate_report(profile)
  puts profile.process_list if options[:verbose]
end