From 3eef681636e5a3d0ba9b527de70fe195fc7c7c25 Mon Sep 17 00:00:00 2001 From: Lukas Simonik Date: Tue, 21 Jul 2026 16:44:33 +0200 Subject: [PATCH 1/2] docs: add info about sorting --- docs/api.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/api.md b/docs/api.md index 4925e1bf..09607f4d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -233,6 +233,8 @@ There are no attribute name checks (may be added in the future). Generic and fulltext filters are merged - fulltext overrides conflicting keys. +Sorting is supported by entity ID using the special attribute `eid`, as well as for plain and observations attributes with primitive data types (excluding json and multi_value observations). To sort by multiple attributes, provide multiple sort parameters in the format `attribute:direction` where direction is `1` (ascending) or `-1` (descending). Direction defaults to `1` if not provided. Default is no sorting. Examples: `?sort=eid:1`, `?sort=hostname:-1&sort=ip:1` + ### Request `GET /entity//get` @@ -243,6 +245,7 @@ Generic and fulltext filters are merged - fulltext overrides conflicting keys. - limit: how many entities to return (default: 20) - fulltext_filters: dictionary of fulltext filters (default: no filters) - generic_filter: dictionary of generic filters (default: no filters) +- sort: list of sort specifications (default: no sorting) ### Response From d5306e166851475fa7903474ffa7614afe5e3c58 Mon Sep 17 00:00:00 2001 From: Lukas Simonik Date: Tue, 21 Jul 2026 16:52:23 +0200 Subject: [PATCH 2/2] docs: remove ip from sort examples --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 09607f4d..e09ef1f6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -233,7 +233,7 @@ There are no attribute name checks (may be added in the future). Generic and fulltext filters are merged - fulltext overrides conflicting keys. -Sorting is supported by entity ID using the special attribute `eid`, as well as for plain and observations attributes with primitive data types (excluding json and multi_value observations). To sort by multiple attributes, provide multiple sort parameters in the format `attribute:direction` where direction is `1` (ascending) or `-1` (descending). Direction defaults to `1` if not provided. Default is no sorting. Examples: `?sort=eid:1`, `?sort=hostname:-1&sort=ip:1` +Sorting is supported by entity ID using the special attribute `eid`, as well as for plain and observations attributes with primitive data types (excluding json and multi_value observations). To sort by multiple attributes, provide multiple sort parameters in the format `attribute:direction` where direction is `1` (ascending) or `-1` (descending). Direction defaults to `1` if not provided. Default is no sorting. Examples: `?sort=eid:1`, `?sort=hostname:-1&sort=rep_score:1` ### Request