Class: OpsWorks::Instance
Instance Attribute Summary collapse
-
#ec2_instance_id ⇒ Object
Returns the value of attribute ec2_instance_id.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#id ⇒ Object
Returns the value of attribute id.
-
#instance_type ⇒ Object
Returns the value of attribute instance_type.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
Constructor Details
This class inherits a constructor from OpsWorks::Resource
Instance Attribute Details
#ec2_instance_id ⇒ Object
Returns the value of attribute ec2_instance_id.
5 6 7 |
# File 'lib/opsworks/instance.rb', line 5 def ec2_instance_id @ec2_instance_id end |
#hostname ⇒ Object
Returns the value of attribute hostname.
5 6 7 |
# File 'lib/opsworks/instance.rb', line 5 def hostname @hostname end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/opsworks/instance.rb', line 5 def id @id end |
#instance_type ⇒ Object
Returns the value of attribute instance_type.
5 6 7 |
# File 'lib/opsworks/instance.rb', line 5 def instance_type @instance_type end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/opsworks/instance.rb', line 5 def status @status end |
Class Method Details
.from_collection_response(response) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/opsworks/instance.rb', line 7 def self.from_collection_response(response) response.data[:instances].map do |hash| new( id: hash[:instance_id], hostname: hash[:hostname], ec2_instance_id: hash[:ec2_instance_id], instance_type: hash[:instance_type], status: hash[:status] ) end end |
Instance Method Details
#online? ⇒ Boolean
19 20 21 |
# File 'lib/opsworks/instance.rb', line 19 def online? status == 'online' end |