Hey guys,
I’m trying to update all our alert rules in grafana & am having trouble with my testing. If I try to PUT just the for
parameter (the only one I’m changing) to the /api/v1/provisioning/alert-rules/:uid
endpoint, I get a 400. If I run a GET on this endpoint or the export endpoint to pull all the JSON data, update the for
attribute, & remove the updated
attribute, I still get a 400 on the PUT. Same if I try adding the X-Disable-Provenance: true
header. I figure I’m missing something with this & need some guidance on what I actually need to pass to the API for it to update the alert rule properly. And before anyone asks, this is being done with a service account with admin permissions.
Not entirely sure what to look for in the network console, but I’ll see what comes up. I’ve been using curl & python scripts for testing.
Figured out my issue. It was in my python code. using data=
instead of json=
for passing the json data through the requests module.