Class: Sumologic::Metadata::HealthEvent
- Inherits:
-
Object
- Object
- Sumologic::Metadata::HealthEvent
- Includes:
- Loggable
- Defined in:
- lib/sumologic/metadata/health_event.rb
Overview
Handles health event operations Uses GET /v1/healthEvents endpoint
Instance Method Summary collapse
-
#initialize(http_client:) ⇒ HealthEvent
constructor
A new instance of HealthEvent.
-
#list(limit: 100) ⇒ Array<Hash>
List all health events.
Constructor Details
#initialize(http_client:) ⇒ HealthEvent
Returns a new instance of HealthEvent.
12 13 14 |
# File 'lib/sumologic/metadata/health_event.rb', line 12 def initialize(http_client:) @http = http_client end |
Instance Method Details
#list(limit: 100) ⇒ Array<Hash>
List all health events
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sumologic/metadata/health_event.rb', line 20 def list(limit: 100) data = @http.request( method: :get, path: '/healthEvents', query_params: { limit: limit } ) events = data['data'] || [] log_info "Fetched #{events.size} health events" events rescue StandardError => e raise Error, "Failed to list health events: #{e.message}" end |