Gateways Server API: Bulk stats endpoint improvement

dsr
Tue, 14 Nov 2023 14:42:21 +0000
Ideas

Hi,

I’ve been using the Gateways Server API, specifically the bulk stats endpoint, to retrieve stats from my gateways.
Recently I hit a roadblock which defeats the purpose of the endpoint: when a gateway is not found, because it is offline so there’s no updated stats in the server, the endpoint replies as follows:

{
 'code': 5,
 'message': 'error:pkg/identityserver:some_gateways_not_found (some gateways not found)',
 'details': [{
  '@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails',
  'namespace': 'pkg/identityserver',
  'name': 'some_gateways_not_found',
  'message_format': 'some gateways not found',
  'correlation_id': '1689af4e405f428e9059f8b02af7f602',
  'code': 5
 }]
}

This forces me to query the stats one gateway at a time because I don’t know which ones are online or offline upfront. To this, I have 2 suggestions that I believe are well aligned with the endpoint purpose:

1. List the gateways that were not found, so one can remove them from the list, and retry the request.

2. Reply with the stats from gateways that were indeed found, and simply leave out those that weren’t.

Any feedback is appreciated. And if I’m missing something that could help working around this issue besides querying each gateways individually, that would be even more appreciated.

–David

4 posts - 3 participants