Class: RightScaleCLI::Clouds
- Inherits:
-
Thor
- Object
- Thor
- RightScaleCLI::Clouds
- Defined in:
- lib/rightscale_cli/clouds.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Clouds
constructor
A new instance of Clouds.
- #list ⇒ Object
- #search ⇒ Object
- #show(cloud_id) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Clouds
Returns a new instance of Clouds.
25 26 27 28 29 |
# File 'lib/rightscale_cli/clouds.rb', line 25 def initialize(*args) super @client = RightScaleCLI::Client.new() @logger = RightScaleCLI::Logger.new() end |
Class Method Details
.banner(task, namespace = true, subcommand = false) ⇒ Object
66 67 68 |
# File 'lib/rightscale_cli/clouds.rb', line 66 def self.(task, namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#list ⇒ Object
35 36 37 |
# File 'lib/rightscale_cli/clouds.rb', line 35 def list() @client.render(@client.get('clouds'), 'clouds') end |
#search ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rightscale_cli/clouds.rb', line 48 def search() filter = [] filter.push("name==#{[:name]}") if [:name] filter.push("cloud_type==#{[:cloud_type]}") if [:cloud_type] filter.push("description==#{[:cloud]}") if [:description] @logger.info "Searching for clouds!" puts "filter: #{filter}" if [:debug] clouds = [] @client.client.clouds.index(:filter => filter).each { |cloud| clouds.push(cloud.raw) } @client.render(clouds, 'clouds') end |
#show(cloud_id) ⇒ Object
40 41 42 |
# File 'lib/rightscale_cli/clouds.rb', line 40 def show(cloud_id) @client.render(@client.show('clouds', cloud_id), 'cloud') end |