class CORL::Node::Rackspace
Public Instance Methods
create(options = {})
click to toggle source
Calls superclass method
# File lib/CORL/node/rackspace.rb 57 def create(options = {}) 58 super do |op, config| 59 if op == :config 60 config.defaults(create_config) 61 end 62 end 63 end
create_config()
click to toggle source
# File lib/CORL/node/rackspace.rb 50 def create_config 51 { :name => hostname, :flavor_id => machine_type, :image_id => image } 52 end
image_search_text(image)
click to toggle source
# File lib/CORL/node/rackspace.rb 96 def image_search_text(image) 97 sprintf("%s %s %s", image_id(image), image.name, image.state) 98 end
machine_config()
click to toggle source
Calls superclass method
# File lib/CORL/node/rackspace.rb 34 def machine_config 35 super do |config| 36 config.import({ 37 :provider => 'rackspace', 38 :version => :v2, 39 :rackspace_region => region 40 }) 41 42 config[:rackspace_username] = api_user if api_user 43 config[:rackspace_api_key] = api_key if api_key 44 config[:rackspace_auth_url] = auth_url if auth_url 45 end 46 end
normalize(reload)
click to toggle source
Calls superclass method
# File lib/CORL/node/rackspace.rb 9 def normalize(reload) 10 super do 11 region_info.import({ 12 :dfw => 'Dallas', 13 :ord => 'Chicago', 14 :lon => 'London (for UK accounts)' 15 }) 16 # Return machine provider 17 :rackspace 18 end 19 end
render_image(image)
click to toggle source
# File lib/CORL/node/rackspace.rb 90 def render_image(image) 91 sprintf("%-47s [ %-10s ] %s", purple(image_id(image)), blue(image.state), yellow(image.name)) 92 end
render_machine_type(machine_type)
click to toggle source
# File lib/CORL/node/rackspace.rb 78 def render_machine_type(machine_type) 79 sprintf("%-30s %-35s [ VCPUS: %-5s ] ( RAM: %6sMB | DISK: %4sGB )", 80 purple(machine_type_id(machine_type)), 81 yellow(machine_type.name), 82 blue(machine_type.vcpus.to_s), 83 blue(machine_type.ram.to_s), 84 blue(machine_type.disk.to_s) 85 ) 86 end
start(options = {})
click to toggle source
Calls superclass method
# File lib/CORL/node/rackspace.rb 67 def start(options = {}) 68 super do |op, config| 69 if op == :config 70 config.defaults(create_config) 71 end 72 end 73 end
usable_image?(image)
click to toggle source
# File lib/CORL/node/rackspace.rb 24 def usable_image?(image) 25 image.state != 'DELETED' 26 end