Module: Hetzner::API::Rdns

Included in:
Hetzner::API
Defined in:
lib/hetzner/api/rdns.rb

Instance Method Summary collapse

Instance Method Details

#delete_rdns!(ip) ⇒ Object

delete the reverse mapping of one IP address



25
26
27
28
# File 'lib/hetzner/api/rdns.rb', line 25

def delete_rdns!(ip)
  path = "/rdns/#{ip}"
  perform_delete path
end

#initialize_rdns!(ip, ptr) ⇒ Object

creates a reverse mapping record. fails if already one exists ptr contains a hostname



19
20
21
22
# File 'lib/hetzner/api/rdns.rb', line 19

def initialize_rdns!(ip, ptr)
  path = "/rdns/#{ip}"
  perform_put path, :query => { :ptr => ptr }
end

#rdns!(ip, ptr) ⇒ Object

creates or updates a reverse mapping record. ptr contains a hostname



12
13
14
15
# File 'lib/hetzner/api/rdns.rb', line 12

def rdns!(ip, ptr)
  path = "/rdns/#{ip}"
  perform_post path, :query => { :ptr => ptr }
end

#rdns?(ip) ⇒ Boolean

queries the reverse mapping status of one IP address

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/hetzner/api/rdns.rb', line 5

def rdns?(ip)
  path = "/rdns/#{ip}"
  perform_get path
end