diff --git a/api/classes/lifepreserver.rst b/api/classes/lifepreserver.rst index 0ecc365..751495c 100644 --- a/api/classes/lifepreserver.rst +++ b/api/classes/lifepreserver.rst @@ -1,6 +1,91 @@ .. _lifepreserver: lifepreserver -============= +************* -Some intro text here... +The lifepreserver class is used to manage and retrieve information about scheduled snapshots and replication. + +Every lifepreserver class request contains the following parameters: + ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| **Parameter** | **Value** | **Description** | +| | | | ++=================================+===============+======================================================================================================================+ +| id | | any unique value for the request; examples include a hash, checksum, or uuid | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| name | sysadm | | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| namespace | lifepreserver | | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| action | | supported actions include listcron | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ + +The rest of this section provides examples of the available *actions* for each type of request, along with their responses. + +.. _List Schedules: + +List Schedules +============== + +The "listcron" action retrieves the information for each scheduled snapshot. For each schedule, it lists the name of the ZFS pool, the number of snapshots to keep, and the time that the +snapshot is taken. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/lifepreserver + { + "action" : "listcron" + } + + +**REST Response** + +.. code-block:: json + + { + "args": { + "listcron": { + "tank1": { + "keep": "3", + "schedule": "daily@18" + } + } + } + } + +**WebSocket Request** + +.. code-block:: json + + { + "args" : { + "action" : "listcron" + }, + "name" : "lifepreserver", + "namespace" : "sysadm", + "id" : "fooid" + } + +**WebSocket Response** + +.. code-block:: json + + { + "args": { + "listcron": { + "tank1": { + "keep": "3", + "schedule": "daily@18" + } + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } \ No newline at end of file diff --git a/src/server/WebSocket.cpp b/src/server/WebSocket.cpp index 1e5987f..d4b2f61 100644 --- a/src/server/WebSocket.cpp +++ b/src/server/WebSocket.cpp @@ -326,13 +326,13 @@ void WebSocket::AppCafeStatusUpdate(QString msg){ if(!SendAppCafeEvents){ return; } //don't report events on this socket RestOutputStruct out; out.CODE = RestOutputStruct::OK; - out.in_struct.name = "event"; + out.in_struct.name = "dispatcher"; out.in_struct.namesp = "events"; //Pre-set any output fields - QJsonObject outargs; - outargs.insert("name", "dispatcher"); - outargs.insert("args",QJsonValue(msg)); - out.out_args = outargs; + //QJsonObject outargs; + //outargs.insert("name", "dispatcher"); + // outargs.insert("args",QJsonValue(msg)); + out.out_args = QJsonValue(msg);//outargs; //Assemble the output JSON document/text out.Header << "Content-Type: text/json; charset=utf-8"; //REST header info