Class: Sumologic::CLI::Commands::ListMonitorsCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/sumologic/cli/commands/list_monitors_command.rb

Overview

Handles the list-monitors command execution Uses the monitors search API for flat, filterable results

Instance Attribute Summary

Attributes inherited from BaseCommand

#client, #options

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from Sumologic::CLI::Commands::BaseCommand

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
# File 'lib/sumologic/cli/commands/list_monitors_command.rb', line 11

def execute
  list_resource(label: 'monitors', key: :monitors) do
    client.list_monitors(
      query: options[:query],
      status: options[:status],
      limit: options[:limit] || 100
    )
  end
end