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.
56 57 58 |
# File 'lib/dnsimple/client/certificates.rb', line 56 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.
72 73 74 75 76 |
# File 'lib/dnsimple/client/certificates.rb', line 72 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.
108 109 110 111 112 |
# File 'lib/dnsimple/client/certificates.rb', line 108 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.
29 30 31 32 33 |
# File 'lib/dnsimple/client/certificates.rb', line 29 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.
90 91 92 93 94 |
# File 'lib/dnsimple/client/certificates.rb', line 90 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.
207 208 209 210 211 |
# File 'lib/dnsimple/client/certificates.rb', line 207 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.
282 283 284 285 286 |
# File 'lib/dnsimple/client/certificates.rb', line 282 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.
179 180 181 182 183 |
# File 'lib/dnsimple/client/certificates.rb', line 179 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.
253 254 255 256 257 |
# File 'lib/dnsimple/client/certificates.rb', line 253 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 |