Skip to main content

actions

Creates, updates, deletes, gets or lists an actions resource.

Overview

Nameactions
TypeResource
Idpagerduty.automation_actions.actions

Fields

The following fields are returned by SELECT queries:

Action information

NameDatatypeDescription
idstring
namestring (example: Restart apache)
action_classificationstring (diagnostic, remediation)
action_data_referenceobject
action_typestring (script, process_automation) (example: process_automation)
allow_invocation_from_event_orchestrationbooleanIf true, the action can only be invoked automatically by an Event Orchestration.
allow_invocation_manuallybooleanIf true, the action can only be invoked manually by a user.
creation_timestring (date-time)The date/time
descriptionstring (example: Restarts apache on the us-west-2-shopping-cart host)
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
last_runstring (date-time)The date/time
last_run_by
map_to_all_servicesbooleanIf true, the action will be associated with every service.
metadatastring(opaque JSON object)
modify_timestring (date-time)The date/time
only_invocable_on_unresolved_incidentsbooleanIf true, the action can only be invoked against an unresolved incident.
privilegesobject
runnerstring
runner_typestringsidecar -- The runner is backed by an external sidecar that polls for invocations. runbook -- The runner communicates directly with a runbook instance. (sidecar, runbook) (example: runbook)
selfstring (url)the API show URL at which the object is accessible
servicesarray
summarystringA short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
teamsarray
typestringA string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidGet an Automation Action<br />
listselectlimit, cursor, name, runner_id, classification, team_id, service_id, action_typeLists Automation Actions matching provided query params.<br /><br />The returned records are sorted by action name in alphabetical order.<br /><br />See [Cursor-based pagination](https:​//developer.pagerduty.com/docs/rest-api-v2/pagination/) for instructions on how to paginate through the result set.<br />
createinsertactionCreate a Script, Process Automation, or Runbook Automation action<br />
updateupdateid, actionUpdates an Automation Action<br />
deletedeleteidDelete an Automation Action<br />

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the resource.
action_typestringFilters results to include the ones matching the specified action type
classificationstringFilters results to include the ones matching the specified classification (aka category)
cursorstringOptional parameter used to request the "next" set of results from an API. The value provided here is most commonly obtained from the next_cursor field of the previous request. When no value is provided, the request starts at the beginning of the result set.
limitintegerThe minimum of the limit parameter used in the request or the maximum request size of the API.
namestringFilters results to include the ones matching the name (case insensitive substring matching)
runner_idstringFilters results to include the ones linked to the specified runner. Specifying the value any filters results to include the ones linked to runners only, thus omitting the results not linked to runners.
service_idstringFilters results to include the ones associated with the specified service
team_idstringFilters results to include the ones associated with the specified team.

SELECT examples

Get an Automation Action<br />

SELECT
id,
name,
action_classification,
action_data_reference,
action_type,
allow_invocation_from_event_orchestration,
allow_invocation_manually,
creation_time,
description,
html_url,
last_run,
last_run_by,
map_to_all_services,
metadata,
modify_time,
only_invocable_on_unresolved_incidents,
privileges,
runner,
runner_type,
self,
services,
summary,
teams,
type
FROM pagerduty.automation_actions.actions
WHERE id = '{{ id }}' -- required
;

INSERT examples

Create a Script, Process Automation, or Runbook Automation action<br />

INSERT INTO pagerduty.automation_actions.actions (
action
)
SELECT
'{{ action }}' /* required */
RETURNING
action
;

UPDATE examples

Updates an Automation Action<br />

UPDATE pagerduty.automation_actions.actions
SET
action = '{{ action }}'
WHERE
id = '{{ id }}' --required
AND action = '{{ action }}' --required
RETURNING
action;

DELETE examples

Delete an Automation Action<br />

DELETE FROM pagerduty.automation_actions.actions
WHERE id = '{{ id }}' --required
;