summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/server.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-11-03 08:26:34 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 17:33:03 +0000
commitc1574ae46f7a5701d79f2c1d333094a5d5919a46 (patch)
tree1dd237ed9b65dd29000fbf9acdd3c5d4eb86f4f3 /bitbake/lib/hashserv/server.py
parent3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37 (diff)
downloadpoky-c1574ae46f7a5701d79f2c1d333094a5d5919a46.tar.gz
bitbake: hashserv: Add database column query API
Adds an API to retrieve the columns that can be queried on from the database backend. This prevents front end applications from needing to hardcode the query columns (Bitbake rev: abfce2b68bdab02ea2e9a63fbb3b9e270428a0a6) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/hashserv/server.py')
-rw-r--r--bitbake/lib/hashserv/server.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/server.py b/bitbake/lib/hashserv/server.py
index c5b9797e4e..8c3d20b651 100644
--- a/bitbake/lib/hashserv/server.py
+++ b/bitbake/lib/hashserv/server.py
@@ -250,6 +250,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
250 "get-stream": self.handle_get_stream, 250 "get-stream": self.handle_get_stream,
251 "get-stats": self.handle_get_stats, 251 "get-stats": self.handle_get_stats,
252 "get-db-usage": self.handle_get_db_usage, 252 "get-db-usage": self.handle_get_db_usage,
253 "get-db-query-columns": self.handle_get_db_query_columns,
253 # Not always read-only, but internally checks if the server is 254 # Not always read-only, but internally checks if the server is
254 # read-only 255 # read-only
255 "report": self.handle_report, 256 "report": self.handle_report,
@@ -572,6 +573,10 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
572 async def handle_get_db_usage(self, request): 573 async def handle_get_db_usage(self, request):
573 return {"usage": await self.db.get_usage()} 574 return {"usage": await self.db.get_usage()}
574 575
576 @permissions(DB_ADMIN_PERM)
577 async def handle_get_db_query_columns(self, request):
578 return {"columns": await self.db.get_query_columns()}
579
575 # The authentication API is always allowed 580 # The authentication API is always allowed
576 async def handle_auth(self, request): 581 async def handle_auth(self, request):
577 username = str(request["username"]) 582 username = str(request["username"])