module PagerDuty::Client::LogEntries

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:

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.

@see v2.developer.pagerduty.com/v2/page/api-reference#!/Log_Entries

Public Instance Methods

get_log_entry(id, options = {})
Alias for: log_entry
list_log_entries(options = {})
Alias for: log_entries
log_entries(options = {}) click to toggle source

List all of the incident log entries across the entire account. @param options [Sawyer::Resource] A customizable set of options. @option options [String] :time_zone Time zone in which dates in the result will be rendered. @option options [String] :since The start of the date range over which you want to search ISO8601 format @option options [String] :until The end of the date range over which you want to search ISO8601 format @option options [Boolean] :is_overview If true, will return a subset of log entries that show only the most important changes to the incident. @option options [Array<String>] :include Array of additional details to include. (One or more of incidents, services, channels or teams.) @return [Array<Sawyer::Resource>] An array of hashes representing log_entries @see v2.developer.pagerduty.com/v2/page/api-reference#!/Log_Entries/get_log_entries

# File lib/pager_duty/client/log_entries.rb, line 32
def log_entries(options = {})
  query_params = Hash.new
  query_params[:since] = options[:since].utc.iso8601 if options[:since]
  query_params[:until] = options[:until].utc.iso8601 if options[:until]
  query_params[:time_zone] = options[:time_zone] if options[:time_zone]
  query_params[:is_overview] = options.fetch(:is_overview, false)
  query_params[:include]       = options[:include] if options[:include]

  response = get "/log_entries", options.merge({query: query_params})
  response[:log_entries]
end
Also aliased as: list_log_entries
log_entry(id, options = {}) click to toggle source

Get details for a specific incident log entry. This method provides additional information you can use to get at raw event data.

@param id [String] A log entry id (required) @param options [Sawyer::Resource] A customizable set of options. @option options [String] :time_zone Default to UTC @option options [Array<String>] :include Array of additional details to include. (One or more of incidents, services, channels or teams.) @return [Sawyer::Resource] A hash representing log entry @see v2.developer.pagerduty.com/v2/page/api-reference#!/Log_Entries/get_log_entries_id

# File lib/pager_duty/client/log_entries.rb, line 53
def log_entry(id, options = {})
  query_params = Hash.new
  query_params[:time_zone] = options[:time_zone] if options[:time_zone]
  query_params[:include]   = options[:include] if options[:include]

  response = get "/log_entries/#{id}", options.merge({query: query_params})
  response[:log_entry]
end
Also aliased as: get_log_entry