dnsimple v1.2.0 Dnsimple.Certificates
Provides functions to interact with the SSL certificate endpoints.
Summary
Functions
Get the PEM-encoded certificate, along with the root certificate and intermediate chain
Get the details of a certificate
Get the PEM-encoded certificate private key
Issue a pending Let’s Encrypt certificate order
Issue a pending Let’s Encrypt certificate renewal order
List certificates for a domain in the account
Purchase a Let’s Encrypt certificate
Purchase a Let’s Encrypt certificate renewal
Functions
Specs
download_certificate(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Get the PEM-encoded certificate, along with the root certificate and intermediate chain.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.download_certificate(client, account_id = "1010", domain_id = "example.com")
Specs
get_certificate(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Get the details of a certificate.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.get_certificate(client, account_id = "1010", domain_id = "example.com")
Specs
get_certificate_private_key(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Get the PEM-encoded certificate private key.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.get_certificate_private_key(client, account_id = "1010", domain_id = "example.com")
Specs
issue_letsencrypt_certificate(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Issue a pending Let’s Encrypt certificate order.
Note that the issuance process is async. A successful response means the issuance request has been successfully acknowledged and queued for processing.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.issue_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", purchase_id = 100)
Specs
issue_letsencrypt_certificate_renewal(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Issue a pending Let’s Encrypt certificate renewal order.
Note that the issuance process is async. A successful response means the issuance request has been successfully acknowledged and queued for processing.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.issue_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", certificate_id = 100, renewal_id: 200)
Specs
list_certificates(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
List certificates for a domain in the account.
See:
Examples:
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com")
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com", page: 2, per_page: 10)
{:ok, response} = Dnsimple.Certificates.list_certificates(client, account_id = "1010", domain_id = "example.com", sort: "expires_on:desc")
Specs
purchase_letsencrypt_certificate(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Purchase a Let’s Encrypt certificate.
This method creates a new purchase order. The order ID should be used to
request the issuance of the certificate using #issue_letsencrypt_certificate
.
See:
Examples
# Purchase a certificate for a single name
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, name: "www")
purchase_id = response.data.id
# Purchase a certificate for multiple names (SAN)
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, alternate_names: ["example.com", "www.example.com", "status.example.com"])
# Enable auto-renew on purchase
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, auto_renew: true)
Specs
purchase_letsencrypt_certificate_renewal(Dnsimple.Client.t, String.t | integer, String.t | integer, integer, Keyword.t, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}
Purchase a Let’s Encrypt certificate renewal.
This method creates a new renewal order. The order ID should be used to
request the issuance of the certificate using #issue_letsencrypt_certificate_renewal
.
See:
Examples
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate_renewal(client, account_id = "1010", domain_id = "example.com", certificate_id = 100)
renewal_id = response.data.id
# Enable auto-renew on purchase
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate_renewal(client, account_id = "1010", domain_id = "example.com", certificate_id = 100, auto_renew: true)