Module: Dnsimple::Client::DomainsDelegationSignerRecords

Included in:
DomainsService
Defined in:
lib/dnsimple/client/domains_delegation_signer_records.rb

Instance Method Summary collapse

Instance Method Details

#all_delegation_signer_records(account_id, domain_id, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::DelegationSignerRecord>

Lists ALL the delegation signer records for the domain.

This method is similar to #delegation_signer_records, but instead of returning the results of a specific page it iterates all the pages and returns the entire collection.

Please use this method carefully, as fetching the entire collection will increase the number of requests you send to the API server and you may eventually risk to hit the throttle limit.

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    The domain ID or domain name

  • options (Hash) (defaults to: {})

    the filtering and sorting option

Options Hash (options):

  • :page (Integer)

    current page (pagination)

  • :per_page (Integer)

    number of entries to return (pagination)

  • :sort (String)

    sorting policy

Returns:

Raises:

See Also:



56
57
58
# File 'lib/dnsimple/client/domains_delegation_signer_records.rb', line 56

def all_delegation_signer_records(, domain_id, options = {})
  paginate(:delegation_signer_records, , domain_id, options)
end

#create_delegation_signer_record(account_id, domain_id, attributes, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::DelegationSignerRecord>

Creates a delegation signer record for the domain.

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    The domain ID or domain name

  • attributes (Hash)
  • options (Hash) (defaults to: {})

Options Hash (attributes):

  • :algorithm (Integer)

    DNSSEC algorithm as number (required)

  • :digest (String)

    The hexidecimal representation of the digest of the corresponding DNSKEY record (required if TLD requires DS data)

  • :digest_type (Integer)

    DNSSEC digest type (required if TLD requires DS data)

  • :keytag (String)

    A keytag that references the corresponding DNSKEY record (required if TLD requires DS data)

  • :public_key (String)

    A public key that references the corresponding DNSKEY record (required if TLD requires KEY data)

Returns:

Raises:

See Also:



78
79
80
81
82
83
# File 'lib/dnsimple/client/domains_delegation_signer_records.rb', line 78

def create_delegation_signer_record(, domain_id, attributes, options = {})
  Extra.validate_mandatory_attributes(attributes, [:algorithm])
  response = client.post(Client.versioned("/%s/domains/%s/ds_records" % [, domain_id]), attributes, options)

  Dnsimple::Response.new(response, Struct::DelegationSignerRecord.new(response["data"]))
end

#delegation_signer_record(account_id, domain_id, ds_record_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::DelegationSignerRecord>

Gets a delegation signer record for the domain.

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    The domain ID or domain name

  • ds_record_id (#to_s)

    The delegation signer record ID

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



97
98
99
100
101
# File 'lib/dnsimple/client/domains_delegation_signer_records.rb', line 97

def delegation_signer_record(, domain_id, ds_record_id, options = {})
  response = client.get(Client.versioned("/%s/domains/%s/ds_records/%s" % [, domain_id, ds_record_id]), options)

  Dnsimple::Response.new(response, Struct::DelegationSignerRecord.new(response["data"]))
end

#delegation_signer_records(account_id, domain_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::DelegationSignerRecord>

Lists the delegation signer records for the domain.

Examples:

List delegation signer records in the first page

client.domains.delegation_signer_records(1010, "example.com")

List delegation signer records, provide a specific page

client.domains.email_forwards(1010, "example.com", page: 2)

List delegation signer records, provide a sorting policy

client.domains.delegation_signer_records(1010, "example.com", sort: "from:asc")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    The domain ID or domain name

  • options (Hash) (defaults to: {})

    the filtering and sorting options

Options Hash (options):

  • :page (Integer)

    current page (pagination)

  • :per_page (Integer)

    number of entries to return (pagination)

  • :sort (String)

    sorting policy

Returns:

Raises:

See Also:



30
31
32
33
34
# File 'lib/dnsimple/client/domains_delegation_signer_records.rb', line 30

def delegation_signer_records(, domain_id, options = {})
  response = client.get(Client.versioned("/%s/domains/%s/ds_records" % [, domain_id]), Options::ListOptions.new(options))

  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::DelegationSignerRecord.new(r) })
end

#delete_delegation_signer_record(account_id, domain_id, ds_record_id, options = {}) ⇒ Dnsimple::Response<nil>

Deletes a delegation signer record for the domain.

WARNING: this cannot be undone.

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    The domain ID or domain name

  • ds_record_id (#to_s)

    The delegation signer record ID

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



117
118
119
120
121
# File 'lib/dnsimple/client/domains_delegation_signer_records.rb', line 117

def delete_delegation_signer_record(, domain_id, ds_record_id, options = {})
  response = client.delete(Client.versioned("/%s/domains/%s/ds_records/%s" % [, domain_id, ds_record_id]), nil, options)

  Dnsimple::Response.new(response, nil)
end