IBM Cloud API Docs

Introduction

API for creating, retrieving, editing, and listing incident policies.

Error handling

This API uses the standard HTTP response codes to indicate whether a method completed successfully. A 200 response always indicates success. A 400 type response is some sort of failure, and a 500 type response usually indicates an internal system error.

Methods

updateConditionsCache

Updates the incident policy cache and returns the flat policies stored in the cache.

GET /incidentPoliciesCache/v1

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Response

Flat policies stored within the cache

Status Code

  • Successful request

  • Invalid request

  • Unauthorized

  • Not authorized

No Sample Response

This method does not specify any sample responses.

listConditionAttributes

List the supported conditions attributes and operations.

GET /spec/incidentPolicies/v1/conditionAttributes

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Response

Status Code

  • Successful request

  • Invalid request

  • Unauthorized

  • Not authorized

No Sample Response

This method does not specify any sample responses.

listPolicies

List the summary information for all policies within a subscription

GET /incidentPolicies/v1

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Query Parameters

  • Includes detail information with each policy

    Possible values: allows empty value

    Default: false

Response

Status Code

  • Successful request

  • Invalid request

  • Unauthorized

  • Not authorized

Example responses
  • [
      {
        "enabled": false,
        "name": "Assign",
        "id": "51b9b8547de137073f5d3276b484de89",
        "author": "johndoe@xx.ibm.com",
        "created": "2017-05-24T20:08:37.068Z",
        "lastUpdated": "2017-06-07T15:05:25.843Z",
        "lastUpdatedBy": "johndoe@xx.ibm.com",
        "executionOrder": 0,
        "description": "Assign only",
        "actions": {
          "assignNotify": {
            "enabled": true,
            "assign": {
              "enabled": true
            },
            "notify": {
              "enabled": false
            }
          },
          "prioritize": {
            "enabled": false
          }
        },
        "lastRun": "2017-05-30T19:53:06.246Z"
      },
      {
        "enabled": true,
        "name": "AssignAndNotify",
        "id": "328d6adbf7e0b706de6a794ccb4375fe",
        "author": "johndoe@xx.ibm.com",
        "created": "2017-06-07T18:03:07.429Z",
        "lastUpdated": "2017-06-07T18:03:07.429Z",
        "lastUpdatedBy": "johndoe@xx.ibm.com",
        "executionOrder": 2,
        "description": "Assign the incident and notify assignee",
        "actions": {
          "assignNotify": {
            "enabled": true,
            "assign": {
              "enabled": true
            },
            "notify": {
              "enabled": false
            }
          },
          "prioritize": {
            "enabled": false
          }
        }
      }
    ]

createPolicy

Creates an incident policy within a subscription

POST /incidentPolicies/v1

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Incident policy payload

Response

Status Code

  • Policy successfully created

  • Invalid request

  • Unauthorized

  • Not authorized

  • Already exists

  • Internal error

No Sample Response

This method does not specify any sample responses.

updatePolicy

Replace the policy with the policy payload provided. Note the condition tree is replaced by the received condition tree. Conditions are not merged.

PUT /incidentPolicies/v1/{id}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Policy reference ID. This is returned by the list policies GET and uniquely identifies the policy.

Incident policy payload

Response

Status Code

  • Successful request

  • Policy was not updated

  • Unauthorized

  • Not authorized

  • Unable to locate policy

  • Cannot rename to the name of a policy that already exists

  • Internal error

No Sample Response

This method does not specify any sample responses.

getPolicy

Gets a policy

GET /incidentPolicies/v1/{id}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Policy reference ID. This is returned by the list policies GET and uniquely identifies the policy.

Response

Status Code

  • Successful request

  • Unauthorized

  • Not authorized

  • Unable to locate policy

  • Internal error

Example responses
  • {
      "enabled": true,
      "applyAll": false,
      "description": "Assign the incident and notify assignee",
      "name": "AssignAndNotify",
      "id": "328d6adbf7e0b706de6a794ccb4375fe",
      "author": "johndoe@xx.ibm.com",
      "created": "2017-06-07T18:03:07.429Z",
      "lastUpdated": "2017-06-07T18:03:07.429Z",
      "lastUpdatedBy": "johndoe@xx.ibm.com",
      "executionOrder": 2,
      "condition": {
        "id": "5e63c3fb352bbd9c47bf96c84f30d6a9",
        "attribute": "_policy",
        "operator": "and",
        "value": [
          {
            "id": "d3c3e2566c4d1251c0db1bf37062e4ec",
            "attribute": "_incidents",
            "operator": "and",
            "value": [
              {
                "id": "672c674cc707f62a9ce937c2bc65f094",
                "attribute": "incident.priority",
                "operator": ">=",
                "value": "1"
              }
            ]
          },
          {
            "id": "a12019a06c70d40630c5c0e8623ba2d5",
            "attribute": "_events",
            "operator": "and",
            "value": [
              {
                "attribute": "_singleevent",
                "operator": "and",
                "value": [
                  {
                    "attribute": "event.summary",
                    "operator": "contains",
                    "value": "database",
                    "id": "98ede832fda2d829d10ebfff7a0a3543"
                  }
                ],
                "id": "3d3d9171d06d241af2ef443fd9d03171"
              },
              {
                "attribute": "_singleevent",
                "operator": "and",
                "value": [
                  {
                    "attribute": "event.severity",
                    "operator": ">",
                    "value": "minor",
                    "id": "b484d6a02efbae8a60c55ce14ea868f1"
                  }
                ],
                "id": "eb06db30575f9a14799786cd91c28e30"
              }
            ]
          }
        ]
      },
      "actions": {
        "assignNotify": {
          "enabled": true,
          "assign": {
            "team": "devops",
            "owner": "johndoe@xx.ibm.com"
          },
          "notify": {
            "users": [
              "johndoe@xx.ibm.com"
            ],
            "groups": [],
            "integrations": [],
            "escalations": [
              {
                "waitFor": 20,
                "timeUnits": "minutes",
                "users": [],
                "groups": [
                  "postops"
                ],
                "integrations": []
              }
            ]
          }
        },
        "prioritize": {
          "enabled": false,
          "priority": 5
        }
      }
    }

deletePolicyById

Deletes a policy

DELETE /incidentPolicies/v1/{id}

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Path Parameters

  • Policy reference ID. This is returned by the list policies GET and uniquely identifies the policy.

Response

Status Code

  • Successful request

  • Unauthorized

  • Not authorized

  • Unable to locate policy

  • Internal error

No Sample Response

This method does not specify any sample responses.

UpdatePolicyOrder

Sets the new order on a list of incident policies in a subscription

PUT /incidentPolicies/v1/executionOrder

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Array of incident policy IDs in the order they should be run

Response

Status Code

  • Successful request

  • Bad request

  • Unauthorized

  • Not authorized

  • Internal error updating execution order of policies

No Sample Response

This method does not specify any sample responses.

bulkDeletePolicies

Deletes a list of policies in a subscription

POST /incidentPolicyBulk/v1/bulkdelete

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Array of policy IDs to delete

Response

Status Code

  • Successful request

  • Unauthorized

  • Not authorized

  • Internal error

No Sample Response

This method does not specify any sample responses.

bulkUpdatePolicyOrder

Sets the new order on a list of incident policies in a subscription

PUT /incidentPolicyBulk/v1/bulkupdateorder

Request

Custom Headers

  • Allowable values: [application/json,text/plain]

Array of incident policy IDs in the order they should be run

Response

Status Code

  • Successful request

  • Bad request

  • Unauthorized

  • Not authorized

  • Internal error updating execution order of policies

No Sample Response

This method does not specify any sample responses.