def add_node_service(service_id, ip, name, port, options = {})
unless options.key?("Enabled")
options["Enabled"] = true
end
data = "<CreateNodeServiceRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"urn:tmrk:vCloudExpressExtensions-1.6\"><IpAddress>\#{ip}</IpAddress><Name>\#{name}</Name><Port>\#{port}</Port><Enabled>\#{options['Enabled']}</Enabled><Description>\#{options['Description']}</Description></CreateNodeServiceRequest>\n"
response = request(
:body => data,
:expects => 200,
:headers => { "Content-Type" => "application/vnd.tmrk.vCloud.nodeService+xml" },
:method => "POST",
:parser => Fog::Parsers::Terremark::NodeService.new,
:path => "api/extensions/v1.6/internetService/#{service_id}/nodeServices",
:override_path => true
)
response
end