Sha256: 9fe5669d44a7d271a1f96ba99d33d00d40aa8281916e23b62d53ca95c9f27268
Contents?: true
Size: 1.13 KB
Versions: 19
Compression:
Stored size: 1.13 KB
Contents
require 'ns1' module RecordStore class Provider::NS1 < Provider class Error < StandardError; end class Client < ::NS1::Client def initialize(api_key:) super(api_key) end def zones super end def zone(name) super(name) end def record(zone:, fqdn:, type:, must_exist: false) result = super(zone, fqdn, type) raise(Error, result.to_s) if must_exist && result.is_a?(NS1::Response::Error) return nil if result.is_a?(NS1::Response::Error) result end def create_record(zone:, fqdn:, type:, params:) result = super(zone, fqdn, type, params) raise(Error, result.to_s) if result.is_a?(NS1::Response::Error) nil end def modify_record(zone:, fqdn:, type:, params:) result = super(zone, fqdn, type, params) raise(Error, result.to_s) if result.is_a?(NS1::Response::Error) nil end def delete_record(zone:, fqdn:, type:) result = super(zone, fqdn, type) raise(Error, result.to_s) if result.is_a?(NS1::Response::Error) nil end end end end
Version data entries
19 entries across 19 versions & 1 rubygems