Class: EY::Metadata::AmazonEc2Api
- Inherits:
-
Object
- Object
- EY::Metadata::AmazonEc2Api
- Defined in:
- lib/engineyard-metadata/amazon_ec2_api.rb
Overview
An adapter that reads from Amazon EC2’s metadata web service, which is only available from cloud instances.
Instance Method Summary collapse
-
#present_instance_id ⇒ Object
The present instance’s Amazon Ec2 instance id.
-
#present_security_group ⇒ Object
The present instance’s Amazon Ec2 security group.
Instance Method Details
#present_instance_id ⇒ Object
The present instance’s Amazon Ec2 instance id.
8 9 10 |
# File 'lib/engineyard-metadata/amazon_ec2_api.rb', line 8 def present_instance_id @present_instance_id ||= eat('http://169.254.169.254/latest/meta-data/instance-id') end |
#present_security_group ⇒ Object
The present instance’s Amazon Ec2 security group.
13 14 15 |
# File 'lib/engineyard-metadata/amazon_ec2_api.rb', line 13 def present_security_group @present_security_group ||= eat('http://169.254.169.254/latest/meta-data/security-groups') end |