dnsimple v1.2.0 Dnsimple.Domains

Provides functions to interact with the domain endpoints.

Summary

Functions

Accepts a pending push. Requires a contact_id to be provided that will be used as the domain contact

List all domains in an account automatically paginating if necessary

Disable DNSSEC for the domain in the account

Enable DNSSEC for the domain in the account

Get the DNSSEC status for the domain in the account

Initiates the push of a domain to a different account

Lists the delegation signer records for the domain

Lists the domains in an account

Returns the pending pushes in the account

Resets the domain API token used for authentication in APIv1

Functions

accept_push(client, account_id, push_id, attributes, options \\ [])

Specs

accept_push(Dnsimple.Client.t, String.t | integer, integer, map, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Accepts a pending push. Requires a contact_id to be provided that will be used as the domain contact.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.accept_push(client, account_id = 1010, push_id = 6789, %{
  contact_id: 123
})
add_collaborator(client, account_id, domain_id, attributes, options \\ [])

Specs

add_collaborator(Dnsimple.Client.t, String.t | integer, String.t | integer, map, keyword) :: {:ok | :error, Dnsimple.Response.t}

Adds a collaborator to the domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.add_collaborator(client, account_id = 1010, domain_id = "example.com", %{
  email: "existing-user@example.com"
})
all_domains(client, account_id, options \\ [])

Specs

all_domains(Dnsimple.Client.t, String.t | integer, Keyword.t) :: {:ok | :error, [Dnsimple.Domain.t]}

List all domains in an account automatically paginating if necessary.

This function will automatically page through all pages, returning all domains. It will respect the provided sorting and filtering options.

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.all_domains(client, account_id = 1010)
{:ok, response} = Dnsimple.Domains.all_domains(client, account_id = 1010, sort: "name:asc")
{:ok, response} = Dnsimple.Domains.all_domains(client, account_id = 1010, filter: [name_like: ".com"])
create_delegation_signer_record(client, account_id, domain_id, attributes, options \\ [])

Specs

create_delegation_signer_record(Dnsimple.Client.t, String.t | integer, String.t | integer, map, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Creates a delegation signer record for a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.create_delegation_signer_record(client, account_id = 1010, domain_id = "example.com", %{
  algorithm: "13",
  digest: "684a1f049d7d082b7f98691657da5a65764913df7f065f6f8c36edf62d66ca03",
  digest_type: "2",
  keytag: "2371"
})
create_domain(client, account_id, attributes, options \\ [])

Specs

create_domain(Dnsimple.Client.t, String.t | integer, map, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Creates a new domain in the account.

This won’t register the domain and will only add it to the account. To register a domain please use Dnsimple.Registrar.register_domain/5.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.create_domain(client, account_id = 1010, %{name: "example.io"})
create_email_forward(client, account_id, domain_id, attributes, options \\ [])

Specs

create_email_forward(Dnsimple.Client.t, String.t | integer, String.t | integer, map, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Creates an email forward for a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.create_email_forward(client, account_id = 1010, domain_id = "example.com", %{
  from: "jacegu@example.com",
  to: "me@provider.com",
})
delete_delegation_signer_record(client, account_id, domain_id, ds_record_id, options \\ [])

Specs

delete_delegation_signer_record(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Deletes an delegation signer record from a domain.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.delete_delegation_signer_record(client, account_id = 1010, domain_id = "example.com", ds_record_id = 123)
delete_domain(client, account_id, domain_id, options \\ [])

Specs

delete_domain(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Deletes a domain from an account.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.delete_domain(client, account_id = 1010, domain_id = 237)
{:ok, response} = Dnsimple.Domains.delete_domain(client, account_id = 1010, domain_id = "example.io")
delete_email_forward(client, account_id, domain_id, email_forward_id, options \\ [])

Specs

delete_email_forward(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Deletes an email forward of a domain.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.delete_email_forward(client, account_id = 1010, domain_id = "example.com", email_forward_id = 123)
disable_dnssec(client, account_id, domain_id, options \\ [])

Specs

disable_dnssec(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Disable DNSSEC for the domain in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.disable_dnssec(client, account_id = 1000, domain_id = 123)
{:ok, response} = Dnsimple.Domains.disable_dnssec(client, account_id = 1000, domain_id = "example.io")
enable_dnssec(client, account_id, domain_id, options \\ [])

Specs

enable_dnssec(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Enable DNSSEC for the domain in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.enable_dnssec(client, account_id = 1000, domain_id = 123)
{:ok, response} = Dnsimple.Domains.enable_dnssec(client, account_id = 1000, domain_id = "example.io")
get_delegation_signer_record(client, account_id, domain_id, ds_record_id, options \\ [])

Specs

get_delegation_signer_record(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Returns a delegation signer record of a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.get_delegation_signer_record(client, account_id = 1010, domain_id = "example.com", ds_record_id = 123)
get_dnssec(client, account_id, domain_id, options \\ [])

Specs

get_dnssec(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Get the DNSSEC status for the domain in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.get_dnssec(client, account_id = 1000, domain_id = 123)
{:ok, response} = Dnsimple.Domains.get_dnssec(client, account_id = 1000, domain_id = "example.io")
get_domain(client, account_id, domain_id, options \\ [])

Specs

get_domain(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Returns a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.get_domain(client, account_id = 1010, domain_id = 123)
{:ok, response} = Dnsimple.Domains.get_domain(client, account_id = 1010, domain_id = "example.com")
get_email_forward(client, account_id, domain_id, email_forward_id, options \\ [])

Specs

get_email_forward(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Returns an email forward of a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.get_email_forward(client, account_id = 1010, domain_id = "example.com", email_forward_id = 123)
initiate_push(client, account_id, domain_id, attributes, options \\ [])

Specs

initiate_push(Dnsimple.Client.t, String.t | integer, String.t | integer, map, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Initiates the push of a domain to a different account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.initiate_push(client, account_id = 1010, domain_id = "example.com", %{
  new_account_email: "other@example.com",
})
list_collaborators(client, account_id, domain_id, options \\ [])

Specs

list_collaborators(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Lists the collaborators of the domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.list_collaborators(client, account_id = 1010, domain_id = "example.com")
list_delegation_signer_records(client, account_id, domain_id, options \\ [])

Specs

list_delegation_signer_records(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Lists the delegation signer records for the domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.list_delegation_signer_records(client, account_id = 1000, domain_id = 123)
{:ok, response} = Dnsimple.Domains.list_delegation_signer_records(client, account_id = 1000, domain_id = "example.io")
list_domains(client, account_id, options \\ [])

Lists the domains in an account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.list_domains(client, account_id = 1010)
{:ok, response} = Dnsimple.Domains.list_domains(client, account_id = 1010, sort: "name:asc")
{:ok, response} = Dnsimple.Domains.list_domains(client, account_id = 1010, per_page: 50, page: 4)
{:ok, response} = Dnsimple.Domains.list_domains(client, account_id = 1010, filter: [name_like: ".com"])
list_email_forwards(client, account_id, domain_id, options \\ [])

Specs

list_email_forwards(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Lists the email forwards of a domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = 23)
{:ok, response} = Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = "example.com")
{:ok, response} = Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = "example.com", sort: "to:asc")
{:ok, response} = Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = "example.com", per_page: 5, page: 1)
list_pushes(client, account_id, options \\ [])

Specs

list_pushes(Dnsimple.Client.t, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Returns the pending pushes in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.list_pushes(client, account_id = 1010)
reject_push(client, account_id, push_id, options \\ [])

Specs

reject_push(Dnsimple.Client.t, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Rejects a pending push.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.reject_push(client, account_id = 1010, push_id = 6789)
remove_collaborator(client, account_id, domain_id, collaborator_id, options \\ [])

Specs

remove_collaborator(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Removes a collaborator from the domain.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.remove_collaborator(client, account_id = 1010, domain_id = "example.com", collaborator_id = 100)
reset_domain_token(client, account_id, domain_id, options \\ [])

Specs

reset_domain_token(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Resets the domain API token used for authentication in APIv1.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Domains.reset_domain_token(client, account_id = 1010, domain_id = 123)
{:ok, response} = Dnsimple.Domains.reset_domain_token(client, account_id = 1010, domain_id = "example.io")