Class: Rudy::CLI::AWS::EC2::Images
Instance Attribute Summary
Attributes inherited from CommandBase
#config
Instance Method Summary
collapse
Methods included from Huxtable
config, #config_dirname, create_domain, #current_group_name, #current_machine_address, #current_machine_bucket, #current_machine_count, #current_machine_group, #current_machine_hostname, #current_machine_image, #current_machine_name, #current_machine_os, #current_machine_size, #current_machine_user, #current_user_keypairname, #current_user_keypairpath, #defined_keypairpath, domain, domain_exists?, global, keypair_path_to_name, #known_machine_group?, ld, #ld, #le, le, li, #li, logger, reset_config, reset_global, #root_keypairname, #root_keypairpath, update_config, update_global, update_logger, #user_keypairname, #user_keypairpath
Instance Method Details
#destroy_images ⇒ Object
33
34
35
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 33
def destroy_images
li Rudy::AWS::EC2::Images.deregister(@argv.ami) ? "Done" : "Unknown error"
end
|
#destroy_images_valid? ⇒ Boolean
27
28
29
30
31
32
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 27
def destroy_images_valid?
unless @argv.ami && Rudy::Utils.is_id?(:image, @argv.ami)
raise "Must supply an AMI ID (ami-XXXXXXX)"
end
true
end
|
#images ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 16
def images
unless @option.all
@option.owner ||= 'amazon'
li "Images owned by #{@option.owner.bright}" unless @argv.awsid
end
images = Rudy::AWS::EC2::Images.list(@option.owner, @argv) || []
print_stobjects images
end
|
#images_valid? ⇒ Boolean
8
9
10
11
12
13
14
15
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 8
def images_valid?
if @option.owner == 'self'
raise "AWS_ACCOUNT_NUMBER not set" unless @@global.accountnum
@option.owner = @@global.accountnum
end
true
end
|
#register_images ⇒ Object
43
44
45
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 43
def register_images
li Rudy::AWS::EC2::Images.register(@argv.first)
end
|
#register_images_valid? ⇒ Boolean
37
38
39
40
41
42
|
# File 'lib/rudy/cli/aws/ec2/images.rb', line 37
def register_images_valid?
unless @argv.first
raise "Must supply a valid manifest path (bucket/ami-name.manifest.xml)"
end
true
end
|