Class: Sumologic::Metadata::App

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/sumologic/metadata/app.rb

Overview

Handles app catalog operations Uses GET /v1/apps endpoint Note: This lists the app catalog (available apps), not installed apps

Instance Method Summary collapse

Constructor Details

#initialize(http_client:) ⇒ App

Returns a new instance of App.



13
14
15
# File 'lib/sumologic/metadata/app.rb', line 13

def initialize(http_client:)
  @http = http_client
end

Instance Method Details

#listArray<Hash>

List available apps from the Sumo Logic app catalog

Returns:

  • (Array<Hash>)

    Array of app data



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/sumologic/metadata/app.rb', line 20

def list
  data = @http.request(
    method: :get,
    path: '/apps'
  )

  apps = data['apps'] || []
  log_info "Fetched #{apps.size} apps from catalog"
  apps
rescue StandardError => e
  raise Error, "Failed to list apps: #{e.message}"
end