Sunbird Obsrv
  • Introduction
    • The Value of Data
    • Data Value Chain
    • Challenges
    • The Solution: Obsrv
  • Core Concepts
    • Obsrv Overview
    • Key Capabilities
    • Datasets
    • Connectors
    • High Level Architecture
    • Tech Stack
    • Monitoring
  • Explore
    • Roadmap
    • Case Studies
      • Agri Climate Advisory
      • Learning Analytics at Population Scale
      • IOT Observations Infra
      • Data Driven Features in Learning Platform
      • Network Observability
      • Fraud Detection
    • Performance Benchmarks
  • Guides
    • Installation
      • AWS Installation Guide
      • Azure Installation Guide
      • GCP Installation Guide
      • OCI Installation Guide
      • Data Center Installation Guide
    • Dataset Management APIs
    • Dataset Management Console
    • Connector APIs
    • Data In & Out APIs
    • Alerts and Notification Channels APIs
    • Developer Guide
    • Example Datasets
    • Connectors Developer Guide
      • SDK Assumptions
      • Required Files
        • metadata.json
        • ui-config.json
        • metrics.yaml
        • alerts.yaml
      • Obsrv Base Setup
      • Dev Requirements
      • Interfaces
        • Stream Interfaces
        • Batch Interfaces
      • Classes
        • ConnectorContext Class
        • ConnectorStats Class
        • ConnectorState Class
        • ErrorData Class
        • MetricData Class
      • Verifying
      • Packaging Guide
      • Reference Implementations
    • Coming Soon!
  • Community
  • Previous Versions
    • SB-5.0 Version
      • Overview
      • USE
        • Release Notes
          • Obsrv 2.0-Beta
          • Obsrv 2.1.0
          • Obsrv 2.2.0
          • Obsrv 2.0.0-GA
          • Obsrv 5.3.0-GA
          • Release V 5.1.0
          • Release V 5.1.2
          • Release V 5.1.3
          • Release V 5.0.0
          • Release V 4.10.0
        • Installation Guide
        • Obsrv 2.0 Installation Guide
          • Getting Started with Obsrv Deployment Using Helm
        • System Requirements
      • LEARN
        • Functional Capabilities
        • Dependencies
        • Product Roadmap
        • Product & Developer Guide
          • Telemetry Service
          • Data Pipeline
          • Data Service
          • Data Product
            • On Demand Druid Exhaust Job
              • Component Diagram
              • ML CSV Reports
              • Folder Struture
          • Report Service
          • Report Configurator
          • Summarisers
      • ENGAGE
        • Discuss
        • Contribute to Obsrv
      • Raise an Issue
  • Release Notes
    • Obsrv 1.1.0 Beta Release
    • Obsrv 1.2.0-RC Release
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Guides

Alerts and Notification Channels APIs

List of APIs to manage alerts and notification channels

PreviousData In & Out APIsNextDeveloper Guide

Last updated 5 months ago

Was this helpful?

Notification Channel APIs

Alerts APIs

Alerts Silience APIs

Search Notificaation Channels

post
Body
Responses
200
Successful response
application/json
post
POST /alerts/v1/notifications/search HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Delete Channel

delete
Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
delete
DELETE /alerts/v1/notifications/delete/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Publish Alert Rules

get
Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
get
GET /alerts/v1/publish/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Get Alert Rule

get
Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
get
GET /alerts/v1/get/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Delete Configured Alert Rules

delete

This URLwill provided access to user to delete any custom rule.

Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
delete
DELETE /alerts/v1/delete/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Get Silence

get
Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
get
GET /alerts/v1/silence/get/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Fetch All Silences

get
Responses
200
Successful response
application/json
get
GET /alerts/v1/silence/search HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

  • Notification Channel APIs
  • POSTConfigure channel
  • GETPublish Channel
  • POSTSearch Notificaation Channels
  • PATCHUpdate Specific Channel
  • DELETEDelete Channel
  • POSTVerify Configured Channel
  • Alerts APIs
  • POSTAdd Rule
  • GETPublish Alert Rules
  • GETGet Alert Rule
  • POSTSearch Alert Rule
  • PATCHUpdate Rule
  • DELETEDelete Configured Alert Rules
  • Alerts Silience APIs
  • POSTAdd Silence
  • GETGet Silence
  • GETFetch All Silences

Publish Channel

get
Path parameters
alert_idstringRequired

Unique identifier for the alert

Responses
200
Successful response
application/json
get
GET /alerts/v1/notifications/publish/{alert_id} HTTP/1.1
Host: localhost:3000
Accept: */*
200

Successful response

No content

Configure channel

post
Body
objectOptionalExample: {"manager":"grafana","name":"functional-metrics-email","type":"email","config":{"recipientAddresses":"yravinderkumar33@gmail.com;ravinder@sanketika.in","subject":"Obsrv Prod Alert"}}
Responses
200
Successful response
application/json
post
POST /alerts/v1/notifications/create HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 182

{
  "manager": "grafana",
  "name": "functional-metrics-email",
  "type": "email",
  "config": {
    "recipientAddresses": "yravinderkumar33@gmail.com;ravinder@sanketika.in",
    "subject": "Obsrv Prod Alert"
  }
}
200

Successful response

No content

Update Specific Channel

patch
Path parameters
alert_idstringRequired

Unique identifier for the alert

Body
objectOptionalExample: {"name":"updated name"}
Responses
200
Successful response
application/json
patch
PATCH /alerts/v1/notifications/update/{alert_id} HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "name": "updated name"
}
200

Successful response

No content

Verify Configured Channel

post
Body
objectOptionalExample: {"message":"Testing Email integration. If you can read this, it's working!","payload":{"error":{"selectChannel":true,"configureChannel":true},"manager":"grafana","name":"udhw","type":"email","config":{"recipientAddresses":"jerald@sanketika.in"}}}
Responses
200
Successful response
application/json
post
POST /alerts/v1/notifications/test HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 246

{
  "message": "Testing Email integration. If you can read this, it's working!",
  "payload": {
    "error": {
      "selectChannel": true,
      "configureChannel": true
    },
    "manager": "grafana",
    "name": "udhw",
    "type": "email",
    "config": {
      "recipientAddresses": "jerald@sanketika.in"
    }
  }
}
200

Successful response

No content

Add Rule

post
Header parameters
AcceptstringOptionalExample: application/json, text/plain, */*
Accept-LanguagestringOptionalExample: en-GB,en
Cache-ControlstringOptionalExample: no-store
ConnectionstringOptionalExample: keep-alive
Content-TypestringOptionalExample: application/json
CookiestringOptionalExample: connect.sid=s%3A5w5I87Tior-cvNu-SijqRFKGxy_b-WIP.lDKfWAJZbxW0kMaUqj%2B0Ivu%2FvNXXL8S796Fa7%2BNyM9Q; grafana_session=4eb514f6fef4ad6884e47e50254af650; grafana_session_expiry=1687239735
OriginstringOptionalExample: http://localhost:3001
PragmastringOptionalExample: no-store
RefererstringOptionalExample: http://localhost:3001/alertRules/add
Sec-Fetch-DeststringOptionalExample: empty
Sec-Fetch-ModestringOptionalExample: cors
Sec-Fetch-SitestringOptionalExample: same-origin
Sec-GPCintegerOptionalExample: 1
User-AgentstringOptionalExample: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Body
stringOptionalExample: "{\n \"name\": \"Total Api Calls1\",\n \"manager\":\"grafana\",\n \"description\": \"This alert is set up to notify you when the CPU usage on a host reaches a Low level.\",\n \"expression\": \"(node_total_api_calls) > 20\",\n \"category\": \"Infra\",\n \"severity\":\"warning\",\n \"frequency\": \"1m\",\n \"interval\": \"1m\",\n \"labels\": {\n \"component\": \"api\",\n \"notificationChannel\": \"slack\"\n },\n \"annotations\":{\n \"summary\":\"Host Low CPU usage\"\n },\n \"metadata\": {\n \"query\": [\n {\n \"refId\": \"A\",\n \"datasourceUid\": \"$datasourceUid\",\n \"queryType\": \"\",\n \"relativeTimeRange\": {\n \"from\": 600,\n \"to\": 0\n },\n \"model\": {\n \"refId\": \"A\",\n \"hide\": false,\n \"editorMode\": \"code\",\n \"expr\": \"node_total_api_calls\",\n \"legendFormat\": \"__auto\",\n \"range\": true\n }\n },\n {\n \"refId\": \"B\",\n \"datasourceUid\": \"__expr__\",\n \"queryType\": \"\",\n \"model\": {\n \"refId\": \"B\",\n \"hide\": false,\n \"type\": \"reduce\",\n \"datasource\": {\n \"uid\": \"__expr__\",\n \"type\": \"__expr__\"\n },\n \"conditions\": [\n {\n \"type\": \"query\",\n \"evaluator\": {\n \"params\": [],\n \"type\": \"gt\"\n },\n \"operator\": {\n \"type\": \"and\"\n },\n \"query\": {\n \"params\": [\n \"B\"\n ]\n },\n \"reducer\": {\n \"params\": [],\n \"type\": \"last\"\n }\n }\n ],\n \"reducer\": \"last\",\n \"expression\": \"A\"\n },\n \"relativeTimeRange\": {\n \"from\": 600,\n \"to\": 0\n }\n },\n {\n \"refId\": \"C\",\n \"datasourceUid\": \"__expr__\",\n \"queryType\": \"\",\n \"model\": {\n \"refId\": \"C\",\n \"hide\": false,\n \"type\": \"threshold\",\n \"datasource\": {\n \"uid\": \"__expr__\",\n \"type\": \"__expr__\"\n },\n \"conditions\": [\n {\n \"type\": \"query\",\n \"evaluator\": {\n \"params\": [\n 20\n ],\n \"type\": \"gt\"\n },\n \"operator\": {\n \"type\": \"and\"\n },\n \"query\": {\n \"params\": [\n \"C\"\n ]\n },\n \"reducer\": {\n \"params\": [],\n \"type\": \"last\"\n }\n }\n ],\n \"expression\": \"B\"\n },\n \"relativeTimeRange\": {\n \"from\": 600,\n \"to\": 0\n }\n }\n ]\n }\n}"
Responses
200
Successful response
application/json
post
POST /alerts/v1/create HTTP/1.1
Host: localhost:3000
Content-Type: */*
Accept: */*
Content-Length: 4952

