Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto supress #978

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading