View Source Dnsimple.Zones (dnsimple v4.0.0)
Provides functions to interact with the zone endpoints.
See:
Summary
Functions
Activate DNS resolution for the zone in the account.
Returns the distribution status of a zone.
Returns the distribution status of a zone record.
Creates a record in the zone.
Deactivate DNS resolution for the zone in the account.
Deletes a record from the zone.
Returns a zone.
Returns the zone file of the zone.
Returns a zone record.
Returns the records in the zone.
Returns the zones in the account.
Updates a zone record.
Functions
@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")
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")
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)
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,
})
@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")
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)
@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")
@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")
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)
@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: ""])
@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"])
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
})