thingsboard icon indicating copy to clipboard operation
thingsboard copied to clipboard

Result discrepancy between APIs

Open maghibus opened this issue 1 year ago • 0 comments

Describe the bug

It appears that the Find Alarms by Query API is not returning the correct number of results

I use Thingsboard CE 3.6.2

To Reproduce

  1. you must have some alarm
  2. using a tenant administrator
curl -X 'POST' \
  'https://localhost:443/api/alarmsQuery/find' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-Authorization: Bearer eyJhbGciOiJIUzUxMiJ...' \
  -d '{
  "entityFilter": {
    "type": "entityType",
    "resolveMultiple": true,
    "entityType": "DEVICE"
  },
  "keyFilters": [],
  "pageLink": {
    "page": 0,
    "pageSize": 10,
    "typeList": [
      "Allarme Flusso inverso"
    ],
    "statusList": [
      "ACTIVE"
    ]
  },
  "alarmFields": [
    {
      "type": "ALARM_FIELD",
      "key": "createdTime"
    },
    {
      "type": "ALARM_FIELD",
      "key": "type"
    },
    {
      "type": "ALARM_FIELD",
      "key": "severity"
    },
    {
      "type": "ALARM_FIELD",
      "key": "status"
    }
  ]
}
'

image

the API returns only 3 items I would have expected to see 23 items as happens using the search panel or with the API Get All Alarms V2

Screenshots image

curl -X 'GET' \
  'https://localhost:443/api/v2/alarms?statusList=ACTIVE&severityList=MAJOR&typeList=Allarme%20Flusso%20inverso&pageSize=10&page=0' \
  -H 'accept: application/json' \
  -H 'X-Authorization: Bearer eyJ...'

image


Disclaimer

We appreciate your contribution whether it is a bug report, feature request, or pull request with improvement (hopefully). Please comply with the Community ethics policy, and do not expect us to answer your requests immediately. Also, do not treat GitHub issues as a support channel.

maghibus avatar Sep 10 '24 20:09 maghibus