IBM Cloud API Docs

Introduction

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

Error handling

This API uses 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

getAttributes

List the supported attributes and operations on this server.

GET /eventPoliciesSpecification/v2/eventAttributes

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.

getEventPolicies

List the summary information for all event policies within a subscription

GET /eventPolicies/v2

Request

Custom Headers

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

Response

Status Code

  • Successful request

  • Invalid request

  • Unauthorized

  • Not authorized

Example responses
  • [
      {
        "id": "123-abc",
        "name": "SamplePolicy",
        "description": "Sample policy description",
        "enabled": true,
        "actions": {
          "suppress": {
            "enabled": true,
            "suppressCondition": "XinY",
            "identicalEvents": 1,
            "timePeriod": 120,
            "timeUnits": "seconds"
          },
          "enrich": {
            "enabled": false
          },
          "runbook": {
            "enabled": false
          }
        },
        "author": "user@example.com",
        "created": "2017-03-10T10:02:47.297Z",
        "lastUpdated": "2017-03-10T10:03:24.672Z",
        "lastUpdatedBy": "user@example.com",
        "lastRun": 0
      }
    ]

createEventPolicy

Creates an event policy within a subscription

POST /eventPolicies/v2

Request

Custom Headers

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

Event policy payload

Response

Status Code

  • Policy successfully created

  • Invalid request

  • Unauthorized

  • Not authorized

  • Already exists

No Sample Response

This method does not specify any sample responses.

updateEventPolicy

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

PUT /eventPolicies/v2/{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.

Event 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

No Sample Response

This method does not specify any sample responses.

getEventPolicy

Gets a policy

GET /eventPolicies/v2/{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

No Sample Response

This method does not specify any sample responses.

deleteEventPolicy

Deletes a policy

DELETE /eventPolicies/v2/{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

  • Error deleting policy

No Sample Response

This method does not specify any sample responses.

changePoliciesExecOrder

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

PUT /eventPolicies/v2/executionOrder

Request

Custom Headers

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

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

Response

Status Code

  • Successful request

  • Unauthorized

  • Not authorized

  • Error updating policy

No Sample Response

This method does not specify any sample responses.