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>
Lists ALL the certificates for the domain.
-
#certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Certificate>
Gets a certificate associated to the domain.
-
#certificate_private_key(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Get certificate private key associated to the domain.
-
#certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Certificate>
Lists the certificates associated to the domain.
-
#download_certificate(account_id, domain_id, certificate_id, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateBundle>
Downloads a certificate associated to the domain.
Instance Method Details
#all_certificates(account_id, domain_name, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Certificate>
Lists ALL the certificates for the domain.
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.
53 54 55 |
# File 'lib/dnsimple/client/certificates.rb', line 53 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>
Gets a certificate associated to the domain.
69 70 71 72 73 |
# File 'lib/dnsimple/client/certificates.rb', line 69 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 certificate private key associated to the domain.
105 106 107 108 109 |
# File 'lib/dnsimple/client/certificates.rb', line 105 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>
Lists the certificates associated to the domain.
27 28 29 30 31 |
# File 'lib/dnsimple/client/certificates.rb', line 27 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>
Downloads a certificate associated to the domain.
87 88 89 90 91 |
# File 'lib/dnsimple/client/certificates.rb', line 87 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 |