Skip to content

Commit

Permalink
feat: auto supress (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Mar 18, 2024
1 parent c4a87b7 commit e88bc16
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/workflows/autosupress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
workflow:
id: autosupress
description: demonstrates how to automatically suppress alerts
triggers:
- type: alert
filters:
- key: name
value: r"(somename)"
actions:
- name: dismiss-alert
provider:
type: mock
with:
enrich_alert:
- key: dismissed
value: "true"
8 changes: 8 additions & 0 deletions keep/providers/mock_provider/mock_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def _query(self, **kwargs):
"""
return kwargs.get("command_output")

def _notify(self, **kwargs):
"""This is mock provider that just return the command output.
Returns:
_type_: _description_
"""
return kwargs

def dispose(self):
"""
No need to dispose of anything, so just do nothing.
Expand Down

0 comments on commit e88bc16

Please sign in to comment.