TLDR: Is there a way currently, or planned, to create receivers and routes used by the integrated Alertmanager? via provisioning or an API endpoint?
I’ve figured out how to export/import the new rules via the documented API (using POST to /api/ruler/grafana/api/v1/rules/), however, I have not found a way to export receivers/routes (‘Contact Points’ and ‘Notification Policies’, respectively) and create them. There is no API endpoint that I can find, nor any provisioning exposed to do so.
I can see these settings under the “Admin” tab of the Alerting section:
The configuration json in this window is what I need, but when I try and provision a new instance of Grafana with ngalert enabled and paste/save the json in here, it fails as none of the actual objects exist.
As an aside, the API endpoint to POST rules for creation is not idempotent, which I was really hoping for with this new API. This is also the case for the rest of the Grafana API, which is a real pain when trying to provision systems with the same configuration, as we first have to hit the API and pull everything to see if it exists, THEN create objects.