mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
31 lines
579 B
Ruby
31 lines
579 B
Ruby
module Fog
|
|
module AWS
|
|
class EC2
|
|
|
|
class Address < Fog::Model
|
|
|
|
attr_accessor :instance_id,
|
|
:public_ip
|
|
|
|
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
|