Dnsimple.Domains (dnsimple v3.0.1)

Provides functions to interact with the domain endpoints.

Link to this section 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.

Link to this section Functions

Link to this function

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
})
Link to this function

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"
})
Link to this function

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"])
Link to this function

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"
})
Link to this function

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"})
Link to this function

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",
})
Link to this function

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)
Link to this function

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")
Link to this function

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)
Link to this function

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")
Link to this function

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")
Link to this function

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)
Link to this function

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")
Link to this function

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")
Link to this function

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)
Link to this function

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",
})
Link to this function

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")
Link to this function

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")
Link to this function

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"])
Link to this function

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)
Link to this function

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)
Link to this function

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)
Link to this function

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)