1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/models/ec2/address.rb

32 lines
579 B
Ruby
Raw Normal View History

2009-08-13 01:33:35 -04:00
module Fog
module AWS
class EC2
class Address < Fog::Model
2009-08-14 12:19:40 -04:00
attr_accessor :instance_id,
2009-08-19 12:11:26 -04:00
:public_ip
2009-08-13 01:33:35 -04:00
def initialize(attributes = {})
remap_attributes(attributes, {
'instanceId' => :instance_id,
'publicIp' => :public_ip
})
super
end
def delete
connection.release_address(@public_ip)
end
def save
data = connection.allocate_address
@public_ip = data.body['publicIp']
end
end
end
end
end