Class: Gandi::Domain::Zone::Record

Inherits:
Object
  • Object
show all
Extended by:
Connector
Defined in:
lib/gandi/domain/zone/record.rb

Class Method Summary collapse

Methods included from Connector

call

Class Method Details

.add(zone_id, version_id, record) ⇒ Object

Add a new record to zone/version. Return a Record hash.



10
11
12
# File 'lib/gandi/domain/zone/record.rb', line 10

def add(zone_id, version_id, record)
  call('domain.zone.record.add', zone_id, version_id, record)
end

.count(zone_id, version_id) ⇒ Object

Count number of records for a given zone/version.



15
16
17
# File 'lib/gandi/domain/zone/record.rb', line 15

def count(zone_id, version_id)
  call('domain.zone.record.count', zone_id, version_id)
end

.delete(zone_id, version_id, filters = {}) ⇒ Object

Remove some records from a zone/version, filters are the same as for list. Return the number of records deleted.



21
22
23
# File 'lib/gandi/domain/zone/record.rb', line 21

def delete(zone_id, version_id, filters = {})
  call('domain.zone.record.delete', zone_id, version_id, filters)
end

.list(zone_id, version_id, filters = {}) ⇒ Object

List a zone’s records, with an optional filter. Return an array of record hashes.



27
28
29
# File 'lib/gandi/domain/zone/record.rb', line 27

def list(zone_id, version_id, filters = {})
  call('domain.zone.record.list', zone_id, version_id, filters = {})
end

.set(zone_id, version_id, records) ⇒ Object

Sets the records for a zone/version. Return an array of record hashes.



33
34
35
# File 'lib/gandi/domain/zone/record.rb', line 33

def set(zone_id, version_id, records)
  call('domain.zone.record.set', zone_id, version_id, records)
end