From 3b51062f748b0327e4c56ac62dfd15e173455cc3 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Fri, 22 Jan 2016 10:21:36 -0500 Subject: [PATCH] Doc memorypercentage action. --- api/classes/systeminfo.rst | 65 +++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/api/classes/systeminfo.rst b/api/classes/systeminfo.rst index 919f013..08b041f 100644 --- a/api/classes/systeminfo.rst +++ b/api/classes/systeminfo.rst @@ -18,12 +18,70 @@ The systeminfo class is used to retrieve information about the system. Every sys | namespace | sysadm | | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ -| action | | supported actions include "batteryinfo", "externalmounts" | +| action | | supported actions include "memorypercentage", "batteryinfo", "externalmounts" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ The rest of this section provides examples of the available *actions* for each type of request, along with their responses. +.. index:: memorypercentage, systeminfo + +.. _Memory Usage: + +Memory Usage +============ + +The "memorypercentage" action returns the total memory in use. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/systeminfo + { + "action" : "memorypercentage" + } + +**REST Response** + +.. code-block:: json + + { + "args": { + "memorypercentage": { + "memoryused": 42 + } + } + } + +**WebSocket Request** + +.. code-block:: json + + { + "id" : "fooid", + "args" : { + "action" : "memorypercentage" + }, + "namespace" : "sysadm", + "name" : "systeminfo" + } + +**WebSocket Response** + +.. code-block:: json + + { + "args": { + "memorypercentage": { + "memoryused": 42 + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. index:: batteryinfo, systeminfo .. _Battery Information: @@ -31,9 +89,8 @@ The rest of this section provides examples of the available *actions* for each t Battery Information =================== -The "batteryinfo" action will indicate whether or not a battery exists. If it does, it will also report its current charge percentage level (1-99) and its -status (offline, charging, on backup, or unknown) and estimated time left (in seconds) -timeleft (1-XXXXXX) +The "batteryinfo" action will indicate whether or not a battery exists. If it does, it will also report its current charge percentage level (1-99). its +status (offline, charging, on backup, or unknown), and estimated time left (in seconds). **REST Request**