Class: Fog::AWS::EC2::Address
- Defined in:
- lib/fog/aws/models/ec2/address.rb
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
Returns the value of attribute instance_id.
-
#public_ip ⇒ Object
Returns the value of attribute public_ip.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(attributes = {}) ⇒ Address
constructor
A new instance of Address.
- #save ⇒ Object
Methods inherited from Model
Constructor Details
#initialize(attributes = {}) ⇒ Address
Returns a new instance of Address.
10 11 12 13 14 15 16 |
# File 'lib/fog/aws/models/ec2/address.rb', line 10 def initialize(attributes = {}) remap_attributes(attributes, { 'instanceId' => :instance_id, 'publicIp' => :public_ip }) super end |
Instance Attribute Details
#instance_id ⇒ Object
Returns the value of attribute instance_id.
7 8 9 |
# File 'lib/fog/aws/models/ec2/address.rb', line 7 def instance_id @instance_id end |
#public_ip ⇒ Object
Returns the value of attribute public_ip.
7 8 9 |
# File 'lib/fog/aws/models/ec2/address.rb', line 7 def public_ip @public_ip end |
Instance Method Details
#delete ⇒ Object
18 19 20 |
# File 'lib/fog/aws/models/ec2/address.rb', line 18 def delete connection.release_address(@public_ip) end |
#save ⇒ Object
22 23 24 25 |
# File 'lib/fog/aws/models/ec2/address.rb', line 22 def save data = connection.allocate_address @public_ip = data.body['publicIp'] end |