lib/fog/zerigo/requests/dns/create_host.rb in fog-1.20.0 vs lib/fog/zerigo/requests/dns/create_host.rb in fog-1.21.0

- old
+ new

@@ -15,11 +15,11 @@ # * hostname<~String> - Note: normally this is set/required!! # * notes<~String> # * priority<~Integer> - Note: required for MX or SRV records # * ttl<~Integer> # ==== Returns - # * response<~Excon::Response>: + # * response<~Excon::Response>: # * body<~Hash> # * 'created-at'<~String> # * 'data'<~String> # * 'fqdn'<~String> # * 'host-type'<~String> @@ -28,13 +28,13 @@ # * 'notes'<~String> # * 'priority'<~Integer> # * 'ttl'<~Integer> # * 'updated-at'<~String> # * 'zone-id'<~String> - # * 'status'<~Integer> - 201 if successful + # * 'status'<~Integer> - 201 if successful def create_host(zone_id, host_type, data, options = {}) - + optional_tags= '' options.each { |option, value| case option when :hostname optional_tags+= "<hostname>#{value}</hostname>" @@ -44,10 +44,10 @@ optional_tags+= "<priority>#{value}</priority>" when :ttl optional_tags+= "<ttl>#{value}</ttl>" end } - + request( :body => %Q{<?xml version="1.0" encoding="UTF-8"?><host><host-type>#{host_type}</host-type><data>#{data}</data>#{optional_tags}</host>}, :expects => 201, :method => 'POST', :parser => Fog::Parsers::DNS::Zerigo::CreateHost.new,