wazuh-api icon indicating copy to clipboard operation
wazuh-api copied to clipboard

Add count as accepted parameter to all iterable responses

Open jesusgn90 opened this issue 6 years ago • 0 comments

Hi team,

Any API call which returns a list such /rules or /agents or /groups or whatever should have a new parameter named count. It should return the total number of things from that API call.

We may want to preserve the response structure, returning such always but the items array should be empty this time. What I meant is something like this:

GET /rules?count
{
  "items": [ ],
   "totalItems": 1230
}
GET /rules
{
  "items": [ rule1, rule2, rule3, rule4...],
   "totalItems": 1230
}

Regards!

jesusgn90 avatar Oct 25 '18 16:10 jesusgn90