Method: Fog::DNS::Rage4::Real#create_record

Defined in:
lib/fog/rage4/requests/dns/create_record.rb

#create_record(domain_id, name, content, type, options = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fog/rage4/requests/dns/create_record.rb', line 30

def create_record(domain_id, name, content, type, options = {})
  path = "/rapi/createrecord/#{domain_id}"
  path << "?name=#{name}&content=#{content}&type=#{type}"

  path << "&priority=#{options[:priority]}" if options[:priority]

  failover = options[:failover] || 'false'
  path << "&failover=#{failover}"

  path << "&failovercontent=#{options[:failovercontent]}" if options[:failovercontent]

  ttl = options[:ttl] || 3600
  path << "&ttl=#{ttl}"

  path << "&geozone=#{options[:geozone]}" if options[:geozone]
  path << "&geolock=#{options[:geolock]}" if options[:geolock]
  path << "&geolat=#{options[:geolat]}"   if options[:geolat]
  path << "&geolong=#{options[:geolong]}" if options[:geolong]
  path << "&udplimit=#{options[:udplimit]}" if options[:udplimit]

  request(
          :expects  => 200,
          :method   => 'GET',
          :path     => path
  )
end