0
0
mirror of https://github.com/alerta/alerta-contrib.git synced 2024-12-04 12:27:25 +00:00
alerta_alerta-contrib/webhooks/msteams
2023-03-21 00:15:34 +01:00
..
alerta_msteamswebhook.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
README.md Update READMEs 2020-11-20 22:39:32 +01:00
setup.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
test_msteamswebhook.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00

MS Teams Webhook

Receive HttpPOST ack,close and blackout actions via webhook callbacks.

For help, join Slack chat

Installation

Clone the GitHub repo and run:

$ python setup.py install

Or, to install remotely from GitHub run:

$ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/msteams

Note: If Alerta is installed in a python virtual environment then plugins need to be installed into the same environment for Alerta to dynamically discover them.

Configuration

The custom webhook will be auto-detected and added to the list of available API endpoints.

  • Create apikey with write:webhooks scope.
  • Put apikey to MS_TEAMS_APIKEY config.
  • Configure MS_TEAMS_INBOUNDWEBHOOK_URL to point to your alerta /webhooks/msteams url.
  • Configure msteams plugin MS_TEAMS_PAYLOAD to add potentialaction buttons to msteams alerts. (Example in example-payload.json.j2

Example Request

curl -sSL -X POST -H 'Content-Type: application/json' \
  -H 'X-API-Key: <API_KEY>' \
  -d \
  '
    {
      "action": "ack",
      "alert_id": "32adb117-0045-4626-ad89-a258db98133f"
    }
  ' \
  'http://localhost:8080/api/webhooks/msteams'

References

License

Copyright (c) 2019 Jarno Huuskonen. Available under the MIT License.