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/ecloud/requests/compute/rnat_associations_create_device.rb
2012-06-07 12:50:11 -04:00

32 lines
808 B
Ruby

module Fog
module Compute
class Ecloud
class Real
include Shared
def rnat_associations_create_device(data)
validate_data([:host_ip_href, :public_ip_href], data)
request(
:body => generate_rnat_associations_create_device_request(data),
:expects => 201,
:method => "POST",
:headers => {},
:uri => data[:uri],
:parse => true
)
end
private
def generate_rnat_associations_create_device_request(data)
xml = Builder::XmlMarkup.new
xml.CreateRnatAssociation do
xml.PublicIp(:href => data[:public_ip_href])
xml.IpAddress(:href => data[:host_ip_href])
end
end
end
end
end
end