View Source Dnsimple.Zones (dnsimple v4.0.0)

Provides functions to interact with the zone endpoints.

See:

Summary

Functions

Link to this function

activate_dns(client, account_id, zone_id, options \\ [])

View Source
@spec activate_dns(
  Dnsimple.Client.t(),
  integer() | String.t(),
  integer() | String.t(),
  Keyword.t()
) ::
  {:ok | :error, Dnsimple.Response.t()}

Activate DNS resolution for the zone in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.activate_dns(client, account_id = 1010, zone_id = "example.com")
Link to this function

check_zone_distribution(client, account_id, zone_id, options \\ [])

View Source
@spec check_zone_distribution(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Returns the distribution status of a zone.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.check_zone_distribution(client, account_id = 1010, zone_id = 12)
{:ok, response} = Dnsimple.Zones.check_zone_distribution(client, account_id = 1010, zone_id = "example.com")
Link to this function

check_zone_record_distribution(client, account_id, zone_id, record_id, options \\ [])

View Source
@spec check_zone_record_distribution(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Returns the distribution status of a zone record.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.check_zone_record_distribution(client, account_id = 1010, zone_id = 12, record_id = 999)
{:ok, response} = Dnsimple.Zones.check_zone_record_distribution(client, account_id = 1010, zone_id = "example.com", record_id = 999)
Link to this function

create_zone_record(client, account_id, zone_id, attributes, options \\ [])

View Source
@spec create_zone_record(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Creates a record in the zone.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.create_zone_record(client, account_id = 1010, zone_id = "example.com", %{
  name: "www",
  type: "CNAME",
  content: "example.com",
  ttl: 3600,
})
Link to this function

deactivate_dns(client, account_id, zone_id, options \\ [])

View Source
@spec deactivate_dns(
  Dnsimple.Client.t(),
  integer() | String.t(),
  integer() | String.t(),
  Keyword.t()
) ::
  {:ok | :error, Dnsimple.Response.t()}

Deactivate DNS resolution for the zone in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.deactivate_dns(client, account_id = 1010, zone_id = "example.com")
Link to this function

delete_zone_record(client, account_id, zone_id, record_id, options \\ [])

View Source
@spec delete_zone_record(
  Dnsimple.Client.t(),
  String.t(),
  String.t(),
  integer(),
  Keyword.t()
) ::
  {:ok | :error, Dnsimple.Response.t()}

Deletes a record from the zone.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.delete_zone_record(client, account_id = 1010, zone_id = 12, record_id = 1)
{:ok, response} = Dnsimple.Zones.delete_zone_record(client, account_id = 1010, zone_id = "example.com", record_id = 1)
Link to this function

get_zone(client, account_id, zone_id, options \\ [])

View Source
@spec get_zone(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) ::
  {:ok | :error, Dnsimple.Response.t()}

Returns a zone.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.get_zone(client, account_id = 1010, zone_id = 12)
{:ok, response} = Dnsimple.Zones.get_zone(client, account_id = 1010, zone_id = "example.com")
Link to this function

get_zone_file(client, account_id, zone_id, options \\ [])

View Source
@spec get_zone_file(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) ::
  {:ok | :error, Dnsimple.Response.t()}

Returns the zone file of the zone.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.get_zone_file(client, account_id = 1010, zone_id = 12)
{:ok, response} = Dnsimple.Zones.get_zone_file(client, account_id = 1010, zone_id = "example.com")
Link to this function

get_zone_record(client, account_id, zone_id, record_id, options \\ [])

View Source
@spec get_zone_record(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Returns a zone record.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.get_zone_record(client, account_id = 1010, zone_id = 12, record_id = 345)
{:ok, response} = Dnsimple.Zones.get_zone_record(client, account_id = 1010, zone_id = "example.com", record_id = 123)
Link to this function

list_zone_records(client, account_id, zone_id, options \\ [])

View Source
@spec list_zone_records(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Returns the records in the zone.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.list_zone_records(client, account_id = 1010, zone_id = "example.com")
{:ok, response} = Dnsimple.Zones.list_zone_records(client, account_id = 1010, zone_id = 12, page: 2, per_page: 10)
{:ok, response} = Dnsimple.Zones.list_zone_records(client, account_id = 1010, zone_id = "example.com", sort: "type:asc")
{:ok, response} = Dnsimple.Zones.list_zone_records(client, account_id = 1010, zone_id = 12, filter: [type: "A", name: ""])
Link to this function

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

View Source
@spec list_zones(Dnsimple.Client.t(), String.t() | integer(), Keyword.t()) ::
  {:ok | :error, Dnsimple.Response.t()}

Returns the zones in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.list_zones(client, account_id = 1010)
{:ok, response} = Dnsimple.Zones.list_zones(client, account_id = 1010, page: 2, per_page: 10)
{:ok, response} = Dnsimple.Zones.list_zones(client, account_id = 1010, sort: "name:desc")
{:ok, response} = Dnsimple.Zones.list_zones(client, account_id = 1010, filter: [name_like: ".es"])
Link to this function

update_zone_record(client, account_id, zone_id, record_id, attributes, options \\ [])

View Source
@spec update_zone_record(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  integer(),
  Keyword.t(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Updates a zone record.

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Zones.update_zone_record(client, account_id = 1010, zone_id = "example.com", record_id = 1, %{
  ttl: 600
})