libremesh / lime-packages

LibreMesh packages configuring OpenWrt for wireless mesh networking
https://libremesh.org/
GNU Affero General Public License v3.0
281 stars 96 forks source link

ubus scritps consistent interface #1136

Open javierbrk opened 2 weeks ago

javierbrk commented 2 weeks ago

Many RPC scripts used with UBUS lack a consistent interface, leading to discrepancies between different modules. It would be beneficial to establish a uniform interface, as proposed here, along with helper functions in both Bash and Lua. This would facilitate the development of scripts and ensure they can be easily utilized by the Lime app in a practical manner.

{
  "status": "success",
  "data": {
    "currentPage": 1,
    "totalPages": 5,
    "totalItems": 100,
    "itemsPerPage": 20
  },
  "message": "Items retrieved successfully."
}

{
  "status": "error",
  "message": "Item not found.",
  "errorCode": 404
}

It is important to note that this should be a coordinated effort between lime-app and lime-packages. Error codes can be lime-app translatable messages.