Class: RecordStore::Provider::NS1::Client

Inherits:
NS1::Client
  • Object
show all
Defined in:
lib/record_store/provider/ns1/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key:) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/record_store/provider/ns1/client.rb', line 7

def initialize(api_key:)
  super(api_key)
end

Instance Method Details

#create_record(zone:, fqdn:, type:, params:) ⇒ Object



31
32
33
34
35
# File 'lib/record_store/provider/ns1/client.rb', line 31

def create_record(zone:, fqdn:, type:, params:)
  result = super(zone, fqdn, type, params)
  raise_if_error!(result)
  nil
end

#delete_record(zone:, fqdn:, type:) ⇒ Object



43
44
45
46
47
# File 'lib/record_store/provider/ns1/client.rb', line 43

def delete_record(zone:, fqdn:, type:)
  result = super(zone, fqdn, type)
  raise_if_error!(result)
  nil
end

#modify_record(zone:, fqdn:, type:, params:) ⇒ Object



37
38
39
40
41
# File 'lib/record_store/provider/ns1/client.rb', line 37

def modify_record(zone:, fqdn:, type:, params:)
  result = super(zone, fqdn, type, params)
  raise_if_error!(result)
  nil
end

#record(zone:, fqdn:, type:, must_exist: false) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/record_store/provider/ns1/client.rb', line 23

def record(zone:, fqdn:, type:, must_exist: false)
  result = super(zone, fqdn, type)
  raise_if_error!(result) if must_exist
  return if result.is_a?(NS1::Response::Error)

  result
end

#zone(name) ⇒ Object



17
18
19
20
21
# File 'lib/record_store/provider/ns1/client.rb', line 17

def zone(name)
  zone = super(name)
  raise_if_error!(zone)
  zone
end

#zonesObject



11
12
13
14
15
# File 'lib/record_store/provider/ns1/client.rb', line 11

def zones
  zones = super
  raise_if_error!(zones)
  zones
end