mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-16 01:01:58 +00:00
Add Loki and Sentinel utility classes for web API endpoints
- Implemented LokiUtils class with GET and POST endpoints for managing scripts, jobs, and payloads. - Added SentinelUtils class with GET and POST endpoints for managing events, rules, devices, and notifications. - Both classes include error handling and JSON response formatting.
This commit is contained in:
@@ -174,7 +174,11 @@ class RLUtils:
|
||||
try:
|
||||
return self.shared_data.db.query(sql) or []
|
||||
except Exception as exc:
|
||||
logger.error(f"DB query failed: {exc}")
|
||||
msg = str(exc)
|
||||
if "no such table" in msg:
|
||||
logger.debug(f"Table not yet created (AI not active): {msg}")
|
||||
else:
|
||||
logger.error(f"DB query failed: {exc}")
|
||||
return []
|
||||
|
||||
def _query_scalar(self, sql: str, key: str, default: int = 0) -> int:
|
||||
|
||||
Reference in New Issue
Block a user