def create_zone(domain, default_ttl, ns_type, options = {})
optional_tags= ''
options.each { |option, value|
case option
when :ns1
optional_tags+= "<ns1>#{value}</ns1>"
when :nx_ttl
optional_tags+= "<nx-ttl type='interger'>#{value}</nx-ttl>"
when :slave_nameservers
optional_tags+= "<slave-nameservers>#{value}</slave-nameservers>"
when :axfr_ips
optional_tags+= "<axfr-ips>#{value}</axfr-ips>"
when :custom_nameservers
optional_tags+= "<custom-nameservers>#{value}</custom-nameservers>"
when :custom_ns
optional_tags+= "<custom-ns>#{value}</custom-ns>"
when :hostmaster
optional_tags+= "<hostmaster>#{value}</hostmaster>"
when :notes
optional_tags+= "<notes>#{value}</notes>"
when :restrict_axfr
optional_tags+= "<restrict-axfr>#{value}</restrict-axfr>"
when :tag_list
optional_tags+= "<tag-list>#{value}</tag-list>"
end
}
request(
:body => %Q{<?xml version="1.0" encoding="UTF-8"?><zone><domain>#{domain}</domain><default-ttl type="integer">#{default_ttl}</default-ttl><ns-type>#{ns_type}</ns-type>#{optional_tags}</zone>},
:expects => 201,
:method => 'POST',
:parser => Fog::Parsers::DNS::Zerigo::CreateZone.new,
:path => '/api/1.1/zones.xml'
)
end