argos/docs/developer/new-notification-way.md

1.1 KiB
Raw Permalink Blame History

Add a notification way

Adding a new notification way is quite simple.

First, you need to think about how you will configure it. As example, heres how gotify notifications are configured:

gotify:
  - url: https://example.org
    tokens:
      - foo
      - bar

Feel free to open an issue to discuss about your notification way or its configuration before coding! See #50 for example.

Then, youll need to add the pydantic schema matching your config in argos/schemas/config.py.

For gotify, its:

class GotifyUrl(BaseModel):
    url: HttpUrl
    tokens: List[str]

Add the schema to the General schema in the same file (dont forget to make it optional).

For gotify, we added this:

    gotify: Optional[List[GotifyUrl]] = None

Finally, write a function which use your new notification way in argos/server/alerting.py and use it in the handle_alert function of the same file.