mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add new API call to add/create a disk for a VM
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
"name" : "bsdguest",
"action" : "adddisk",
"size" : "10G"
}
WebSocket Request:
-------------------------------
{
"args" : {
"size" : "10G",
"name" : "bsdguest",
"action" : "adddisk"
},
"id" : "fooid",
"namespace" : "sysadm",
"name" : "iohyve"
}
Response:
-------------------------------
{
"args": {
"adddisk": {
"bsdguest": {
"size": "10G"
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -581,6 +581,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
|
||||
if(keys.contains("action")){
|
||||
QString act = JsonValueToString(in_args.toObject().value("action"));
|
||||
//qDebug() << " - iohyve action:" << act;
|
||||
if(act=="adddisk"){
|
||||
ok = true;
|
||||
out->insert("adddisk", sysadm::Iohyve::addDisk(in_args.toObject()));
|
||||
}
|
||||
if(act=="create"){
|
||||
ok = true;
|
||||
out->insert("create", sysadm::Iohyve::createGuest(in_args.toObject()));
|
||||
|
||||
Reference in New Issue
Block a user