2010-05-28 05:17:59 +08:00
|
|
|
module Fog
|
2010-09-03 01:11:45 -07:00
|
|
|
class Vcloud
|
2010-05-28 05:17:59 +08:00
|
|
|
module Terremark
|
2010-09-14 10:40:02 -07:00
|
|
|
class Ecloud
|
2010-05-28 05:17:59 +08:00
|
|
|
|
2010-09-14 10:40:02 -07:00
|
|
|
class Real
|
2010-06-18 07:58:09 +08:00
|
|
|
basic_request :get_public_ips
|
2010-05-28 05:17:59 +08:00
|
|
|
end
|
|
|
|
|
2010-09-14 10:40:02 -07:00
|
|
|
class Mock
|
2010-05-28 05:17:59 +08:00
|
|
|
#
|
2010-10-18 07:06:44 +08:00
|
|
|
# Based off of:
|
|
|
|
# http://support.theenterprisecloud.com/kb/default.asp?id=577&Lang=1&SID=
|
2010-05-28 05:17:59 +08:00
|
|
|
#
|
2010-10-18 07:06:44 +08:00
|
|
|
|
2010-05-28 05:17:59 +08:00
|
|
|
def get_public_ips(public_ips_uri)
|
2010-06-18 07:58:09 +08:00
|
|
|
public_ips_uri = ensure_unparsed(public_ips_uri)
|
2010-10-18 07:06:44 +08:00
|
|
|
|
|
|
|
if public_ip_collection = mock_data.public_ip_collection_from_href(public_ips_uri)
|
2010-05-28 05:17:59 +08:00
|
|
|
xml = Builder::XmlMarkup.new
|
2010-06-18 07:58:09 +08:00
|
|
|
mock_it 200,
|
2010-05-28 05:17:59 +08:00
|
|
|
xml.PublicIPAddresses {
|
2010-10-18 07:06:44 +08:00
|
|
|
public_ip_collection.items.each do |ip|
|
2010-05-28 05:17:59 +08:00
|
|
|
xml.PublicIPAddress {
|
2010-10-18 07:06:44 +08:00
|
|
|
xml.Id ip.object_id
|
|
|
|
xml.Href ip.href
|
|
|
|
xml.Name ip.name
|
2010-05-28 05:17:59 +08:00
|
|
|
}
|
|
|
|
end
|
|
|
|
}, { 'Content-Type' => 'application/vnd.tmrk.ecloud.publicIpsList+xml'}
|
|
|
|
else
|
|
|
|
mock_error 200, "401 Unauthorized"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|