dnsimple v0.9.2 Dnsimple.Templates

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

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

Summary

Functions

PERMANENTLY deletes an existing template

Returns the list of records in the template

Returns the list of existing templates in the account

See Dnsimple.Templates.get_template/3

See Dnsimple.Templates.get_template_record/4

See Dnsimple.Templates.list_template_records/3

See Dnsimple.Templates.list_templates/2

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

Applies a template to a domain.

See https://developer.dnsimple.com/v2/templates/domains/#apply

Examples:

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

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

Creates a new template in the account.

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

Examples:

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

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

Creates a new record in the template.

See https://developer.dnsimple.com/v2/templates/records/#create

Examples:

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

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

PERMANENTLY deletes an existing template.

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

Examples:

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

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

PERMANENTLY deletes a record from the template.

See https://developer.dnsimple.com/v2/templates/records/#delete

Examples:

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

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

Returns a template in the account.

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

Examples:

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

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

Returns a record in of the template.

See https://developer.dnsimple.com/v2/templates/records/#get

Examples:

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

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

Returns the list of records in the template.

See https://developer.dnsimple.com/v2/templates/records/#list

Examples:

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

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

Returns the list of existing templates in the account.

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

Examples:

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

Dnsimple.Templates.list_templates(client, account_id = 1010) Dnsimple.Templates.list_templates(client, account_id = 1010, sort: “name:asc”)

template(client, account_id, template_id)

See Dnsimple.Templates.get_template/3.

template(client, account_id, template_id, options)

Specs

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

See Dnsimple.Templates.get_template/4.

template_record(client, account_id, template_id, record_id)

See Dnsimple.Templates.get_template_record/4.

template_record(client, account_id, template_id, record_id, options)

Specs

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

See Dnsimple.Templates.get_template_record/5.

template_records(client, account_id, template_id)

See Dnsimple.Templates.list_template_records/3.

template_records(client, account_id, template_id, options)

Specs

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

See Dnsimple.Templates.list_template_records/4.

templates(client, account_id)

See Dnsimple.Templates.list_templates/2.

templates(client, account_id, options)

Specs

See Dnsimple.Templates.list_templates/3.

update_template(client, account_id, template_id, attributes, options \\ [])

Specs

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

Updates an existing template.

See https://developer.dnsimple.com/v2/templates/#update

Examples:

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

Dnsimple.Templates.update_template(client, account_id = 1010, template_id = 1, %{

name: "Beta",
short_name: "beta",
description: "A beta template.",

})