Add new API call to do the initial setup of Iohyve

Both the pool/nic are required for setup to complete.

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "nic" : "re0",
   "pool" : "tank",
   "action" : "setup"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "iohyve",
   "args" : {
      "pool" : "tank",
      "nic" : "re0",
      "action" : "setup"
   },
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "setup": {
      "nic": "re0",
      "pool": "tank"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-02-09 12:07:12 -05:00
parent 6a3ffaa308
commit c3c809fcbc
3 changed files with 39 additions and 1 deletions

View File

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