New API call for creating a new boot environment. An optional flag is shown below.

By specifying clonefrom which passes along the -e flag it will clone from a inactive boot environment.

REST Request:
-------------------------------
PUT /sysadm/beadm
{
   "action" : "createbe",
   "newbe" : "red",
   "clonefrom" : "green"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "newbe" : "red",
      "clonefrom" : "green",
      "action" : "createbe"
   },
   "namespace" : "sysadm",
   "name" : "beadm"
}

Response:
-------------------------------
{
  "args": {
    "createbe": {
      "clonefrom": "green",
      "newbe": "red"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
JoshDW19
2016-02-09 11:49:39 -05:00
parent 6a3ffaa308
commit f58eb8ce08
3 changed files with 42 additions and 1 deletions

View File

@@ -91,7 +91,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateBackendRequest(const RestInputStru
}else{
QJsonObject avail;
AvailableSubsystems(IN.fullaccess, &avail);
if(!avail.contains(namesp+"/"+name)){ return RestOutputStruct::BADREQUEST; }
if(!avail.contains(namesp+"/"+name)){ return RestOutputStruct::NOTFOUND; }
}
//Go through and forward this request to the appropriate sub-system
@@ -207,6 +207,9 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmBEADMRequest(const QJsonValu
}else if(act=="activatebe"){
ok = true;
out->insert("activatebe", sysadm::BEADM::activateBE(in_args.toObject()));
}else if(act=="createbe"){
ok = true;
out->insert("createbe", sysadm::BEADM::createBE(in_args.toObject()));
}
} //end of "action" key usage