User story #17408
closed
Possibility to attach Rules to Rule Categories when using the REST API
Added by Bas B over 4 years ago.
Updated about 4 years ago.
Suggestion strength:
Require - I need this to use Rudder as I intend
Description
Hello,
At this moment, the Rudder API does not expose endpoint capabilities to attach a rule to a rule category with the Rest API. The Rudder Console does allow this.
It would be very nice to make this feature available through the REST API. It will bring the capabilities to automatically create and organize rules with the Rule Categories.
Regards, Bas
- Subject changed from Possibility to attach Rudder Rules to Rudder Rule Categories when using the REST API to Possibility to attach Rules to Rule Categories when using the REST API
Hi Bas,
It's possible to do it, but indeed the doc is not mentionning it
To change the category of a rule, you need to update its "category" field with the id of the category, as follow
# curl --header "X-API-Token: 3tSnPlnbEiknLxslYlaP1TaHqalxhjvV" --request POST 'https://localhost/rudder/api/latest/rules/38e0c6ea-917f-47b8-82e0-e6a1d3dd62ca' --data "category=c9dcb5bd-efac-466a-b525-ce442af93021"
{"action":"updateRule","id":"38e0c6ea-917f-47b8-82e0-e6a1d3dd62ca","result":"success","data":{"rules":[{"id":"38e0c6ea-917f-47b8-82e0-e6a1d3dd62ca","displayName":"test move category","shortDescription":"","longDescription":"","directives":["18c390c0-c193-49e9-844b-b91e7ff857eb"],"targets":[{"include":{"or":["group:a1cf3963-f1a2-496f-9640-4c38470f34bb"]},"exclude":{"or":[]}}],"enabled":true,"system":false,"tags":[]}]}}
- Related to Bug #17409: API documentation on Rules is missing explaination on how to update rule category added
Nicolas CHARLES wrote in #note-2:
Hi Bas,
It's possible to do it, but indeed the doc is not mentionning it
To change the category of a rule, you need to update its "category" field with the id of the category, as follow
[...]
Works! Thanks, Nicolas.
- Status changed from New to Resolved
i'm marking this as resolved then
Also available in: Atom
PDF