dnsimple v0.9.2 Dnsimple.Domains

This module provides functions to interact with the domain related endpoints.

See https://developer.dnsimple.com/v2/domains/

Summary

Functions

Accept a pending push. Requires a contact_id corresponding to the that will be used as the domain contact

List all domains from the account

PERMANENTLY deletes a domain from the account

See Dnsimple.Domains.get_domain/3

See Dnsimple.Domains.list_domains/2

See Dnsimple.Domains.get_email_forward/4

See Dnsimple.Domains.list_email_forwards/3

Initiates the push of a domain to a different account

Returns the pending pushes in the account

See Dnsimple.Domains.list_pushes/2

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) :: Dnsimple.Response.t

Accept a pending push. Requires a contact_id corresponding to the that will be used as the domain contact.

See: https://developer.dnsimple.com/v2/domains/pushes#accept

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.accept_push(client, account_id = 1010, push_id = 6789, %{

contact_id: 123,

})

all_domains(client, account_id, options \\ [])

Specs

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

List all domains from the account.

This function will automatically page through to the end of the list, returning all domains. It will respect the provided sorting and filtering options.

Examples:

Dnsimple.Domains.all_domains(client, account_id = 1010) Dnsimple.Domains.all_domains(client, account_id = 1010, sort: “name:asc”) Dnsimple.Domains.all_domains(client, account_id = 1010, filter: [name_like: ".com"])

create_domain(client, account_id, attributes, options \\ [])

Specs

create_domain(Dnsimple.Client.t, String.t | integer, map, Keyword.t) :: Dnsimple.Response.t

Creates a new domain in the account.

This won’t register the domain and will only add the domain as hosted. To register a domain please use Dnsimple.Registrar.register_domain.

See https://developer.dnsimple.com/v2/domains/#create

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

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) :: Dnsimple.Response.t

Creates an email forward for a domain.

See: https://developer.dnsimple.com/v2/domains/email-forwards/#create

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.create_email_forward(client, account_id = 1010, domain_id = “example.com”, %{

from: "jacegu@example.com",
to: "me@provider.com",

})

delete_domain(client, account_id, domain_id, options \\ [])

Specs

delete_domain(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: Dnsimple.Response.t

PERMANENTLY deletes a domain from the account.

See https://developer.dnsimple.com/v2/domains/#delete

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.delete_domain(client, account_id = 1010, domain_id = 237) 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) :: Dnsimple.Response.t

Deletes an email forward of a domain.

See: https://developer.dnsimple.com/v2/domains/email-forwards/#delete

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.delete_email_forward(client, account_id = 1010, domain_id = “example.com”, email_forward_id = 123)

domain(client, account_id, domain_id)

See Dnsimple.Domains.get_domain/3.

domain(client, account_id, domain_id, options)

Specs

See Dnsimple.Domains.get_domain/4.

domains(client, account_id)

Specs

See Dnsimple.Domains.list_domains/2.

domains(client, account_id, options)

See Dnsimple.Domains.list_domains/3.

email_forward(client, account_id, domain_id, email_forward_id)

See Dnsimple.Domains.get_email_forward/4.

email_forward(client, account_id, domain_id, email_forward_id, options)

Specs

email_forward(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: Dnsimple.Response.t

See Dnsimple.Domains.get_email_forward/5.

email_forwards(client, account_id, domain_id)

See Dnsimple.Domains.list_email_forwards/3.

email_forwards(client, account_id, domain_id, options)

Specs

email_forwards(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: Dnsimple.Response.t

See Dnsimple.Domains.list_email_forwards/4.

get_domain(client, account_id, domain_id, options \\ [])

Specs

get_domain(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: Dnsimple.Response.t

Get a domain.

See https://developer.dnsimple.com/v2/domains/#get

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.get_domain(client, account_id = 1010, domain_id = 123) 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) :: Dnsimple.Response.t

Returns an email forward of a domain.

See: https://developer.dnsimple.com/v2/domains/email-forwards/#get

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

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) :: Dnsimple.Response.t

Initiates the push of a domain to a different account.

See: https://developer.dnsimple.com/v2/domains/pushes#initiate

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.initiate_push(client, account_id = 1010, domain_id = “example.com”, %{

new_account_email: "other@example.com",

})

list_domains(client, account_id, options \\ [])

Lists the domains.

See https://developer.dnsimple.com/v2/domains/#list

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.list_domains(client, account_id = 1010) Dnsimple.Domains.list_domains(client, account_id = 1010, sort: “name:asc”) Dnsimple.Domains.list_domains(client, account_id = 1010, per_page: 50, page: 4) 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) :: Dnsimple.Response.t

Lists the email forwards of a domain.

See: https://developer.dnsimple.com/v2/domains/email-forwards/#list

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = 23) Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = “example.com”) Dnsimple.Domains.list_email_forwards(client, account_id = 1010, domain_id = “example.com”, sort: “to:asc”) 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

Returns the pending pushes in the account.

See: https://developer.dnsimple.com/v2/domains/pushes#list

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.list_pushes(client, account_id = 1010)

pushes(client, account_id)

See Dnsimple.Domains.list_pushes/2.

pushes(client, account_id, options)

See Dnsimple.Domains.list_pushes/3.

reject_push(client, account_id, push_id, options \\ [])

Specs

reject_push(Dnsimple.Client.t, String.t | integer, integer, Keyword.t) :: Dnsimple.Response.t

Rejects a pending push.

See: https://developer.dnsimple.com/v2/domains/pushes#reject

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.reject_push(client, account_id = 1010, push_id = 6789)

reset_domain_token(client, account_id, domain_id, options \\ [])

Specs

reset_domain_token(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: Dnsimple.Response.t

Resets the domain API token used for authentication in APIv1.

See https://developer.dnsimple.com/v2/domains/#reset-token

Examples:

client = %Dnsimple.Client{access_token: “a1b2c3d4”}

Dnsimple.Domains.reset_domain_token(client, account_id = 1010, domain_id = 123) Dnsimple.Domains.reset_domain_token(client, account_id = 1010, domain_id = “example.io”)