actions
Creates, updates, deletes, gets or lists an actions resource.
Overview
| Name | actions |
| Type | Resource |
| Id | pagerduty.automation_actions.actions |
Fields
The following fields are returned by SELECT queries:
- get
- list
Action information
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | (example: Restart apache) |
action_classification | string | (diagnostic, remediation) |
action_data_reference | object | |
action_type | string | (script, process_automation) (example: process_automation) |
allow_invocation_from_event_orchestration | boolean | If true, the action can only be invoked automatically by an Event Orchestration. |
allow_invocation_manually | boolean | If true, the action can only be invoked manually by a user. |
creation_time | string (date-time) | The date/time |
description | string | (example: Restarts apache on the us-west-2-shopping-cart host) |
html_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
last_run | string (date-time) | The date/time |
last_run_by | | |
map_to_all_services | boolean | If true, the action will be associated with every service. |
metadata | string | (opaque JSON object) |
modify_time | string (date-time) | The date/time |
only_invocable_on_unresolved_incidents | boolean | If true, the action can only be invoked against an unresolved incident. |
privileges | object | |
runner | string | |
runner_type | string | sidecar -- 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) |
self | string (url) | the API show URL at which the object is accessible |
services | array | |
summary | string | A 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. |
teams | array | |
type | string | A 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. |
An array of actions
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | Get an Automation Action<br /> | |
list | select | limit, cursor, name, runner_id, classification, team_id, service_id, action_type | Lists 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 /> | |
create | insert | action | Create a Script, Process Automation, or Runbook Automation action<br /> | |
update | update | id, action | Updates an Automation Action<br /> | |
delete | delete | id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the resource. |
action_type | string | Filters results to include the ones matching the specified action type |
classification | string | Filters results to include the ones matching the specified classification (aka category) |
cursor | string | Optional 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. |
limit | integer | The minimum of the limit parameter used in the request or the maximum request size of the API. |
name | string | Filters results to include the ones matching the name (case insensitive substring matching) |
runner_id | string | Filters 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_id | string | Filters results to include the ones associated with the specified service |
team_id | string | Filters results to include the ones associated with the specified team. |
SELECT examples
- get
- list
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
;
Lists 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 />
SELECT
*
FROM pagerduty.automation_actions.actions
WHERE limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
AND name = '{{ name }}'
AND runner_id = '{{ runner_id }}'
AND classification = '{{ classification }}'
AND team_id = '{{ team_id }}'
AND service_id = '{{ service_id }}'
AND action_type = '{{ action_type }}'
;
INSERT examples
- create
- Manifest
Create a Script, Process Automation, or Runbook Automation action<br />
INSERT INTO pagerduty.automation_actions.actions (
action
)
SELECT
'{{ action }}' /* required */
RETURNING
action
;
# Description fields are for documentation purposes
- name: actions
props:
- name: action
value:
name: "{{ name }}"
description: "{{ description }}"
action_classification: "{{ action_classification }}"
action_type: "{{ action_type }}"
runner: "{{ runner }}"
services:
- id: "{{ id }}"
summary: "{{ summary }}"
type: "{{ type }}"
self: "{{ self }}"
html_url: "{{ html_url }}"
teams:
- id: "{{ id }}"
summary: "{{ summary }}"
type: "{{ type }}"
self: "{{ self }}"
html_url: "{{ html_url }}"
only_invocable_on_unresolved_incidents: {{ only_invocable_on_unresolved_incidents }}
allow_invocation_manually: {{ allow_invocation_manually }}
allow_invocation_from_event_orchestration: {{ allow_invocation_from_event_orchestration }}
map_to_all_services: {{ map_to_all_services }}
action_data_reference:
script: "{{ script }}"
invocation_command: "{{ invocation_command }}"
UPDATE examples
- update
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
Delete an Automation Action<br />
DELETE FROM pagerduty.automation_actions.actions
WHERE id = '{{ id }}' --required
;