Class: Acmaker::Driver
- Inherits:
-
Object
- Object
- Acmaker::Driver
- Includes:
- Logger::Helper, Utils::Helper
- Defined in:
- lib/acmaker/driver.rb
Instance Method Summary collapse
- #create_certificate(domain_name, expected_certificate) ⇒ Object
- #delete_certificate(domain_name, certificate_arn) ⇒ Object
-
#initialize(client, options = {}) ⇒ Driver
constructor
A new instance of Driver.
Methods included from Utils::Helper
Methods included from Logger::Helper
Constructor Details
#initialize(client, options = {}) ⇒ Driver
Returns a new instance of Driver.
6 7 8 9 |
# File 'lib/acmaker/driver.rb', line 6 def initialize(client, = {}) @client = client @options = end |
Instance Method Details
#create_certificate(domain_name, expected_certificate) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/acmaker/driver.rb', line 11 def create_certificate(domain_name, expected_certificate) log(:info, "Create Domain `#{domain_name}` Certificate", color: :cyan) unless @options[:dry_run] resp = @client.request_certificate(expected_certificate) log(:info, "Certificate arn `#{resp.certificate_arn}` has been created", color: :cyan) end end |
#delete_certificate(domain_name, certificate_arn) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/acmaker/driver.rb', line 20 def delete_certificate(domain_name, certificate_arn) log(:info, "Delete Domain `#{domain_name}` Certificate", color: :red) unless @options[:dry_run] @client.delete_certificate(certificate_arn: certificate_arn) end end |