def add_internet_service(ip_id, name, protocol, port, options = {})
unless options.key?("Enabled")
options["Enabled"] = true
end
data = "<CreateInternetServiceRequest xml:lang=\"en\" xmlns=\"urn:tmrk:vCloudExpressExtensions-1.6\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<Name>\#{name}</Name>\n<Protocol>\#{protocol.upcase}</Protocol>\n<Port>\#{port}</Port>\n<Enabled>\#{options['Enabled']}</Enabled>\n<Description>\#{options['Description']}</Description>\n</CreateInternetServiceRequest>\n"
request(
:body => data,
:expects => 200,
:headers => { "Content-Type" => "application/xml" },
:method => "POST",
:parser => Fog::Parsers::Terremark::InternetService.new,
:path => "api/extensions/v1.6/publicIp/#{ip_id}/internetServices",
:override_path => true
)
end