Hi,

 thanks, fixed in r12563.

When device_id was not requested, incorrect devices array return.

Corwin Ziegler Hunts via observium wrote on 24.02.2023 01:29:
The multiple devices API call combined with field filtering fails for us in the latest stable release, revision 12520 from 2023-02-08. The API call responds with an HTTP 200 but the data contained in the response is incomplete. It worked when we were on revision 12342 from 2022-10-24. It still works if no filtering is requested.

After experimenting further and looking at the code we found that the multiple devices API call can successfully be combined with filtering only if device_id is one of the requested fields. We suspect this broke in revision 12452.

Works:
GET /api/v0/devices/?type=firewall
GET /api/v0/devices/?type=firewall&fields=status_type,device_id

Fails:
GET /api/v0/devices/?type=firewall&fields=status_type
{"count":2,"status":"ok","devices":{"":{"status_type":"ok"}}}

Corwin


_______________________________________________
observium mailing list -- observium@lists.observium.org
To unsubscribe send an email to observium-leave@lists.observium.org

--
Mike Stupalov,
Discord channel: https://discord.gg/GjpNXKWm8W
Observium Limited, https://observium.org