-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitor_workflow.json
More file actions
79 lines (79 loc) · 2.38 KB
/
Copy pathmonitor_workflow.json
File metadata and controls
79 lines (79 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
"createTime": 1742689237746,
"name": "Monitor-HTTP-Endpoint-Availability",
"description": "Monitor HTTP endpoint availability and send notifications",
"version": 2,
"tasks": [
{
"name": "call_endpoint",
"taskReferenceName": "call_endpoint",
"inputParameters": {
"http_request": {
"uri": "${workflow.input.endpoint_url}",
"method": "GET",
"connectionTimeOut": 3000,
"readTimeOut": 3000
}
},
"type": "HTTP",
"optional": false,
"startDelay": 0
},
{
"name": "get_timestamp",
"taskReferenceName": "get_timestamp_ref",
"inputParameters": {
"expression": "new Date().toISOString()",
"evaluatorType": "javascript"
},
"type": "INLINE",
"optional": false,
"startDelay": 0
},
{
"name": "notify_if_failed",
"taskReferenceName": "notify_if_failed",
"inputParameters": {
"switchCaseValue": "${call_endpoint.output.response.statusCode}",
"notification_message": "HTTP Endpoint ${workflow.input.endpoint_url} is down. Status: ${call_endpoint.output.response.statusCode}. Time: ${get_timestamp_ref.output.result}"
},
"type": "SWITCH",
"decisionCases": {
"200": [],
"default": [
{
"name": "send_notification",
"taskReferenceName": "send_notification",
"inputParameters": {
"http_request": {
"uri": "${workflow.input.notification_webhook_url}",
"method": "POST",
"body": {
"message": "${notify_if_failed.inputParameters.notification_message}",
"endpoint": "${workflow.input.endpoint_url}",
"status": "${call_endpoint.output.response.statusCode}",
"timestamp": "${get_timestamp_ref.output.result}"
}
}
},
"type": "HTTP",
"optional": false
}
]
},
"defaultCase": [],
"evaluatorType": "value-param"
}
],
"inputParameters": [
"endpoint_url",
"notification_webhook_url"
],
"outputParameters": {
"status": "${call_endpoint.output.response.statusCode}",
"notified": "${notify_if_failed.output.caseOutput}"
},
"schemaVersion": 2,
"restartable": true,
"ownerEmail": "sebastianralexis@gmail.com"
}