"\"{\\n    \\\"name\\\": \\\"Total Api Calls1\\\",\\n    \\\"manager\\\":\\\"grafana\\\",\\n    \\\"description\\\": \\\"This alert is set up to notify you when the CPU usage on a host reaches a Low level.\\\",\\n    \\\"expression\\\": \\\"(node_total_api_calls) > 20\\\",\\n    \\\"category\\\": \\\"Infra\\\",\\n    \\\"severity\\\":\\\"warning\\\",\\n    \\\"frequency\\\": \\\"1m\\\",\\n    \\\"interval\\\": \\\"1m\\\",\\n    \\\"labels\\\": {\\n        \\\"component\\\": \\\"api\\\",\\n        \\\"notificationChannel\\\": \\\"slack\\\"\\n    },\\n    \\\"annotations\\\":{\\n        \\\"summary\\\":\\\"Host Low CPU usage\\\"\\n    },\\n    \\\"metadata\\\": {\\n        \\\"query\\\": [\\n            {\\n                \\\"refId\\\": \\\"A\\\",\\n                \\\"datasourceUid\\\": \\\"$datasourceUid\\\",\\n                \\\"queryType\\\": \\\"\\\",\\n                \\\"relativeTimeRange\\\": {\\n                    \\\"from\\\": 600,\\n                    \\\"to\\\": 0\\n                },\\n                \\\"model\\\": {\\n                    \\\"refId\\\": \\\"A\\\",\\n                    \\\"hide\\\": false,\\n                    \\\"editorMode\\\": \\\"code\\\",\\n                    \\\"expr\\\": \\\"node_total_api_calls\\\",\\n                    \\\"legendFormat\\\": \\\"__auto\\\",\\n                    \\\"range\\\": true\\n                }\\n            },\\n            {\\n                \\\"refId\\\": \\\"B\\\",\\n                \\\"datasourceUid\\\": \\\"__expr__\\\",\\n                \\\"queryType\\\": \\\"\\\",\\n                \\\"model\\\": {\\n                    \\\"refId\\\": \\\"B\\\",\\n                    \\\"hide\\\": false,\\n                    \\\"type\\\": \\\"reduce\\\",\\n                    \\\"datasource\\\": {\\n                        \\\"uid\\\": \\\"__expr__\\\",\\n                        \\\"type\\\": \\\"__expr__\\\"\\n                    },\\n                    \\\"conditions\\\": [\\n                        {\\n                            \\\"type\\\": \\\"query\\\",\\n                            \\\"evaluator\\\": {\\n                                \\\"params\\\": [],\\n                                \\\"type\\\": \\\"gt\\\"\\n                            },\\n                            \\\"operator\\\": {\\n                                \\\"type\\\": \\\"and\\\"\\n                            },\\n                            \\\"query\\\": {\\n                                \\\"params\\\": [\\n                                    \\\"B\\\"\\n                                ]\\n                            },\\n                            \\\"reducer\\\": {\\n                                \\\"params\\\": [],\\n                                \\\"type\\\": \\\"last\\\"\\n                            }\\n                        }\\n                    ],\\n                    \\\"reducer\\\": \\\"last\\\",\\n                    \\\"expression\\\": \\\"A\\\"\\n                },\\n                \\\"relativeTimeRange\\\": {\\n                    \\\"from\\\": 600,\\n                    \\\"to\\\": 0\\n                }\\n            },\\n            {\\n                \\\"refId\\\": \\\"C\\\",\\n                \\\"datasourceUid\\\": \\\"__expr__\\\",\\n                \\\"queryType\\\": \\\"\\\",\\n                \\\"model\\\": {\\n                    \\\"refId\\\": \\\"C\\\",\\n                    \\\"hide\\\": false,\\n                    \\\"type\\\": \\\"threshold\\\",\\n                    \\\"datasource\\\": {\\n                        \\\"uid\\\": \\\"__expr__\\\",\\n                        \\\"type\\\": \\\"__expr__\\\"\\n                    },\\n                    \\\"conditions\\\": [\\n                        {\\n                            \\\"type\\\": \\\"query\\\",\\n                            \\\"evaluator\\\": {\\n                                \\\"params\\\": [\\n                                    20\\n                                ],\\n                                \\\"type\\\": \\\"gt\\\"\\n                            },\\n                            \\\"operator\\\": {\\n                                \\\"type\\\": \\\"and\\\"\\n                            },\\n                            \\\"query\\\": {\\n                                \\\"params\\\": [\\n                                    \\\"C\\\"\\n                                ]\\n                            },\\n                            \\\"reducer\\\": {\\n                                \\\"params\\\": [],\\n                                \\\"type\\\": \\\"last\\\"\\n                            }\\n                        }\\n                    ],\\n                    \\\"expression\\\": \\\"B\\\"\\n                },\\n                \\\"relativeTimeRange\\\": {\\n                    \\\"from\\\": 600,\\n                    \\\"to\\\": 0\\n                }\\n            }\\n        ]\\n    }\\n}\""
200

Successful response

No content

Search Alert Rule

post
Body
objectOptionalExample: {"request":{}}
Responses
200
Successful response
application/json
post
POST /alerts/v1/search HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "request": {}
}
200

Successful response

No content

Update Rule

patch

This URL will provide access to users to edit any properties in the Alert rule and save the changes.

Path parameters
alert_idstringRequired

Unique identifier for the alert

Body
objectOptionalExample: {"description":"This alert rule is designed to promptly notify you when one or more servers in your infrastructure become unresponsive or inaccessible.","labels":{"severity":"warning"}}
Responses
200
Successful response
application/json
patch
PATCH /alerts/v1/update/{alert_id} HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 185

{
  "description": "This alert rule is designed to promptly notify you when one or more servers in your infrastructure become unresponsive or inaccessible.",
  "labels": {
    "severity": "warning"
  }
}
200

Successful response

No content

Add Silence

post
Body
objectOptionalExample: {"startDate":"2024-01-11T07:56:23Z","endDate":"2024-01-11T08:56:23Z","alertId":"c7464d32-1d8d-4eaf-9b23-1313a3ff8149","manager":"grafana"}
Responses
200
Successful response
application/json
post
POST /alerts/v1/silence/create HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 138

{
  "startDate": "2024-01-11T07:56:23Z",
  "endDate": "2024-01-11T08:56:23Z",
  "alertId": "c7464d32-1d8d-4eaf-9b23-1313a3ff8149",
  "manager": "grafana"
}
200

Successful response

No content