Set Alerts

PUT /api/v1.2/pipelines/<pipeline_id>/alerts

Use this API to configure alerts to send notifications when a streaming pipeline fails or manually stopped by a user.

Required Role

The following users can make this API call:

  • Users who belong to the system-user or system-admin group.

  • Users who belong to a group associated with a role that allows submitting a command.

  • Users who belong to a role that allows the Pipelines resource.

See Managing Groups and Managing Roles for more information.

Parameters

Note

Parameters marked in bold below are mandatory. Others are optional and have default values.

Parameter

Description

event_type

Type of event:error.

notification_channels

Array of notification channel IDs. For example,``[1,2]``

can_notify

Boolean value that specifies if the notifications are enabled or disabled. Possible values: true or false.

type

Type:pipeline/alerts.

Request API Syntax

curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
 -d '{
        "data":{
           "attributes":{
              "event_type":"type",
              "array of notification channel IDs":[number-of-channels],
              "can_notify":<true-or-false>
           },
           "type":"pipeline/alerts"
        }
     }`\
    "https://api.qubole.com/api/v1.2/pipelines/<pipeline_id>/alerts"

Sample API Request

curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
 -d '{
        "data":{
           "attributes":{
              "event_type":"error",
              "notification_channels":[
                 6
              ],
              "can_notify":true
           },
           "type":"pipeline/alerts"
        }
     }`\
    "https://api.qubole.com/api/v1.2/pipelines/1/alerts"