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
68 69 70 |
# File 'lib/rightscale_cli/clouds.rb', line 68 def self.(task, namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#list ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/rightscale_cli/clouds.rb', line 28 def list() rightscale = RightApi::Client.new(RightScaleCLI::Config::API) clouds = [] rightscale.clouds.index.each { |cloud| clouds.push(cloud.raw) } puts clouds.to_yaml end |
#search ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rightscale_cli/clouds.rb', line 48 def search() log = CLILogger.new 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
38 39 40 41 42 |
# File 'lib/rightscale_cli/clouds.rb', line 38 def show(cloud_id) rightscale = RightApi::Client.new(RightScaleCLI::Config::API) cloud = rightscale.clouds(:id => cloud_id).show.raw puts cloud.to_yaml end |