Class: RecordStore::Provider::NS1
- Inherits:
-
RecordStore::Provider
- Object
- RecordStore::Provider
- RecordStore::Provider::NS1
- Defined in:
- lib/record_store/provider/ns1.rb,
lib/record_store/provider/ns1/client.rb
Defined Under Namespace
Class Method Summary collapse
- .client ⇒ Object
- .record_types ⇒ Object
-
.retrieve_current_records(zone:, stdout: $stdout) ⇒ Object
Downloads all the records from the provider.
-
.zones ⇒ Object
Returns an array of the zones managed by provider as strings.
Methods inherited from RecordStore::Provider
apply_changeset, build_zone, empty_non_terminal_over_wildcard?, freezable?, provider_for, supports_alias?, thawable?, to_s
Class Method Details
.client ⇒ Object
49 50 51 |
# File 'lib/record_store/provider/ns1.rb', line 49 def client Provider::NS1::Client.new(api_key: secrets['api_key']) end |
.record_types ⇒ Object
45 46 47 |
# File 'lib/record_store/provider/ns1.rb', line 45 def record_types super | Set.new(%w(PTR)) end |
.retrieve_current_records(zone:, stdout: $stdout) ⇒ Object
Downloads all the records from the provider.
Returns: an array of ‘Record` for each record in the provider’s zone
56 57 58 59 60 |
# File 'lib/record_store/provider/ns1.rb', line 56 def retrieve_current_records(zone:, stdout: $stdout) records_for_zone(zone) .flat_map { |short_record| build_from_api(short_record) } .compact end |
.zones ⇒ Object
Returns an array of the zones managed by provider as strings
63 64 65 66 67 |
# File 'lib/record_store/provider/ns1.rb', line 63 def zones retry_on_connection_errors do client.zones.map { |zone| zone['zone'] } end end |