Class: ForemanX509::Api::V2::CertificatesController
- Inherits:
-
BaseController
- Object
- Api::V2::BaseController
- BaseController
- ForemanX509::Api::V2::CertificatesController
- Defined in:
- app/controllers/foreman_x509/api/v2/certificates_controller.rb
Instance Method Summary collapse
- #certificate ⇒ Object
- #chain ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #key ⇒ Object
- #resource_class ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#certificate ⇒ Object
37 38 39 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 37 def certificate send_data @certificate.certificate.to_pem, filename: "#{@certificate.name}_cert.pem" end |
#chain ⇒ Object
31 32 33 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 31 def chain send_data @certificate.issuer.bundle.map(&:to_pem).join('\n'), filename: "#{@certificate.name}_ca.pem" end |
#create ⇒ Object
20 21 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 20 def create end |
#destroy ⇒ Object
49 50 51 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 49 def destroy process_response @certificate.destroy end |
#index ⇒ Object
16 17 18 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 16 def index @certificates = resource_scope_for_index end |
#key ⇒ Object
43 44 45 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 43 def key send_data @certificate.key.to_pem, filename: "#{@certificate.name}_key.pem" end |
#resource_class ⇒ Object
53 54 55 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 53 def resource_class ForemanX509::Certificate end |
#show ⇒ Object
23 24 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 23 def show end |
#update ⇒ Object
26 27 |
# File 'app/controllers/foreman_x509/api/v2/certificates_controller.rb', line 26 def update end |