Skip to content

Instantly share code, notes, and snippets.

@kylebrandt
Created February 26, 2021 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylebrandt/e2ce8c936bd42aed6aa6200e28c1d949 to your computer and use it in GitHub Desktop.
Save kylebrandt/e2ce8c936bd42aed6aa6200e28c1d949 to your computer and use it in GitHub Desktop.
Classic Condition in SSE
PUT http://admin:admin@localhost:3000/api/alert-definitions/HH7cv0yMk
Content-Type: application/json
{
"id": 24,
"orgId": 1,
"title": "First CC Alert",
"condition": "B",
"data": [
{
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 60,
"to": 0
},
"model": {
"alias": "",
"csvWave": {
"timeStep": 60,
"valuesCSV": "0,0,2,2,1,1"
},
"datasource": "gdev-testdata",
"datasourceUid": "000000004",
"hide": false,
"intervalMs": 1000,
"lines": 10,
"maxDataPoints": 100,
"points": [],
"pulseWave": {
"offCount": 3,
"offValue": 1,
"onCount": 3,
"onValue": 2,
"timeStep": 60
},
"refId": "A",
"scenarioId": "predictable_pulse",
"stream": {
"bands": 1,
"noise": 2.2,
"speed": 250,
"spread": 3.5,
"type": "signal"
},
"stringInput": ""
}
},
{
"refId": "B",
"queryType": "",
"relativeTimeRange": {
"from": 0,
"to": 0
},
"model": {
"conditions": [
{
"evaluator": {
"params": [
1
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"datasource": "__expr__",
"datasourceUid": "-100",
"hide": false,
"intervalMs": 1000,
"maxDataPoints": 100,
"refId": "B",
"type": "classic_conditions"
}
}
],
"updated": "2021-02-25T16:22:02.120470967-05:00",
"intervalSeconds": 60,
"version": 1,
"uid": "HH7cv0yMk",
"paused": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment