Skip to content

Commit

Permalink
Add Opsgenie notification support. (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalwar23 authored Apr 24, 2024
1 parent 51e245c commit d0b24c8
Show file tree
Hide file tree
Showing 10 changed files with 413 additions and 413 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## 0.0.1-alpha.4(25.01.2024)
## 0.0.1-alpha.5 (25.04.2024)

- Add `Opsgenie` notification support
- Update documentation
- Update dependencies

## 0.0.1-alpha.4 (25.01.2024)

- Add delete monitor by monitor id
- Add `bump-my-version` for version handling
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
"python-socketio[client]" = ">=5.11.0"
pyyaml = ">=6.0.1"
requests = ">=2.31.0"
"typer[all]" = ">=0.9.0"
typer = ">=0.12.3"
validators = ">=0.22.0"

[dev-packages]
Expand Down
777 changes: 374 additions & 403 deletions Pipfile.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ pip install -e .
### Notification

- Supported notification providers (tested)
[x] Opsgenie
- [x] Rocket.Chat
- [x] Slack
- [x] MS Teams
- [x] Teams
- [x] Webhook
- [x] List all `notification`(s).
- [x] See details of a `single notification` by name/id.
Expand Down
13 changes: 11 additions & 2 deletions docs/source/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ Example configuration of `notificaiton` provider config file
```yaml
---
notifications:
- opsgenie:
name: "Opsgenie Nofification"
type: "Opsgenie"
is_default: false
apply_existing: false
opsgeniePriority: 1
opsgenieRegion: "eu" # us(default)/eu
opsgenieApiKey: "something"
- rocketchat:
name: "Uptime notification"
name: "RocketChat Notification"
type: "rocket.chat"
is_default: false
apply_existing: false
Expand All @@ -36,9 +44,10 @@ Following notification providers are supported by **`kumaone`** NOT `uptime kuma
support for `uptime kuma` [please see here](https://github.com/louislam/uptime-kuma/wiki/Notification-Methods).
```

- MS Teams
- Opsgenie
- Rocket.Chat
- Slack
- Teams
- Webhook

```{seealso}
Expand Down
10 changes: 9 additions & 1 deletion examples/notification.config.example.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
notifications:
- opsgenie:
name: "Opsgenie Nofification"
type: "Opsgenie"
is_default: false
apply_existing: false
opsgeniePriority: 1
opsgenieRegion: "eu" # us(default)/eu
opsgenieApiKey: "something"
- rocketchat:
name: "Uptime notification"
name: "RocketChat Notification"
type: "rocket.chat"
is_default: false
apply_existing: false
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"python-socketio[client] >= 5.11.0",
"pyyaml >= 6.0.1",
"requests >= 2.31.0",
"typer[all] >= 0.9.0",
"typer >= 0.12.3",
"validators >= 0.22.0"
]

Expand Down Expand Up @@ -182,7 +182,7 @@ exclude_lines = [
]

[tool.bumpversion]
current_version = "0.0.1-alpha.4"
current_version = "0.0.1-alpha.5"
#parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
#serialize = ["{major}.{minor}.{patch}"]
parse = """(?x)
Expand Down
2 changes: 1 addition & 1 deletion src/kumaone/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

year = datetime.now().year

__version__ = "0.0.1-alpha.4"
__version__ = "0.0.1-alpha.5"
__author__ = "Dalwar Hossain"
__license__ = "BSD 3-Clause"
__home_page__ = "https://kumaone.rtfd.io"
Expand Down
5 changes: 5 additions & 0 deletions src/kumaone/notification_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
__email__ = "dalwar23@pm.me"

notification_providers = {
"opsgenie":{
"opsgeniePriority": "",
"opsgenieRegion": "",
"opsgenieApiKey": "",
},
"rocket.chat": {
"rocketchannel": "",
"rocketusername": "",
Expand Down
2 changes: 1 addition & 1 deletion src/kumaone/payload_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _get_monitor_payload(
accepted_statuscodes = ["200-299"]

if notificationIDList is None:
notificationIDList = []
notificationIDList = {}

monitor_data = {
"type": type,
Expand Down

0 comments on commit d0b24c8

Please sign in to comment.