Skip to content

Latest commit

 

History

History
1023 lines (747 loc) · 45.3 KB

AnalyticsApi.md

File metadata and controls

1023 lines (747 loc) · 45.3 KB

PagerDutyOpenapiClient::AnalyticsApi

All URIs are relative to https://api.pagerduty.com

Method HTTP request Description
get_analytics_incident_responses_by_id GET /analytics/raw/incidents/{id}/responses Get raw responses from a single incident
get_analytics_incidents POST /analytics/raw/incidents Get raw data - multiple incidents
get_analytics_incidents_by_id GET /analytics/raw/incidents/{id} Get raw data - single incident
get_analytics_metrics_incidents_all POST /analytics/metrics/incidents/all Get aggregated incident data
get_analytics_metrics_incidents_escalation_policy POST /analytics/metrics/incidents/escalation_policies Get aggregated escalation policy data
get_analytics_metrics_incidents_escalation_policy_all POST /analytics/metrics/incidents/escalation_policies/all Get aggregated metrics for all escalation policies
get_analytics_metrics_incidents_service POST /analytics/metrics/incidents/services Get aggregated service data
get_analytics_metrics_incidents_service_all POST /analytics/metrics/incidents/services/all Get aggregated metrics for all services
get_analytics_metrics_incidents_team POST /analytics/metrics/incidents/teams Get aggregated team data
get_analytics_metrics_incidents_team_all POST /analytics/metrics/incidents/teams/all Get aggregated metrics for all teams
get_analytics_metrics_responders_all POST /analytics/metrics/responders/all Get aggregated metrics for all responders
get_analytics_metrics_responders_team POST /analytics/metrics/responders/teams Get responder data aggregated by team
get_analytics_responder_incidents POST /analytics/raw/responders/{responder_id}/incidents Get raw incidents for a single responder_id

get_analytics_incident_responses_by_id

get_analytics_incident_responses_by_id(id, accept, content_type, opts)

Get raw responses from a single incident

Provides enriched responder data for a single incident. Example metrics include Time to Respond, Responder Type, and Response Status. See metric definitions below. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incident responses appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
id = 'id_example' # String | The ID of the resource.
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  get_analytics_incident_responses_by_id_request: PagerDutyOpenapiClient::GetAnalyticsIncidentResponsesByIdRequest.new # GetAnalyticsIncidentResponsesByIdRequest | Parameters to apply to the dataset.
}

begin
  # Get raw responses from a single incident
  result = api_instance.get_analytics_incident_responses_by_id(id, accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incident_responses_by_id: #{e}"
end

Using the get_analytics_incident_responses_by_id_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_incident_responses_by_id_with_http_info(id, accept, content_type, opts)

begin
  # Get raw responses from a single incident
  data, status_code, headers = api_instance.get_analytics_incident_responses_by_id_with_http_info(id, accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsIncidentResponsesById200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incident_responses_by_id_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The ID of the resource.
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
get_analytics_incident_responses_by_id_request GetAnalyticsIncidentResponsesByIdRequest Parameters to apply to the dataset. [optional]

Return type

GetAnalyticsIncidentResponsesById200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_incidents

get_analytics_incidents(accept, content_type, opts)

Get raw data - multiple incidents

Provides enriched incident data and metrics for multiple incidents. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > A team_ids or service_ids filter is required for user-level API keys or keys generated through an OAuth flow. Account-level API keys do not have this requirement. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  get_analytics_incidents_request: PagerDutyOpenapiClient::GetAnalyticsIncidentsRequest.new # GetAnalyticsIncidentsRequest | Parameters and filters to apply to the dataset.
}

begin
  # Get raw data - multiple incidents
  result = api_instance.get_analytics_incidents(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incidents: #{e}"
end

Using the get_analytics_incidents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_incidents_with_http_info(accept, content_type, opts)

begin
  # Get raw data - multiple incidents
  data, status_code, headers = api_instance.get_analytics_incidents_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsIncidents200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incidents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
get_analytics_incidents_request GetAnalyticsIncidentsRequest Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsIncidents200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_incidents_by_id

get_analytics_incidents_by_id(id, accept, content_type)

Get raw data - single incident

Provides enriched incident data and metrics for a single incident. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
id = 'id_example' # String | The ID of the resource.
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 

begin
  # Get raw data - single incident
  result = api_instance.get_analytics_incidents_by_id(id, accept, content_type)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incidents_by_id: #{e}"
end

Using the get_analytics_incidents_by_id_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_incidents_by_id_with_http_info(id, accept, content_type)

begin
  # Get raw data - single incident
  data, status_code, headers = api_instance.get_analytics_incidents_by_id_with_http_info(id, accept, content_type)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AnalyticsRawIncident>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_incidents_by_id_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String The ID of the resource.
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']

Return type

AnalyticsRawIncident

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_analytics_metrics_incidents_all

get_analytics_metrics_incidents_all(accept, content_type, opts)

Get aggregated incident data

Provides aggregated enriched metrics for incidents. The provided metrics are aggregated by day, week, month using the aggregate_unit parameter, or for the entire period if no aggregate_unit is provided. > A team_ids or service_ids filter is required for user-level API keys or keys generated through an OAuth flow. Account-level API keys do not have this requirement. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated incident data
  result = api_instance.get_analytics_metrics_incidents_all(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_all: #{e}"
end

Using the get_analytics_metrics_incidents_all_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_all_with_http_info(accept, content_type, opts)

begin
  # Get aggregated incident data
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_all_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsAll200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_all_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsAll200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_escalation_policy

get_analytics_metrics_incidents_escalation_policy(accept, content_type, opts)

Get aggregated escalation policy data

Provides aggregated metrics for incidents aggregated into units of time by escalation policy. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated escalation policy data
  result = api_instance.get_analytics_metrics_incidents_escalation_policy(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_escalation_policy: #{e}"
end

Using the get_analytics_metrics_incidents_escalation_policy_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_escalation_policy_with_http_info(accept, content_type, opts)

begin
  # Get aggregated escalation policy data
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_escalation_policy_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsEscalationPolicy200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_escalation_policy_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsEscalationPolicy200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_escalation_policy_all

get_analytics_metrics_incidents_escalation_policy_all(accept, content_type, opts)

Get aggregated metrics for all escalation policies

Provides aggregated metrics across all escalation policies. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated metrics for all escalation policies
  result = api_instance.get_analytics_metrics_incidents_escalation_policy_all(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_escalation_policy_all: #{e}"
end

Using the get_analytics_metrics_incidents_escalation_policy_all_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_escalation_policy_all_with_http_info(accept, content_type, opts)

begin
  # Get aggregated metrics for all escalation policies
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_escalation_policy_all_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsEscalationPolicy200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_escalation_policy_all_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsEscalationPolicy200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_service

get_analytics_metrics_incidents_service(accept, content_type, opts)

Get aggregated service data

Provides aggregated metrics for incidents aggregated into units of time by service. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. Data can be aggregated by day, week or month in addition to by service, or provided just as a collection of aggregates for each service in the dataset for the entire period. If a unit is provided, each row in the returned dataset will include a 'range_start' timestamp. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated service data
  result = api_instance.get_analytics_metrics_incidents_service(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_service: #{e}"
end

Using the get_analytics_metrics_incidents_service_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_service_with_http_info(accept, content_type, opts)

begin
  # Get aggregated service data
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_service_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsService200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_service_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsService200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_service_all

get_analytics_metrics_incidents_service_all(accept, content_type, opts)

Get aggregated metrics for all services

Provides aggregated metrics across all services. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > A team_ids or service_ids filter is required for user-level API keys or keys generated through an OAuth flow. Account-level API keys do not have this requirement. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated metrics for all services
  result = api_instance.get_analytics_metrics_incidents_service_all(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_service_all: #{e}"
end

Using the get_analytics_metrics_incidents_service_all_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_service_all_with_http_info(accept, content_type, opts)

begin
  # Get aggregated metrics for all services
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_service_all_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsService200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_service_all_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsService200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_team

get_analytics_metrics_incidents_team(accept, content_type, opts)

Get aggregated team data

Provides aggregated metrics for incidents aggregated into units of time by team. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. Data can be aggregated by day, week or month in addition to by team, or provided just as a collection of aggregates for each team in the dataset for the entire period. If a unit is provided, each row in the returned dataset will include a 'range_start' timestamp. > A team_ids or service_ids filter is required for user-level API keys or keys generated through an OAuth flow. Account-level API keys do not have this requirement. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated team data
  result = api_instance.get_analytics_metrics_incidents_team(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_team: #{e}"
end

Using the get_analytics_metrics_incidents_team_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_team_with_http_info(accept, content_type, opts)

begin
  # Get aggregated team data
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_team_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsService200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_team_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsService200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_incidents_team_all

get_analytics_metrics_incidents_team_all(accept, content_type, opts)

Get aggregated metrics for all teams

Provides aggregated metrics across all teams. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > A team_ids or service_ids filter is required for user-level API keys or keys generated through an OAuth flow. Account-level API keys do not have this requirement. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_model: PagerDutyOpenapiClient::AnalyticsModel.new # AnalyticsModel | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated metrics for all teams
  result = api_instance.get_analytics_metrics_incidents_team_all(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_team_all: #{e}"
end

Using the get_analytics_metrics_incidents_team_all_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_incidents_team_all_with_http_info(accept, content_type, opts)

begin
  # Get aggregated metrics for all teams
  data, status_code, headers = api_instance.get_analytics_metrics_incidents_team_all_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsIncidentsService200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_incidents_team_all_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_model AnalyticsModel Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsIncidentsService200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_responders_all

get_analytics_metrics_responders_all(accept, content_type, opts)

Get aggregated metrics for all responders

Provides aggregated incident metrics for all selected responders. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_responder_filter: PagerDutyOpenapiClient::AnalyticsResponderFilter.new # AnalyticsResponderFilter | Parameters and filters to apply to the dataset.
}

begin
  # Get aggregated metrics for all responders
  result = api_instance.get_analytics_metrics_responders_all(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_responders_all: #{e}"
end

Using the get_analytics_metrics_responders_all_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_responders_all_with_http_info(accept, content_type, opts)

begin
  # Get aggregated metrics for all responders
  data, status_code, headers = api_instance.get_analytics_metrics_responders_all_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsRespondersAll200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_responders_all_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_responder_filter AnalyticsResponderFilter Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsRespondersAll200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_metrics_responders_team

get_analytics_metrics_responders_team(accept, content_type, opts)

Get responder data aggregated by team

Provides incident metrics aggregated by responder. Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  analytics_responder_filter: PagerDutyOpenapiClient::AnalyticsResponderFilter.new # AnalyticsResponderFilter | Parameters and filters to apply to the dataset.
}

begin
  # Get responder data aggregated by team
  result = api_instance.get_analytics_metrics_responders_team(accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_responders_team: #{e}"
end

Using the get_analytics_metrics_responders_team_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_metrics_responders_team_with_http_info(accept, content_type, opts)

begin
  # Get responder data aggregated by team
  data, status_code, headers = api_instance.get_analytics_metrics_responders_team_with_http_info(accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsMetricsRespondersAll200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_metrics_responders_team_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
analytics_responder_filter AnalyticsResponderFilter Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsMetricsRespondersAll200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_analytics_responder_incidents

get_analytics_responder_incidents(responder_id, accept, content_type, opts)

Get raw incidents for a single responder_id

Provides enriched incident data and metrics for a specific responder. Example metrics include Mean Seconds to Resolve, Mean Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. > Note: Analytics data is updated once per day. It takes up to 24 hours before new incidents appear in the Analytics API. Scoped OAuth requires: analytics.read

Examples

require 'time'
require 'pager_duty_openapi_client'
# setup authorization
PagerDutyOpenapiClient.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = PagerDutyOpenapiClient::AnalyticsApi.new
responder_id = 'responder_id_example' # String | The ID of the responder.
accept = 'accept_example' # String | The `Accept` header is used as a versioning header.
content_type = 'application/json' # String | 
opts = {
  get_analytics_responder_incidents_request: PagerDutyOpenapiClient::GetAnalyticsResponderIncidentsRequest.new # GetAnalyticsResponderIncidentsRequest | Parameters and filters to apply to the dataset.
}

begin
  # Get raw incidents for a single responder_id
  result = api_instance.get_analytics_responder_incidents(responder_id, accept, content_type, opts)
  p result
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_responder_incidents: #{e}"
end

Using the get_analytics_responder_incidents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_analytics_responder_incidents_with_http_info(responder_id, accept, content_type, opts)

begin
  # Get raw incidents for a single responder_id
  data, status_code, headers = api_instance.get_analytics_responder_incidents_with_http_info(responder_id, accept, content_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAnalyticsResponderIncidents200Response>
rescue PagerDutyOpenapiClient::ApiError => e
  puts "Error when calling AnalyticsApi->get_analytics_responder_incidents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
responder_id String The ID of the responder.
accept String The `Accept` header is used as a versioning header. [default to 'application/vnd.pagerduty+json;version=2']
content_type String [default to 'application/json']
get_analytics_responder_incidents_request GetAnalyticsResponderIncidentsRequest Parameters and filters to apply to the dataset. [optional]

Return type

GetAnalyticsResponderIncidents200Response

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json