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
2014-02-19 12:30:59 +00:00

32 lines
798 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