Class: Awsum::Ec2::Image
Instance Attribute Summary collapse
-
#architecture ⇒ Object
readonly
Returns the value of attribute architecture.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kernel_id ⇒ Object
readonly
Returns the value of attribute kernel_id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#product_codes ⇒ Object
readonly
Returns the value of attribute product_codes.
-
#public ⇒ Object
readonly
Returns the value of attribute public.
-
#ramdisk_id ⇒ Object
readonly
Returns the value of attribute ramdisk_id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#deregister ⇒ Object
Deregister this Image.
-
#initialize(ec2, id, location, state, owner, public, architecture, type, kernel_id, ram_disk_id, platform, product_codes) ⇒ Image
constructor
:nodoc:.
- #public? ⇒ Boolean
-
#reregister ⇒ Object
Reregister this image.
-
#run(options = {}) ⇒ Object
(also: #launch)
launches instances of this image.
Constructor Details
#initialize(ec2, id, location, state, owner, public, architecture, type, kernel_id, ram_disk_id, platform, product_codes) ⇒ Image
:nodoc:
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/awsum/ec2/image.rb', line 9 def initialize(ec2, id, location, state, owner, public, architecture, type, kernel_id, ram_disk_id, platform, product_codes) #:nodoc: @ec2 = ec2 @id = id @location = location @state = state @owner = owner @public = public @architecture = architecture @type = type @kernel_id = kernel_id @ramdisk_id = ram_disk_id @platform = platform @product_codes = product_codes end |
Instance Attribute Details
#architecture ⇒ Object (readonly)
Returns the value of attribute architecture.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def architecture @architecture end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def id @id end |
#kernel_id ⇒ Object (readonly)
Returns the value of attribute kernel_id.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def kernel_id @kernel_id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def location @location end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def owner @owner end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def platform @platform end |
#product_codes ⇒ Object (readonly)
Returns the value of attribute product_codes.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def product_codes @product_codes end |
#public ⇒ Object (readonly)
Returns the value of attribute public.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def public @public end |
#ramdisk_id ⇒ Object (readonly)
Returns the value of attribute ramdisk_id.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def ramdisk_id @ramdisk_id end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def state @state end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/awsum/ec2/image.rb', line 7 def type @type end |
Instance Method Details
#deregister ⇒ Object
Deregister this Image
29 30 31 |
# File 'lib/awsum/ec2/image.rb', line 29 def deregister @ec2.deregister_image @id end |
#public? ⇒ Boolean
24 25 26 |
# File 'lib/awsum/ec2/image.rb', line 24 def public? @public end |
#reregister ⇒ Object
Reregister this image
Will both deregister and then register the Image again
36 37 38 39 40 41 |
# File 'lib/awsum/ec2/image.rb', line 36 def reregister @ec2.deregister_image @id new_id = @ec2.register_image @location @id = new_id self end |
#run(options = {}) ⇒ Object Also known as: launch
launches instances of this image
Options:
-
:min
- The minimum number of instances to launch. Default: 1 -
:max
- The maximum number of instances to launch. Default: 1 -
:key_name
- The name of the key pair with which to launch instances -
:security_groups
- The names of security groups to associate launched instances with -
:user_data
- User data made available to instances (Note: Must be 16K or less, will be base64 encoded by Awsum) -
:instance_type
- The size of the instances to launch, can be one of [m1.small, m1.large, m1.xlarge, c1.medium, c1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, cc1.4xlarge, cg1.4xlarge, t1.micro], default is m1.small -
:availability_zone
- The name of the availability zone to launch this instance in -
:kernel_id
- The ID of the kernel with which to launch instances -
:ramdisk_id
- The ID of the RAM disk with which to launch instances -
:block_device_map
- A ‘hash’ of mappings. E.g. => ‘sdb’
56 57 58 |
# File 'lib/awsum/ec2/image.rb', line 56 def run( = {}) @ec2.run_instances(id, ) end |