Class: PassiveTotal::Client::Monitor

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/monitor.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#alerts(project: nil, artifact: nil, start_at: nil, end_at: nil) ⇒ Hash

Retrieve all alerts associated with an artifact or project. api.passivetotal.org/api/docs/#api-Monitor-GetV2Monitor

Parameters:

  • project (String, nil) (defaults to: nil)

    the project to filter on

  • artifact (String, nil) (defaults to: nil)

    the artifact to filter on

  • start (String, nll)

    filter results to after this datetime

  • end (String, nil)

    filter results to before this datetime

Returns:

  • (Hash)


17
18
19
20
21
22
23
24
25
26
# File 'lib/passivetotal/clients/monitor.rb', line 17

def alerts(project: nil, artifact: nil, start_at: nil, end_at: nil)
  params = {
    project: project,
    artifact: artifact,
    start: start_at,
    end: end_at,
  }.compact

  _get("/monitor", params) { |json| json }
end