class Kontena::Cli::Certificate::GetCommand

Constants

Public Instance Methods

execute() click to toggle source
# File lib/kontena/cli/certificate/get_command.rb, line 16
def execute
  warn BANNER

  require_api_url
  token = require_token
  secret = secret_name || "LE_CERTIFICATE_#{domain_list[0].gsub('.', '_')}"
  data = {domains: domain_list, secret_name: secret}

  response = client(token).post("certificates/#{current_grid}/certificate", data)
  puts "Certificate successfully received and stored into vault with keys:"
  response.each do |secret|
    puts pastel.green(secret)
  end
  puts "Use the #{secret}_BUNDLE with Kontena loadbalancer!"

end