Class: DNSimple::Commands::DescribeCertificate

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsimple/commands/describe_certificate.rb

Instance Method Summary collapse

Instance Method Details

#execute(args, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dnsimple/commands/describe_certificate.rb', line 4

def execute(args, options={})
  domain_name = args.shift
  certificate_id = args.shift
  domain = Domain.find(domain_name)
  certificate = Certificate.find(domain, certificate_id)
  puts "Certificate: #{certificate.fqdn}"
  puts "\tID: #{certificate.id}"
  puts "\tStatus: #{certificate.certificate_status}"
  puts "\tCreated: #{certificate.created_at}"
  puts "\tOrder Date: #{certificate.order_date}"
  puts "\tExpires: #{certificate.expiration_date}"

  if certificate.approver_email =~ /\S+/
    puts "\tApprover email: #{certificate.approver_email}"
  else
    puts "\tAvailable approver emails:"
    certificate.available_approver_emails.split(",").each do |email|
      puts "\t\t#{email}"
    end
  end
  
  puts
  puts "#{certificate.csr}"
  puts
  puts "#{certificate.private_key}"
  puts 
  puts "#{certificate.ssl_certificate}"
end