dnsimple v1.2.0 Dnsimple.Templates
Provides functions to interact with the template endpoints.
See:
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
Functions
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")
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.",
})
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,
})
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")
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)
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")
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)
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")
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")
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.",
})