Module: PagerDuty::Client::LogEntries
- Included in:
- PagerDuty::Client
- Defined in:
- lib/pager_duty/client/log_entries.rb
Overview
Module encompassing interactions with the incidents API endpoint
PagerDuty keeps a log of all the events that happen to an incident
These are exposed as log entries.
Log entries give you more insight into how your team or organization is handling your incidents.
Log entry data includes details about the event(s) that affected the incident throughout its lifecycle, such as:
-
the data contained in events sent by the integration
-
what users were notified and when
-
how they were notified
-
what user(s) acknowledged or resolved the incident
-
any automatic actions that occurred to the incident
-
other manual user actions, such as a reassignment or a note
Log entries cannot be created directly through the API; they are a result of other actions. The API provides read-only access to the log entries generated by PagerDuty.
Instance Method Summary collapse
-
#log_entries(options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_log_entries)
List all of the incident log entries across the entire account.
-
#log_entry(id, options = {}) ⇒ Sawyer::Resource
(also: #get_log_entry)
Get details for a specific incident log entry.
Instance Method Details
#log_entries(options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_log_entries
List all of the incident log entries across the entire account.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pager_duty/client/log_entries.rb', line 32 def log_entries( = {}) query_params = Hash.new query_params[:since] = [:since].utc.iso8601 if [:since] query_params[:until] = [:until].utc.iso8601 if [:until] query_params[:time_zone] = [:time_zone] if [:time_zone] query_params[:is_overview] = .fetch(:is_overview, false) query_params[:include] = [:include] if [:include] response = get "/log_entries", .merge({query: query_params}) response[:log_entries] end |
#log_entry(id, options = {}) ⇒ Sawyer::Resource Also known as: get_log_entry
Get details for a specific incident log entry. This method provides additional information you can use to get at raw event data.
53 54 55 56 57 58 59 60 |
# File 'lib/pager_duty/client/log_entries.rb', line 53 def log_entry(id, = {}) query_params = Hash.new query_params[:time_zone] = [:time_zone] if [:time_zone] query_params[:include] = [:include] if [:include] response = get "/log_entries/#{id}", .merge({query: query_params}) response[:log_entry] end |