Class: Awshark::Ec2::Instance
- Inherits:
-
Object
- Object
- Awshark::Ec2::Instance
- Defined in:
- lib/awshark/ec2/instance.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#private_ip_address ⇒ Object
readonly
Returns the value of attribute private_ip_address.
-
#public_dns_name ⇒ Object
readonly
Returns the value of attribute public_dns_name.
-
#public_ip_address ⇒ Object
readonly
Returns the value of attribute public_ip_address.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#subnet_id ⇒ Object
readonly
Returns the value of attribute subnet_id.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#vpc_id ⇒ Object
readonly
Returns the value of attribute vpc_id.
Instance Method Summary collapse
-
#initialize(instance) ⇒ Instance
constructor
A new instance of Instance.
- #name ⇒ Object
Constructor Details
#initialize(instance) ⇒ Instance
Returns a new instance of Instance.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/awshark/ec2/instance.rb', line 16 def initialize(instance) @id = instance.instance_id @type = instance.instance_type @state = instance.state.name @private_ip_address = instance.private_ip_address @public_ip_address = instance.public_ip_address @public_dns_name = instance.public_dns_name @vpc_id = instance.vpc_id @subnet_id = instance.subnet_id @tags = instance. end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/awshark/ec2/instance.rb', line 6 def id @id end |
#private_ip_address ⇒ Object (readonly)
Returns the value of attribute private_ip_address.
9 10 11 |
# File 'lib/awshark/ec2/instance.rb', line 9 def private_ip_address @private_ip_address end |
#public_dns_name ⇒ Object (readonly)
Returns the value of attribute public_dns_name.
11 12 13 |
# File 'lib/awshark/ec2/instance.rb', line 11 def public_dns_name @public_dns_name end |
#public_ip_address ⇒ Object (readonly)
Returns the value of attribute public_ip_address.
10 11 12 |
# File 'lib/awshark/ec2/instance.rb', line 10 def public_ip_address @public_ip_address end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
8 9 10 |
# File 'lib/awshark/ec2/instance.rb', line 8 def state @state end |
#subnet_id ⇒ Object (readonly)
Returns the value of attribute subnet_id.
13 14 15 |
# File 'lib/awshark/ec2/instance.rb', line 13 def subnet_id @subnet_id end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
14 15 16 |
# File 'lib/awshark/ec2/instance.rb', line 14 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/awshark/ec2/instance.rb', line 7 def type @type end |
#vpc_id ⇒ Object (readonly)
Returns the value of attribute vpc_id.
12 13 14 |
# File 'lib/awshark/ec2/instance.rb', line 12 def vpc_id @vpc_id end |
Instance Method Details
#name ⇒ Object
28 29 30 31 32 |
# File 'lib/awshark/ec2/instance.rb', line 28 def name tag_value(, 'Name').split(' - ').last rescue StandardError 'null' end |