def create_internet_service(vdc_id, name, protocol, port, options = {})
unless options.key?("Enabled")
options["Enabled"] = true
end
path = vdcs.get(vdc_id).links.detect { |item| item["name"] == "Internet Services" }["href"].split(@host)[1]
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"
response = request(
:body => data,
:expects => 200,
:headers => { "Content-Type" => "application/vnd.tmrk.vCloud.internetService+xml" },
:method => "POST",
:parser => Fog::Parsers::Terremark::InternetService.new,
:path => path,
:override_path => true
)
response
end