Add new API call to iohyve to remove a iso dataset

Target is the iso we are removing from iohyve

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "rmiso",
   "target" : "FreeBSD-10.2-RELEASE-amd64-bootonly.iso"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "iohyve",
   "args" : {
      "target" : "FreeBSD-10.2-RELEASE-amd64-bootonly.iso",
      "action" : "rmiso"
   },
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "rmiso": {
      "target": "FreeBSD-10.2-RELEASE-amd64-bootonly.iso"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
JoshDW19
2016-02-04 15:53:45 -05:00
parent 4d3b590f46
commit 5cb8dcf026
3 changed files with 29 additions and 1 deletions

View File

@@ -449,7 +449,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
ok = true;
out->insert("renameiso", sysadm::Iohyve::renameISO(in_args.toObject()));
}
if(act=="rmiso"){
ok = true;
out->insert("rmiso", sysadm::Iohyve::rmISO(in_args.toObject()));
}
} //end of "action" key usage
//If nothing done - return the proper code