User story #7414closed
Allow user to select level of compliance details in API response
For now, the compliance API is quite verbose in its details, and most of the time, one just want a synthetic view of compliance, especially when looking for all rules/nodes.
Of course, this can be achieved with a post processor like jq, but not everybody want to write jq scripts, and it's quite unoptimized regarding network load.
So we need to be able to specify a query parameter which tell the server how many level deep the user want details on.
curl -k -H "X-API-Token: XXXX" 'http://localhost:8082/rudder-web/api/latest/compliance/nodes?level=3'
Where level=1 (or less) mean "only top elements (nodes or rules), 2 means "also their sub-elements", etc until the most detailed level. Any number superior to the total number of level also lead to returning all levels.
Also, the compliance mode should be present at the top level.