Class: AWS::Instance
Class Method Summary collapse
Instance Method Summary collapse
- #address ⇒ Object
- #ami_launch_index ⇒ Object
-
#associate!(address_or_ip) ⇒ Object
TODO test TODO allow for address case TODO refresh attributes.
-
#attach!(volume_or_id, device) ⇒ Object
TODO test TODO also add to volume TODO allow for volume case.
- #aws_availability_zone ⇒ Object
- #aws_groups ⇒ Object
- #aws_image_id ⇒ Object
- #aws_instance_id ⇒ Object (also: #id)
- #aws_instance_type ⇒ Object
- #aws_kernel_id ⇒ Object
- #aws_launch_time ⇒ Object
- #aws_owner ⇒ Object
- #aws_product_codes ⇒ Object
- #aws_ramdisk_id ⇒ Object
- #aws_reason ⇒ Object
- #aws_reservation_id ⇒ Object
- #aws_state ⇒ Object
- #aws_state_code ⇒ Object
-
#detach!(volume_or_id) ⇒ Object
TODO test TODO also add to volume TODO allow for volume case.
- #dns_name ⇒ Object
- #image ⇒ Object
-
#initialize(attributes) ⇒ Instance
constructor
A new instance of Instance.
- #private_dns_name ⇒ Object
- #ssh_key_name ⇒ Object
-
#terminate! ⇒ Object
TODO test.
- #volumes ⇒ Object
Methods included from AWS
Constructor Details
#initialize(attributes) ⇒ Instance
Returns a new instance of Instance.
81 82 83 |
# File 'lib/aws_cloud_map.rb', line 81 def initialize(attributes) @attributes = attributes end |
Class Method Details
.all ⇒ Object
201 202 203 |
# File 'lib/aws_cloud_map.rb', line 201 def self.all @@ec2.describe_instances.map { |instance| new(instance) } end |
.find(instance_id) ⇒ Object
205 206 207 |
# File 'lib/aws_cloud_map.rb', line 205 def self.find(instance_id) new(@@ec2.describe_instances([instance_id]).first) end |
Instance Method Details
#address ⇒ Object
163 164 165 |
# File 'lib/aws_cloud_map.rb', line 163 def address #TODO end |
#ami_launch_index ⇒ Object
113 114 115 |
# File 'lib/aws_cloud_map.rb', line 113 def ami_launch_index @attributes[:ami_launch_index] end |
#associate!(address_or_ip) ⇒ Object
TODO test TODO allow for address case TODO refresh attributes
196 197 198 199 |
# File 'lib/aws_cloud_map.rb', line 196 def associate!(address_or_ip) @@ec2.associate_address(id, address_or_ip) @address = nil end |
#attach!(volume_or_id, device) ⇒ Object
TODO test TODO also add to volume TODO allow for volume case
180 181 182 183 |
# File 'lib/aws_cloud_map.rb', line 180 def attach!(volume_or_id, device) @@ec2.attach_volume(volume_or_id, id, device) @volumes = nil end |
#aws_availability_zone ⇒ Object
133 134 135 |
# File 'lib/aws_cloud_map.rb', line 133 def aws_availability_zone @attributes[:aws_availability_zone] end |
#aws_groups ⇒ Object
97 98 99 |
# File 'lib/aws_cloud_map.rb', line 97 def aws_groups @attributes[:aws_groups] end |
#aws_image_id ⇒ Object
137 138 139 |
# File 'lib/aws_cloud_map.rb', line 137 def aws_image_id @attributes[:aws_image_id] end |
#aws_instance_id ⇒ Object Also known as: id
141 142 143 |
# File 'lib/aws_cloud_map.rb', line 141 def aws_instance_id @attributes[:aws_instance_id] end |
#aws_instance_type ⇒ Object
93 94 95 |
# File 'lib/aws_cloud_map.rb', line 93 def aws_instance_type @attributes[:aws_instance_type] end |
#aws_kernel_id ⇒ Object
105 106 107 |
# File 'lib/aws_cloud_map.rb', line 105 def aws_kernel_id @attributes[:aws_kernel_id] end |
#aws_launch_time ⇒ Object
109 110 111 |
# File 'lib/aws_cloud_map.rb', line 109 def aws_launch_time @attributes[:aws_launch_time] end |
#aws_owner ⇒ Object
121 122 123 |
# File 'lib/aws_cloud_map.rb', line 121 def aws_owner @attributes[:aws_owner] end |
#aws_product_codes ⇒ Object
145 146 147 |
# File 'lib/aws_cloud_map.rb', line 145 def aws_product_codes @attributes[:aws_product_codes] end |
#aws_ramdisk_id ⇒ Object
129 130 131 |
# File 'lib/aws_cloud_map.rb', line 129 def aws_ramdisk_id @attributes[:aws_ramdisk_id] end |
#aws_reason ⇒ Object
149 150 151 |
# File 'lib/aws_cloud_map.rb', line 149 def aws_reason @attributes[:aws_reason] end |
#aws_reservation_id ⇒ Object
85 86 87 |
# File 'lib/aws_cloud_map.rb', line 85 def aws_reservation_id @attributes[:aws_reservation_id] end |
#aws_state ⇒ Object
117 118 119 |
# File 'lib/aws_cloud_map.rb', line 117 def aws_state @attributes[:aws_state] end |
#aws_state_code ⇒ Object
153 154 155 |
# File 'lib/aws_cloud_map.rb', line 153 def aws_state_code @attributes[:aws_state_code] end |
#detach!(volume_or_id) ⇒ Object
TODO test TODO also add to volume TODO allow for volume case
188 189 190 191 |
# File 'lib/aws_cloud_map.rb', line 188 def detach!(volume_or_id) @@ec2.detach_volume(volume_or_id, id, device) @volumes = nil end |
#dns_name ⇒ Object
89 90 91 |
# File 'lib/aws_cloud_map.rb', line 89 def dns_name @attributes[:dns_name] end |
#image ⇒ Object
159 160 161 |
# File 'lib/aws_cloud_map.rb', line 159 def image @image ||= Image.find(aws_image_id) end |
#private_dns_name ⇒ Object
101 102 103 |
# File 'lib/aws_cloud_map.rb', line 101 def private_dns_name @attributes[:private_dns_name] end |
#ssh_key_name ⇒ Object
125 126 127 |
# File 'lib/aws_cloud_map.rb', line 125 def ssh_key_name @attributes[:ssh_key_name] end |
#terminate! ⇒ Object
TODO test
173 174 175 |
# File 'lib/aws_cloud_map.rb', line 173 def terminate! @@ec2.terminate_instances [id] end |
#volumes ⇒ Object
167 168 169 170 |
# File 'lib/aws_cloud_map.rb', line 167 def volumes #TODO [] end |