Module: Bugsnag::Api::Client::Events

Included in:
Bugsnag::Api::Client
Defined in:
lib/bugsnag/api/client/events.rb

Overview

Methods for the Events API

Instance Method Summary collapse

Instance Method Details

#delete_event(project_id, id, options = {}) ⇒ Object

Delete an Event



21
22
23
# File 'lib/bugsnag/api/client/events.rb', line 21

def delete_event(project_id, id, options = {})
  boolean_from_response :delete, "projects/#{project_id}/events/#{id}", options
end

#error_events(project_id, error_id, options = {}) ⇒ Array<Sawyer::Resource>

List the Events on an Error

Parameters:

  • base (Hash)

    a customizable set of options

  • sort (Hash)

    a customizable set of options

  • direction (Hash)

    a customizable set of options

  • filters (Hash)

    a customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    List of Events for the specified Error

See Also:



33
34
35
# File 'lib/bugsnag/api/client/events.rb', line 33

def error_events(project_id, error_id, options = {})
  paginate "projects/#{project_id}/errors/#{error_id}/events", options
end

#event(project_id, id, options = {}) ⇒ Sawyer::Resource

View an Event

Returns:

  • (Sawyer::Resource)

    Requested Event

See Also:



13
14
15
# File 'lib/bugsnag/api/client/events.rb', line 13

def event(project_id, id, options = {})
  get "projects/#{project_id}/events/#{id}", options
end

#events(project_id, options = {}) ⇒ Array<Sawyer::Resource>

List the Events on a Project

Parameters:

  • base (Hash)

    a customizable set of options

  • sort (Hash)

    a customizable set of options

  • direction (Hash)

    a customizable set of options

  • filters (Hash)

    a customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    List of Events for the specified Project

See Also:



53
54
55
# File 'lib/bugsnag/api/client/events.rb', line 53

def events(project_id, options = {})
  get "projects/#{project_id}/events", options
end

#latest_event(error_id, options = {}) ⇒ Sawyer::Resource

View the latest Event on an Error

Returns:

  • (Sawyer::Resource)

    Last event reported Event

See Also:



41
42
43
# File 'lib/bugsnag/api/client/events.rb', line 41

def latest_event(error_id, options = {})
  get "errors/#{error_id}/latest_event", options
end