Dnsimple.Templates (dnsimple v3.0.1)
Provides functions to interact with the template endpoints.
See:
Link to this section Summary
Functions
Applies a template to a domain.
Creates a new template.
Creates a new record in the template.
Deletes a template.
Deletes a record from a template.
Returns a template.
Returns a record of the template.
Returns the list of records in the template.
Returns the list of existing templates in the account.
Updates an existing template.
Link to this section Functions
apply_template(client, account_id, domain_id, template_id, options \\ [])
Specs
apply_template( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), String.t() | integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Applies a template to a domain.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.apply_template(client, account_id = 1010, domain_id = "example.com", template_id = "alpha")
create_template(client, account_id, attributes, options \\ [])
Specs
create_template(Dnsimple.Client.t(), String.t() | integer(), map(), Keyword.t()) :: {:ok | :error, Dnsimple.Response.t()}
Creates a new template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.create_template(client, account_id = 1010, %{
name: "Beta",
short_name: "beta",
description: "A beta template.",
})
create_template_record(client, account_id, template_id, attributes, options \\ [])
Specs
create_template_record( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), map(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Creates a new record in the template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.create_template_record(client, account_id = 1010, template_id = "alpha" %{
name: "",
type: "mx",
content: "mx.example.com",
ttl: 600,
prio: 10,
})
delete_template(client, account_id, template_id, options \\ [])
Specs
delete_template( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Deletes a template.
Warning: this is a destructive operation.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.delete_template(client, account_id = 1010, template_id = "alpha")
delete_template_record(client, account_id, template_id, record_id, options \\ [])
Specs
delete_template_record( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Deletes a record from a template.
Warning: this is a destructive operation.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.delete_template_record(client, account_id = 1010, template_id = "alpha", record_id = 1)
get_template(client, account_id, template_id, options \\ [])
Specs
get_template( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Returns a template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.get_template(client, account_id = 1010, template_id = "alpha")
get_template_record(client, account_id, template_id, record_id, options \\ [])
Specs
get_template_record( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Returns a record of the template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.get_template_record(client, account_id = 1010, template_id = "alpha", record_id = 123)
list_template_records(client, account_id, template_id, options \\ [])
Specs
list_template_records( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Returns the list of records in the template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.list_template_records(client, account_id = 1010, template_id = 1)
Dnsimple.Templates.list_template_records(client, account_id = 1010, template_id = 1, sort: "type:asc")
list_templates(client, account_id, options \\ [])
Specs
list_templates(Dnsimple.Client.t(), String.t() | integer(), Keyword.t()) :: {:ok | :error, Dnsimple.Response.t()}
Returns the list of existing templates in the account.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.list_templates(client, account_id = 1010)
{:ok, response} = Dnsimple.Templates.list_templates(client, account_id = 1010, sort: "name:asc")
update_template(client, account_id, template_id, attributes, options \\ [])
Specs
update_template( Dnsimple.Client.t(), String.t() | integer(), String.t() | integer(), map(), Keyword.t() ) :: {:ok | :error, Dnsimple.Response.t()}
Updates an existing template.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Templates.update_template(client, account_id = 1010, template_id = 1, %{
name: "Beta",
short_name: "beta",
description: "A beta template.",
})