Method: Dnsimple::Client::Certificates#purchase_letsencrypt_certificate_renewal

Defined in:
lib/dnsimple/client/certificates.rb

#purchase_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, attributes = {}, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::CertificateRenewal>

Purchase a Let’s Encrypt certificate renewal.

Examples:

Basic usage

response            = client.certificates.purchase_letsencrypt_certificate_renewal(1010, "example.com", 200)
certificate_renewal = response.data

certificate_renewal.id                 # => 999
certificate_renewal.old_certificate_id # => 200
certificate_renewal.new_certificate_id # => 300

Auto renew

response            = client.certificates.purchase_letsencrypt_certificate_renewal(1010, "example.com", 200, auto_renew: true)
certificate_renewal = response.data

certificate_renewal.id                 # => 999
certificate_renewal.old_certificate_id # => 200
certificate_renewal.new_certificate_id # => 300

Signature Algorithm

response            = client.certificates.purchase_letsencrypt_certificate_renewal(1010, "example.com", 200, signature_algorithm: "RSA")
certificate_renewal = response.data

certificate_renewal.id                 # => 999
certificate_renewal.old_certificate_id # => 200
certificate_renewal.new_certificate_id # => 300

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    the domain ID or domain name

  • certificate_id (Integer)

    the certificate ID

  • attributes (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

Options Hash (attributes):

  • :auto_renew (TrueClass, FalseClass)

    enable certificate auto renew (optional)

  • :signature_algorithm (String)

    the signature algorithm used to sign the certificate (optional)

Returns:

Raises:

See Also:



253
254
255
256
257
# File 'lib/dnsimple/client/certificates.rb', line 253

def purchase_letsencrypt_certificate_renewal(, domain_id, certificate_id, attributes = {}, options = {})
  response = client.post(Client.versioned("/%s/domains/%s/certificates/letsencrypt/%s/renewals" % [, domain_id, certificate_id]), attributes, options)

  Dnsimple::Response.new(response, Struct::CertificateRenewal.new(response["data"]))
end