Module: EC2M
Constant Summary collapse
- VERSION =
'0.1'
- API_VERSION =
'2009-04-04'
- COMMANDS =
%w(ami_id ami_launch_index ami_manifest_path hostname instance_action instance_id instance_type kernel_id local_hostname local_ipv4 public_hostname public_ipv4 ramdisk_id reservation_id)
Instance Method Summary collapse
- #ancestor_ami_ids ⇒ Object
- #availability_zone ⇒ Object
- #block_device_mapping(device = nil) ⇒ Object
- #get(name) ⇒ Object
- #public_keys ⇒ Object
Instance Method Details
#ancestor_ami_ids ⇒ Object
23 24 25 |
# File 'lib/ec2meta.rb', line 23 def ancestor_ami_ids get('ancestor-ami-ids').split end |
#availability_zone ⇒ Object
27 28 29 |
# File 'lib/ec2meta.rb', line 27 def availability_zone get 'placement/availability-zone' end |
#block_device_mapping(device = nil) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/ec2meta.rb', line 31 def block_device_mapping device=nil if device get "block-device-mapping/#{device}" else get('block-device-mapping/').split end end |
#get(name) ⇒ Object
9 10 11 12 |
# File 'lib/ec2meta.rb', line 9 def get name path = [API_VERSION, 'meta-data', name].join '/' Net::HTTP.get '169.254.169.254', path end |
#public_keys ⇒ Object
39 40 41 |
# File 'lib/ec2meta.rb', line 39 def public_keys raise "Not implemented" end |