ml-app-deployer
ml-app-deployer copied to clipboard
Allow simple way to create alert triggers
It seems that you can create alert configs with rules and actions, but not make it install the associated triggers automatically, like described here: https://docs.marklogic.com/REST/POST/manage/v2/databases/[id-or-name]/alert/configs
Would it be difficult to enable this? Maybe a small flag inside the alert config, or a separate file that indicates they should be created.
And for the time being, what would be the easiest workaround?
Interesting, I wasn't aware of this endpoint - and I'm not sure how the "operation" part works. Do you have an example of what a "triggers" block/array looks like? I just checked the alerting config in a project that uses ml-gradle, but "triggers" is empty in it, and I don't know what would go in there (the docs just say a "trigger"- is that the name of a trigger?).
The page is a bit misguiding. You use this endpoint to create new alerting configs, but also to add or remove alert-triggers:
You can use the uri parameter and the add-alert-triggers operation to add the triggers specified in the alert configuration to an existing alert configuration. You can use the uri parameter and the remove-alert-triggers operation to remove the triggers from an existing alert configuration.
And I guess this would be the full payload of the request, no alert config:
{"operation": "add-alert-triggers"}
What would the value of the "triggers" element even be? I verified that the manage-alert-config-properties.xsd defines "trigger" as just a string, but what does that string refer to?
I want to bump this as I'm running into the same issue as @grtjn . As I understand it, you essentially need to replicate the workflow of alert:set-trigger-ids() registers it with the alert config. As such, my best guess is that the