Class: ForemanRhCloud::CloudPingService
- Inherits:
-
Object
- Object
- ForemanRhCloud::CloudPingService
- Defined in:
- app/services/foreman_rh_cloud/cloud_ping_service.rb
Defined Under Namespace
Classes: CertPing
Instance Method Summary collapse
-
#initialize(organizations, logger) ⇒ CloudPingService
constructor
A new instance of CloudPingService.
- #ping ⇒ Object
Constructor Details
#initialize(organizations, logger) ⇒ CloudPingService
Returns a new instance of CloudPingService.
37 38 39 40 |
# File 'app/services/foreman_rh_cloud/cloud_ping_service.rb', line 37 def initialize(organizations, logger) @organizations = organizations @logger = logger end |
Instance Method Details
#ping ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/services/foreman_rh_cloud/cloud_ping_service.rb', line 42 def ping { cert_auth: Hash[ @organizations.map do |org| cert_response = CertPing.new(org, @logger).ping [ org, { success: cert_response.is_a?(RestClient::Response), error: (cert_response.is_a?(Exception) ? cert_response&. || cert_response.inspect : nil), }, ] end ], } end |