Sitesx v0.11.0 Sitesx.DNS behaviour View Source

DNS adapter and behaviour.

Example

use Sitesx.DNS

Then must be implemented create_subdomain, dns_records, create_dns_record functions.

Now Sitesx has Sitesx.DNS.Digitalocean, Sitesx.DNS.Cloudflare DNS modules.

Implementats domain behavior for Digitalocean DNS API

Create subdomain if not exists through the Digitalocean DNS API

Sitesx.Domain.create_subdomain "subdomain-name"

Get dns records

Sitesx.Domain.dns_records

Options

  • :domain - default: extract from mix config

GET /v2/domains/$DOMAIN_NAME/records

Documentation

Create a dns record

Sitesx.Domain.create_dns_record name: "wwww"

Options

  • :name - require: subdomain name
  • :domain - default: extract from mix config

POST /v2/domains/$DOMAIN_NAME/records

Documentation

Implementats domain behavior for Cloudflare DNS API

Create subdomain if not exists through the Cloudflare DNS API

Sitesx.Domain.create_subdomain "subdomain-name"

Get dns records

Sitesx.Domain.dns_records

Options

  • :domain - default: extract from mix config

GET zones/:zone_identifier/dns_records

Create a dns record

Sitesx.Domain.create_dns_record name: "wwww"

Options

  • :name - require: subdomain name
  • :domain - default: extract from mix config

POST zones/:zone_identifier/dns_records

Documentation

Link to this section Summary

Callbacks

Create a dns record

Create subdomain if not exists

Create subdomain if not exists

Link to this section Callbacks

Link to this callback create_dns_record(params) View Source
create_dns_record(params :: list) ::
  {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t | term} |
  {:error, Error.t}

Create a dns record

Example

Sitesx.Domain.create_dns_record name: "www"
Link to this callback create_subdomain(subdomain, params) View Source
create_subdomain(subdomain :: String.t, params :: list) ::
  {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t | term} |
  {:error, Error.t}

Create subdomain if not exists.

Example

Sitesx.Domain.create_subdomain "www"
Link to this callback dns_records(params) View Source
dns_records(params :: list) ::
  {:ok, HTTPoison.Response.t | HTTPoison.AsyncResponse.t | term} |
  {:error, Error.t}

Create subdomain if not exists.

Example

Sitesx.Domain.dns_records