Class: RightScaleCLI::Clouds
- Inherits:
-
Thor
- Object
- Thor
- RightScaleCLI::Clouds
- Defined in:
- lib/rightscale_cli/clouds.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(task, namespace = true, subcommand = false) ⇒ Object
69 70 71 |
# File 'lib/rightscale_cli/clouds.rb', line 69 def self.(task, namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#list ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rightscale_cli/clouds.rb', line 27 def list() rightscale = RightApi::Client.new(RightScaleCLI::Config::API) clouds = [] $log.info "Retrieving all clouds from #{rightscale.account_id}." rightscale.clouds.index.each { |cloud| clouds.push(cloud.raw) } puts clouds.to_yaml end |
#search ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rightscale_cli/clouds.rb', line 50 def search() filter = [] filter.push("name==#{options[:name]}") if [:name] filter.push("cloud_type==#{options[:cloud_type]}") if [:cloud_type] filter.push("description==#{options[:cloud]}") if [:description] $log.info "Searching for clouds!" puts "filter: #{filter}" if [:debug] rightscale = RightApi::Client.new(RightScaleCLI::Config::API) clouds = [] rightscale.clouds.index(:filter => filter).each { |cloud| clouds.push(cloud.raw) } puts clouds.to_yaml end |
#show(cloud_id) ⇒ Object
40 41 42 43 44 |
# File 'lib/rightscale_cli/clouds.rb', line 40 def show(cloud_id) rightscale = RightApi::Client.new(RightScaleCLI::Config::API) cloud = rightscale.clouds(:id => cloud_id).show.raw puts cloud.to_yaml end |