Module: Dnsimple::Client::RegistrarDelegation

Included in:
RegistrarService
Defined in:
lib/dnsimple/client/registrar_delegation.rb

Instance Method Summary collapse

Instance Method Details

#change_domain_delegation(account_id, domain_name, attributes, options = {}) ⇒ Dnsimple::Response<Array>

Chagne name servers the domain is delegating to.

Examples:

Change the name servers example.com is delegating to:

client.registrar.change_domain_delegation(1010, "example.com",
    ["ns1.dnsimple.com", "ns2.dnsimple.com", "ns3.dnsimple.com", "ns4.dnsimple.com"])

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name to check

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

Returns:

Raises:

See Also:


42
43
44
45
46
47
# File 'lib/dnsimple/client/registrar_delegation.rb', line 42

def change_domain_delegation(, domain_name, attributes, options = {})
  endpoint = Client.versioned("/%s/registrar/domains/%s/delegation" % [, domain_name])
  response = client.put(endpoint, attributes, options)

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

#change_domain_delegation_from_vanity(account_id, domain_name, options = {}) ⇒ Dnsimple::Response<nil>

Disable vanity name servers for the domain.

Examples:

Disable vanity name servers for example.com:

client.registrar.change_domain_delegation_from_vanity(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name to check

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

Returns:

Raises:

See Also:


84
85
86
87
88
89
# File 'lib/dnsimple/client/registrar_delegation.rb', line 84

def change_domain_delegation_from_vanity(, domain_name, options = {})
  endpoint = Client.versioned("/%s/registrar/domains/%s/delegation/vanity" % [, domain_name])
  response = client.delete(endpoint, options)

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

#change_domain_delegation_to_vanity(account_id, domain_name, attributes, options = {}) ⇒ Dnsimple::Response<Array<Dnsimple::Struct::VanityNameServer>>

Enable vanity name servers for the domain.

Examples:

Enable vanity name servers for example.com:

client.registrar.change_domain_delegation_to_vanity(1010, "example.com",
    ["ns1.example.com", "ns2.example.com", "ns3.example.com", "ns4.example.com"])

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name to check

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

Returns:

Raises:

See Also:


64
65
66
67
68
69
# File 'lib/dnsimple/client/registrar_delegation.rb', line 64

def change_domain_delegation_to_vanity(, domain_name, attributes, options = {})
  endpoint = Client.versioned("/%s/registrar/domains/%s/delegation/vanity" % [, domain_name])
  response = client.put(endpoint, attributes, options)

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

#domain_delegation(account_id, domain_name, options = {}) ⇒ Dnsimple::Response<Array>

Lists name servers the domain is delegating to.

Examples:

List the name servers example.com is delegating to:

client.registrar.domain_delegation(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name to check

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

Returns:

Raises:

See Also:


20
21
22
23
24
25
# File 'lib/dnsimple/client/registrar_delegation.rb', line 20

def domain_delegation(, domain_name, options = {})
  endpoint = Client.versioned("/%s/registrar/domains/%s/delegation" % [, domain_name])
  response = client.get(endpoint, options)

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