Skip to content

pagerduty get-service-event-rules

List existing services.

Description

List existing services.

Synopsis

pagerduty get-service-event-rules
    --site <site>
    --id <id>
    --rule_id <rule_id>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: required

id - (string)

     ID of the service.
     Example: --id "id-1"
     Default: _None_      Attributes: required

rule_id - (string)

     The id of the Event Rule to retrieve.
     Example: --rule_id "rule_id-1"
     Default: _None_      Attributes: required

Examples

Input:

!pagerduty get-service-event-rules --id "PKAT53N" --rule_id "778916bf-1606-472a-a29c-7b4c918c1240"
Output:
ID                                      POSITION    DISABLED    SEVERITY-ACTION 
778916bf-1606-472a-a29c-7b4c918c1240           0    false       -               
Input:
x=!pagerduty get-service-event-rules --id "PKAT53N" --rule_id "778916bf-1606-472a-a29c-7b4c918c1240"
Output:
{
  "rule": {
    "actions": {
      "annotate": null,
      "automation_actions": [],
      "event_action": null,
      "extractions": [],
      "priority": null,
      "severity": null,
      "suppress": {
        "threshold_time_amount": null,
        "threshold_time_unit": null,
        "threshold_value": null,
        "value": true
      },
      "suspend": null
    },
    "conditions": {
      "operator": "and",
      "subconditions": [
        {
          "operator": "contains",
          "parameters": { "path": "class", "value": "TEST" }
        }
      ]
    },
    "disabled": false,
    "id": "778916bf-1606-472a-a29c-7b4c918c1240",
    "position": 0,
    "self": "https://api.pagerduty.com/services/PKAT53N/rules/778916bf-1606-472a-a29c-7b4c918c1240",
    "time_frame": null,
    "variables": []
  }
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "pagerduty"
Service Instance
Namespace
Object Type "service"
Object ID id

Please see Access Control for details.