dnsimple v1.2.0 Dnsimple.Zones

Provides functions to interact with the zone endpoints.

See:

Summary

Functions

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

Specs

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,
})
delete_zone_record(client, account_id, zone_id, record_id, options \\ [])

Specs

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)
get_zone(client, account_id, zone_id, options \\ [])

Specs

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")
get_zone_file(client, account_id, zone_id, options \\ [])

Specs

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")
get_zone_record(client, account_id, zone_id, record_id, options \\ [])

Specs

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)
list_zone_records(client, account_id, zone_id, options \\ [])

Specs

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: ""])
list_zones(client, account_id, options \\ [])

Specs

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"])
update_zone_record(client, account_id, zone_id, record_id, attributes, options \\ [])

Specs

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
})