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/addresses.rb

37 lines
728 B
Ruby
Raw Normal View History

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