Skip to content

feat: add device listing API v2 endpoints#25

Open
mukama wants to merge 3 commits intotetherto:developfrom
mukama:feat/device-listings
Open

feat: add device listing API v2 endpoints#25
mukama wants to merge 3 commits intotetherto:developfrom
mukama:feat/device-listings

Conversation

@mukama
Copy link
Contributor

@mukama mukama commented Mar 3, 2026

Summary

  • Adds 4 GET /auth/miners|containers|cabinets API v2 endpoints replacing frontend list-things queries with dedicated REST APIs
  • Miners and containers endpoints replace frontend's tag/type-based list-things queries with server-side filtering, search, pagination, and field projection
  • Cabinets endpoint groups powermeter and temp-sensor devices by position root into cabinet objects

Endpoints

GET /auth/miners — list miners via listThings RPC with t-miner tag
GET /auth/miners?filter={"type":"miner-am-s19xp"}&search=7EB&sort={"id":-1}&fields={"id":1,"type":1}&offset=0&limit=10&overwriteCache=true
Optional: filter, sort, fields, search, offset, limit, overwriteCache

Response: { miners: [...], total }

GET /auth/containers — list containers via listThings RPC with t-container tag
GET /auth/containers?filter={"type":"container-bd-d40-s19xp"}&search=2618&sort={"id":-1}&fields={"id":1,"type":1}&offset=0&limit=10&overwriteCache=true
Optional: filter, sort, fields, search, offset, limit, overwriteCache

Response: { containers: [...], total }

GET /auth/cabinets — list cabinets (grouped powermeters + temp sensors) via listThings RPC
GET /auth/cabinets?filter={"id":"lv3_pm6"}&sort={"id":-1}&offset=0&limit=10&overwriteCache=true
Optional: filter, sort, offset, limit, overwriteCache

Response: { cabinets: [{ id, devices: [...], type }], total }

GET /auth/cabinets/:id — single cabinet by ID
GET /auth/cabinets/lv3_pm6

Response: { cabinet: { id, devices: [...], type } } or 404

mukama added 2 commits March 3, 2026 15:41
Resolve conflicts in constants.js and server/index.js to include
both device listing and alerts endpoints.
…points

Address PR review: use requestRpcMapAllPages to fetch all items beyond
the default 100-item RPC limit, and pass DEVICE_LIST_FIELDS projection
to reduce response size when status=1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants