mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
29 lines
491 B
Ruby
29 lines
491 B
Ruby
module Fog
|
|
module AWS
|
|
class EC2
|
|
|
|
class Address < Fog::Model
|
|
|
|
attribute :instance_id, 'instanceId'
|
|
attribute :public_ip, 'publicIp'
|
|
|
|
def initialize(attributes = {})
|
|
super
|
|
end
|
|
|
|
def delete
|
|
connection.release_address(@public_ip)
|
|
true
|
|
end
|
|
|
|
def save
|
|
data = connection.allocate_address
|
|
@public_ip = data.body['publicIp']
|
|
true
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|