Class: Sumologic::Metadata::App
- Inherits:
-
Object
- Object
- Sumologic::Metadata::App
- 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
-
#initialize(http_client:) ⇒ App
constructor
A new instance of App.
-
#list ⇒ Array<Hash>
List available apps from the Sumo Logic app catalog.
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
#list ⇒ Array<Hash>
List available apps from the Sumo Logic app catalog
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 |