Class: RightScaleCLI::MultiCloudImages

Inherits:
Thor
  • Object
show all
Defined in:
lib/rightscale_cli/multi_cloud_images.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ MultiCloudImages

Returns a new instance of MultiCloudImages.



26
27
28
29
30
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 26

def initialize(*args)
  super
  @client = RightScaleCLI::Client.new(options)
  @logger = RightScaleCLI::Logger.new()
end

Class Method Details



56
57
58
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 56

def self.banner(task, namespace = true, subcommand = false)
  "#{basename} #{task.formatted_usage(self, true, subcommand)}"
end

Instance Method Details

#create(name, description) ⇒ Object



47
48
49
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 47

def create(name, description)
  @client.create('multi_cloud_image', { :name => name, :description => description })
end

#destroy(multi_cloud_image_id) ⇒ Object



52
53
54
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 52

def destroy(multi_cloud_image_id)
  @client.destroy('multi_cloud_image', multi_cloud_image_id)
end

#listObject



36
37
38
39
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 36

def list()
  @logger.info('Retrieving all MultiCloud Images...')
  @client.render(@client.get('multi_cloud_images'), 'multi_cloud_images')
end

#show(multi_cloud_image_id) ⇒ Object



42
43
44
# File 'lib/rightscale_cli/multi_cloud_images.rb', line 42

def show(multi_cloud_image_id)
  @client.render(@client.show('multi_cloud_images', multi_cloud_image_id), 'multi_cloud_image')
end