Add API call to start the iohyve installation of a guest from

an ISO

FYI, this only boots the VM with the ISO, to do the install
the user still needs to run "iohyve console <name>" from the system,
which uses serial mode to bring up a terminal

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "name" : "bsdguest",
   "iso" : "FreeBSD-10.2-RELEASE-amd64-disc1.iso",
   "action" : "install"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "iohyve",
   "id" : "fooid",
   "args" : {
      "action" : "install",
      "iso" : "FreeBSD-10.2-RELEASE-amd64-disc1.iso",
      "name" : "bsdguest"
   }
}

Response:
-------------------------------
{
  "args": {
    "install": {
      "iso": "FreeBSD-10.2-RELEASE-amd64-disc1.iso",
      "name": "bsdguest"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-02-09 14:21:34 -05:00
parent bef748977e
commit e6b285ebfd
3 changed files with 34 additions and 0 deletions

View File

@@ -513,6 +513,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
ok = true;
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject()));
}
if(act=="install"){
ok = true;
out->insert("install", sysadm::Iohyve::installGuest(in_args.toObject()));
}
if(act=="issetup"){
ok = true;
out->insert("issetup", sysadm::Iohyve::isSetup());