Module: Arbor::Peakflow::Alerts

Included in:
Client
Defined in:
lib/arbor_peakflow_ruby/actions/alerts.rb

Instance Method Summary collapse

Instance Method Details

#alerts(filter = nil, limit = nil, format = 'json') ⇒ Object

The alerts function allows you to search for and retrieve JSON or XML alert information.

Parameters:

  • filter: (Optional) Keywords by which you want to filter search

results. You can enter the same search strings that you can enter in the Search box on the Alerts pages in the Web UI.

  • limit: (Optional) The maximum number of alerts to return that match

the filter.

  • format: The format in which you want the data returned:

‘json’ or ‘xml’

Example

response = client.alerts 'host', 100, 'json'


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/arbor_peakflow_ruby/actions/alerts.rb', line 19

def alerts(filter = nil, limit = nil, format = 'json')
  response = @conn.get do |req|
    req.url 'arborws/alerts'
    req.params['api_key'] = @api_key
    req.params['format'] = format
    req.params['filter'] = filter unless filter.nil?
    req.params['limit'] = limit unless limit.nil?
  end

  response
end