Class: Conversant::V3::Services::CDN::Certificate
- Inherits:
-
Object
- Object
- Conversant::V3::Services::CDN::Certificate
- Defined in:
- lib/conversant/v3/services/cdn/certificate.rb
Overview
SSL/TLS certificate management service for CDN domains
Provides comprehensive certificate management functionality including:
- Certificate listing and filtering
- Auto-certificate information retrieval
- Automatic certificate deployment
- Let's Encrypt integration support
Instance Attribute Summary collapse
-
#parent ⇒ CDN
readonly
The parent CDN service instance.
Instance Method Summary collapse
-
#all(params = {}) ⇒ Array<Hash>, Array
Get all SSL certificates for the customer.
-
#auto_certificate_info(certificate_id, name) ⇒ Hash?
Get auto-certificate information for a specific domain.
-
#deploy_auto_certificate(certificate_id, name, payload) ⇒ Boolean
Deploy auto-certificate for a domain.
-
#initialize(parent) ⇒ Certificate
constructor
Initialize certificate service.
Constructor Details
#initialize(parent) ⇒ Certificate
Initialize certificate service
33 34 35 |
# File 'lib/conversant/v3/services/cdn/certificate.rb', line 33 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ CDN (readonly)
Returns the parent CDN service instance.
28 29 30 |
# File 'lib/conversant/v3/services/cdn/certificate.rb', line 28 def parent @parent end |
Instance Method Details
#all(params = {}) ⇒ Array<Hash>, Array
Get all SSL certificates for the customer
Retrieves a comprehensive list of SSL certificates associated with the customer account. Supports filtering and pagination through query parameters.
68 69 70 71 72 73 74 75 76 |
# File 'lib/conversant/v3/services/cdn/certificate.rb', line 68 def all(params = {}) response = @parent.send(:call, 'GET', "/list-certificate?#{params.to_query}") return [] if response.nil? JSON.parse(response)&.[]('list') || [] rescue StandardError => e logger.error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.message}" [] end |
#auto_certificate_info(certificate_id, name) ⇒ Hash?
Get auto-certificate information for a specific domain
Retrieves detailed information about an auto-certificate (Let's Encrypt) for a specific certificate ID and domain name. This includes certificate status, validation details, and deployment configuration.
108 109 110 111 112 113 114 115 116 |
# File 'lib/conversant/v3/services/cdn/certificate.rb', line 108 def auto_certificate_info(certificate_id, name) response = @parent.send(:call, 'GET', "/api/auto-certificate/#{certificate_id}/#{name}") return nil if response.nil? JSON.parse(response) rescue StandardError => e logger.error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.message}" nil end |
#deploy_auto_certificate(certificate_id, name, payload) ⇒ Boolean
Deploy auto-certificate for a domain
Deploys or updates an auto-certificate (Let's Encrypt) configuration for the specified certificate ID and domain. This enables automatic SSL certificate provisioning and renewal.
161 162 163 164 165 166 167 168 169 |
# File 'lib/conversant/v3/services/cdn/certificate.rb', line 161 def deploy_auto_certificate(certificate_id, name, payload) response = @parent.send(:call, 'POST', "/api/auto-certificate/#{certificate_id}/#{name}", payload) return false if response.nil? JSON.parse(response)&.[]('status') == 'ok' rescue StandardError => e logger.error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.message}" false end |