Add ip4 to iocage's listjails sysadm API call

REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "listjails"
}

REST Response:
-------------------------------
{
    "args": {
        "listjails": {
            "0bf985de-ca0f-11e5-8d45-d05099728dbf": {
                "boot": "off",
                "ip4": "-",
                "jid": "-",
                "state": "down",
                "tag": "test",
                "type": "basejail"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "name" : "iocage",
   "id" : "fooid",
   "args" : {
      "action" : "listjails"
   },
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listjails": {
      "0bf985de-ca0f-11e5-8d45-d05099728dbf": {
        "boot": "off",
        "ip4": "-",
        "jid": "-",
        "state": "down",
        "tag": "test",
        "type": "basejail"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Brandon Schneider
2016-02-03 01:08:31 -06:00
parent a9ba0a317c
commit 5a048cbdba

View File

@@ -8,6 +8,7 @@
#include "sysadm-iocage.h"
#include "sysadm-global.h"
using namespace sysadm;
//PLEASE: Keep the functions in the same order as listed in pcbsd-general.h
@@ -93,9 +94,10 @@ QJsonObject Iocage::listJails() {
jail.insert("state", line.section(" ", 3, 3));
jail.insert("tag", line.section(" ", 4, 4));
jail.insert("type", line.section(" ", 5, 5));
jail.insert("ip4", line.section(" ", 6, 6));
retObject.insert(uuid, jail);
}
return retObject;
return retObject;
}