Add new API call to run replication tasks manually

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "host" : "10.0.10.100",
   "dataset" : "mypool",
   "action" : "runreplication"
}

REST Response:
-------------------------------
{
    "args": {
        "runreplication": {
            "dataset": "mypool",
            "host": "10.0.10.100"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "lifepreserver",
   "args" : {
      "host" : "10.0.10.100",
      "dataset" : "mypool",
      "action" : "runreplication"
   },
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "runreplication": {
      "dataset": "mypool",
      "host": "10.0.10.100"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-01-15 12:11:01 -05:00
parent f31d53587f
commit 84cb7bb19d
3 changed files with 46 additions and 0 deletions

View File

@@ -217,6 +217,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmLifePreserverRequest(const Q
ok = true;
out->insert("revertsnap", sysadm::LifePreserver::revertSnapshot(in_args.toObject()));
}
if(act=="runreplication"){
ok = true;
out->insert("runreplication", sysadm::LifePreserver::runReplication(in_args.toObject()));
}
if(act=="savesettings"){
ok = true;
out->insert("savesettings", sysadm::LifePreserver::saveSettings(in_args.toObject()));