Methods
public instance
Public instance methods
destroy_images
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 31 31: def destroy_images 32: li Rudy::AWS::EC2::Images.deregister(@argv.ami) ? "Done" : "Unknown error" 33: end
destroy_images_valid?
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 25 25: def destroy_images_valid? 26: unless @argv.ami && Rudy::Utils.is_id?(:image, @argv.ami) 27: raise "Must supply an AMI ID (ami-XXXXXXX)" 28: end 29: true 30: end
images
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 16 16: def images 17: unless @option.all 18: @option.owner ||= 'amazon' 19: li "Images owned by #{@option.owner.bright}" unless @argv.awsid 20: end 21: images = Rudy::AWS::EC2::Images.list(@option.owner, @argv) || [] 22: print_stobjects images 23: end
images_valid?
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 8 8: def images_valid? 9: if @option.owner == 'self' 10: raise "AWS_ACCOUNT_NUMBER not set" unless @@global.accountnum 11: @option.owner = @@global.accountnum 12: end 13: 14: true 15: end
register_images
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 41 41: def register_images 42: if @option.snapshot 43: opts = { 44: :name => @argv.first, 45: :architecture => @option.arch || 'i386', 46: :description => @option.description || 'Made with Rudy', 47: :root_device_name => "/dev/sda1", 48: :block_device_mapping => [{ 49: :device_name => "/dev/sda1", 50: :ebs_snapshot_id => @option.snapshot, 51: :ebs_delete_on_termination => true 52: }] 53: } 54: opts[:kernel_id] = @option.kernel if @option.kernel 55: opts[:ramdisk_id] = @option.ramdisk if @option.ramdisk 56: else 57: opts = { 58: :image_location => @argv.first 59: } 60: end 61: p opts if Rudy.debug? 62: li Rudy::AWS::EC2::Images.register(opts) 63: end
register_images_valid?
()
[show source]
# File lib/rudy/cli/aws/ec2/images.rb, line 35 35: def register_images_valid? 36: unless @argv.first 37: raise "Must supply a valid manifest path (bucket/ami-name.manifest.xml)" 38: end 39: true 40: end