mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
Add a new API call:
rpc/dispatcher -> "action":"list"
This will list all the currently running/pending processes within the dispatcher queues.
Possible Queues: "no_queue", "pkg_queue", "iocage_queue"
REST Request:
-------------------------------
PUT /rpc/dispatcher
{
"action" : "list"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "list"
},
"namespace" : "rpc",
"name" : "dispatcher",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"jobs": {
"pkg_queue": {
"sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}": {
"commands": [
"pkg install -y --repository \"pcbsd-major\" misc/pcbsd-meta-mate"
],
"queue_position": "0",
"state": "running"
}
}
}
},
"id": "fooid",
"name": "response",
"namespace": "rpc"
}
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
#define DEBUG 0
|
||||
#define SCLISTDELIM QString("::::") //SysCache List Delimiter
|
||||
//#define SCLISTDELIM QString("::::") //SysCache List Delimiter
|
||||
RestOutputStruct::ExitCode WebSocket::AvailableSubsystems(bool allaccess, QJsonObject *out){
|
||||
//Probe the various subsystems to see what is available through this server
|
||||
//Output format:
|
||||
@@ -287,8 +287,9 @@ RestOutputStruct::ExitCode WebSocket::EvaluateDispatcherRequest(bool allaccess,
|
||||
//Return the PENDING result
|
||||
LogManager::log(LogManager::HOST, "Client Launched Processes["+SockPeerIP+"]: "+ids.join(",") );
|
||||
out->insert("started", QJsonArray::fromStringList(ids));
|
||||
//}else if(act=="read"){
|
||||
|
||||
}else if(act=="list"){
|
||||
QJsonObject info = DISPATCHER->listJobs();
|
||||
out->insert("jobs", info);
|
||||
}else{
|
||||
return RestOutputStruct::BADREQUEST;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user