Class: Nephophobia::Response::Compute
- Inherits:
-
Object
- Object
- Nephophobia::Response::Compute
- Defined in:
- lib/nephophobia/response/compute.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#dns_name ⇒ Object
readonly
Returns the value of attribute dns_name.
-
#image_id ⇒ Object
readonly
Returns the value of attribute image_id.
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#instance_type ⇒ Object
readonly
Returns the value of attribute instance_type.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#key_name ⇒ Object
readonly
Returns the value of attribute key_name.
-
#launch_time ⇒ Object
readonly
Returns the value of attribute launch_time.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#placement ⇒ Object
readonly
Returns the value of attribute placement.
-
#private_dns_name ⇒ Object
readonly
Returns the value of attribute private_dns_name.
-
#private_ip_address ⇒ Object
readonly
Returns the value of attribute private_ip_address.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#public_dns_name ⇒ Object
readonly
Returns the value of attribute public_dns_name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Compute
constructor
A new instance of Compute.
Constructor Details
#initialize(attributes) ⇒ Compute
Returns a new instance of Compute.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/nephophobia/response/compute.rb', line 11 def initialize attributes @attributes = attributes @project_id = attributes['ownerId'] item = attributes['instancesSet']['item'] item = item.first if item.is_a?(Array) @description = item['displayDescription'] @name = item['displayName'] @key_name = item['keyName'] @instance_id = item['instanceId'] @ip_address = item['ipAddress'] @state = item['instanceState']['name'] @public_dns_name = item['publicDnsName'] @private_dns_name = item['privateDnsName'] @private_ip_address = item['privateIpAddress'] @image_id = item['imageId'] @dns_name = item['dnsName'] @launch_time = DateTime.parse(item['launchTime']) @placement = item['placement']['availabilityZone'] @instance_type = item['instanceType'] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
9 10 11 |
# File 'lib/nephophobia/response/compute.rb', line 9 def attributes @attributes end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/nephophobia/response/compute.rb', line 4 def description @description end |
#dns_name ⇒ Object (readonly)
Returns the value of attribute dns_name.
4 5 6 |
# File 'lib/nephophobia/response/compute.rb', line 4 def dns_name @dns_name end |
#image_id ⇒ Object (readonly)
Returns the value of attribute image_id.
4 5 6 |
# File 'lib/nephophobia/response/compute.rb', line 4 def image_id @image_id end |
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id.
4 5 6 |
# File 'lib/nephophobia/response/compute.rb', line 4 def instance_id @instance_id end |
#instance_type ⇒ Object (readonly)
Returns the value of attribute instance_type.
4 5 6 |
# File 'lib/nephophobia/response/compute.rb', line 4 def instance_type @instance_type end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
7 8 9 |
# File 'lib/nephophobia/response/compute.rb', line 7 def ip_address @ip_address end |
#key_name ⇒ Object (readonly)
Returns the value of attribute key_name.
5 6 7 |
# File 'lib/nephophobia/response/compute.rb', line 5 def key_name @key_name end |
#launch_time ⇒ Object (readonly)
Returns the value of attribute launch_time.
5 6 7 |
# File 'lib/nephophobia/response/compute.rb', line 5 def launch_time @launch_time end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/nephophobia/response/compute.rb', line 5 def name @name end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
5 6 7 |
# File 'lib/nephophobia/response/compute.rb', line 5 def owner_id @owner_id end |
#placement ⇒ Object (readonly)
Returns the value of attribute placement.
5 6 7 |
# File 'lib/nephophobia/response/compute.rb', line 5 def placement @placement end |
#private_dns_name ⇒ Object (readonly)
Returns the value of attribute private_dns_name.
6 7 8 |
# File 'lib/nephophobia/response/compute.rb', line 6 def private_dns_name @private_dns_name end |
#private_ip_address ⇒ Object (readonly)
Returns the value of attribute private_ip_address.
7 8 9 |
# File 'lib/nephophobia/response/compute.rb', line 7 def private_ip_address @private_ip_address end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/nephophobia/response/compute.rb', line 6 def project_id @project_id end |
#public_dns_name ⇒ Object (readonly)
Returns the value of attribute public_dns_name.
6 7 8 |
# File 'lib/nephophobia/response/compute.rb', line 6 def public_dns_name @public_dns_name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/nephophobia/response/compute.rb', line 6 def state @state end |