2009-08-13 01:33:35 -04:00
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class EC2
|
|
|
|
|
|
|
|
def addresses
|
|
|
|
Fog::AWS::EC2::Addresses.new(:connection => self)
|
|
|
|
end
|
|
|
|
|
|
|
|
class Addresses < Fog::Collection
|
|
|
|
|
2009-08-19 12:11:26 -04:00
|
|
|
def all(public_ip = [])
|
|
|
|
data = connection.describe_addresses(public_ip).body
|
2009-08-13 01:33:35 -04:00
|
|
|
addresses = []
|
2009-08-14 12:19:40 -04:00
|
|
|
data['addressesSet'].each do |address|
|
2009-08-13 01:33:35 -04:00
|
|
|
addresses << Fog::AWS::EC2::Address.new({
|
|
|
|
:connection => connection
|
|
|
|
}.merge!(address))
|
|
|
|
end
|
|
|
|
addresses
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
address = new
|
|
|
|
address.save
|
|
|
|
address
|
|
|
|
end
|
|
|
|
|
|
|
|
def new
|
|
|
|
Fog::AWS::S3::Address.new(:connection => connection)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|