Module: Dnsimple::Client::Certificates
- Included in:
- CertificatesService
- Defined in:
- lib/dnsimple/client/certificates.rb
Instance Method Summary collapse
-
#all_certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Certificate>
List ALL the certificates for the domain in the account.
-
#certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Get the details of a certificate.
-
#certificate_private_key(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get the PEM-encoded certificate private key.
-
#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate>
(also: #list_certificates)
List the certificates for the domain in the account.
-
#download_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get the PEM-encoded certificate, along with the root certificate and intermediate chain.
-
#issue_letsencrypt_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Issue a pending Let’s Encrypt certificate order.
-
#issue_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, certificate_renewal_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Issue a pending Let’s Encrypt certificate renewal order.
-
#purchase_letsencrypt_certificate(account_id, domain_id, attributes = {}, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificatPurchase>
Purchase a Let’s Encrypt certificate.
-
#purchase_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, attributes = {}, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateRenewal>
Purchase a Let’s Encrypt certificate renewal.
Instance Method Details
#all_certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Certificate>
List ALL the certificates for the domain in the account.
This method is similar to #certificates, but instead of returning the results of a specific page it iterates all the pages and returns the entire collection.
Please use this method carefully, as fetching the entire collection will increase the number of requests you send to the API server and you may eventually risk to hit the throttle limit.
55 56 57 |
# File 'lib/dnsimple/client/certificates.rb', line 55 def all_certificates(account_id, domain_name, = {}) paginate(:certificates, account_id, domain_name, ) end |
#certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Get the details of a certificate.
71 72 73 74 75 |
# File 'lib/dnsimple/client/certificates.rb', line 71 def certificate(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::Certificate.new(response["data"])) end |
#certificate_private_key(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get the PEM-encoded certificate private key.
107 108 109 110 111 |
# File 'lib/dnsimple/client/certificates.rb', line 107 def certificate_private_key(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s/private_key" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::CertificateBundle.new(response["data"])) end |
#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate> Also known as: list_certificates
List the certificates for the domain in the account.
28 29 30 31 32 |
# File 'lib/dnsimple/client/certificates.rb', line 28 def certificates(account_id, domain_name, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates" % [account_id, domain_name]), Options::ListOptions.new()) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Certificate.new(r) }) end |
#download_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get the PEM-encoded certificate, along with the root certificate and intermediate chain.
89 90 91 92 93 |
# File 'lib/dnsimple/client/certificates.rb', line 89 def download_certificate(account_id, domain_id, certificate_id, = {}) response = client.get(Client.versioned("/%s/domains/%s/certificates/%s/download" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::CertificateBundle.new(response["data"])) end |
#issue_letsencrypt_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
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.
206 207 208 209 210 |
# File 'lib/dnsimple/client/certificates.rb', line 206 def issue_letsencrypt_certificate(account_id, domain_id, certificate_id, = {}) response = client.post(Client.versioned("/%s/domains/%s/certificates/letsencrypt/%s/issue" % [account_id, domain_id, certificate_id]), ) Dnsimple::Response.new(response, Struct::Certificate.new(response["data"])) end |
#issue_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, certificate_renewal_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
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.
281 282 283 284 285 |
# File 'lib/dnsimple/client/certificates.rb', line 281 def issue_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, certificate_renewal_id, = {}) response = client.post(Client.versioned("/%s/domains/%s/certificates/letsencrypt/%s/renewals/%s/issue" % [account_id, domain_id, certificate_id, certificate_renewal_id]), ) Dnsimple::Response.new(response, Struct::Certificate.new(response["data"])) end |
#purchase_letsencrypt_certificate(account_id, domain_id, attributes = {}, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificatPurchase>
Purchase a Let’s Encrypt certificate.
This method creates a new certificate order. The certificate ID should be used to request the issuance of the certificate using #issue_letsencrypt_certificate.
178 179 180 181 182 |
# File 'lib/dnsimple/client/certificates.rb', line 178 def purchase_letsencrypt_certificate(account_id, domain_id, attributes = {}, = {}) response = client.post(Client.versioned("/%s/domains/%s/certificates/letsencrypt" % [account_id, domain_id]), attributes, ) Dnsimple::Response.new(response, Struct::CertificatePurchase.new(response["data"])) end |
#purchase_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, attributes = {}, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateRenewal>
Purchase a Let’s Encrypt certificate renewal.
252 253 254 255 256 |
# File 'lib/dnsimple/client/certificates.rb', line 252 def purchase_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, attributes = {}, = {}) response = client.post(Client.versioned("/%s/domains/%s/certificates/letsencrypt/%s/renewals" % [account_id, domain_id, certificate_id]), attributes, ) Dnsimple::Response.new(response, Struct::CertificateRenewal.new(response["data"])) end |