Skip to content

Commit e5ed2b9

Browse files
authored
Merge pull request #23 from draios/alert-webhook
Add support for Webhook Notification Channels when creating Alerts
2 parents 29a4de1 + 60a0266 commit e5ed2b9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

examples/create_alert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Find notification channels (you need IDs to create an alert).
3131
#
3232
notify_channels = [ {'type': 'SLACK', 'channel': 'sysdig-demo2-alerts'},
33-
{'type': 'EMAIL', 'emailRecipients': ['gianluca@sysdig.com']},
33+
{'type': 'EMAIL', 'emailRecipients': ['[email protected]', 'test@sysdig.com']},
3434
{'type': 'SNS', 'snsTopicARNs': ['arn:aws:sns:us-east-1:273107874544:alarms-stg']}
3535
]
3636

sdcclient/_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ def get_notification_ids(self, channels):
228228
if c['name'] == ch['name']:
229229
found = True
230230
ids.append(ch['id'])
231+
elif c['type'] == 'WEBHOOK':
232+
if 'name' in c:
233+
if c['name'] == ch['name']:
234+
found = True
235+
ids.append(ch['id'])
231236
if not found:
232237
return [False, "Channel not found: " + str(c)]
233238

0 commit comments

Comments
 (0)