mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
210 lines
5.8 KiB
ReStructuredText
210 lines
5.8 KiB
ReStructuredText
.. _systeminfo:
|
|
|
|
systeminfo
|
|
**********
|
|
|
|
The systeminfo class is used to retrieve information about the system. Every systeminfo class request contains the following parameters:
|
|
|
|
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
|
| **Parameter** | **Value** | **Description** |
|
|
| | | |
|
|
+=================================+===============+======================================================================================================================+
|
|
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
|
| | | |
|
|
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
|
| name | systeminfo | |
|
|
| | | |
|
|
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
|
| namespace | sysadm | |
|
|
| | | |
|
|
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
|
| 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:
|
|
|
|
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). its
|
|
status (offline, charging, on backup, or unknown), and estimated time left (in seconds).
|
|
|
|
**REST Request**
|
|
|
|
.. code-block:: json
|
|
|
|
PUT /sysadm/systeminfo
|
|
{
|
|
"action" : "batteryinfo"
|
|
}
|
|
|
|
**REST Response**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"args": {
|
|
"batteryinfo": {
|
|
"battery": "false"
|
|
}
|
|
}
|
|
}
|
|
|
|
**WebSocket Request**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"namespace" : "sysadm",
|
|
"name" : "systeminfo",
|
|
"id" : "fooid",
|
|
"args" : {
|
|
"action" : "batteryinfo"
|
|
}
|
|
}
|
|
|
|
**WebSocket Response**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"args": {
|
|
"batteryinfo": {
|
|
"battery": "false"
|
|
}
|
|
},
|
|
"id": "fooid",
|
|
"name": "response",
|
|
"namespace": "sysadm"
|
|
}
|
|
|
|
.. index:: externalmounts, systeminfo
|
|
|
|
.. _List External Mounts:
|
|
|
|
List External Mounts
|
|
====================
|
|
|
|
The "externalmounts" action returns a list of mounted external devices. Supported device types are UNKNOWN, USB, HDRIVE (external hard drive), DVD, and SDCARD.
|
|
For each mounted device, the response will include the device name, filesystem, mount path, and device type.
|
|
|
|
**REST Request**
|
|
|
|
.. code-block:: json
|
|
|
|
PUT /sysadm/systeminfo
|
|
{
|
|
"action" : "externalmounts"
|
|
}
|
|
|
|
**REST Response**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"args": {
|
|
"externalmounts": {
|
|
"/dev/fuse": {
|
|
"filesystem": "fusefs",
|
|
"path": "/usr/home/kris/.gvfs",
|
|
"type": "UNKNOWN"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
**WebSocket Request**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"id" : "fooid",
|
|
"namespace" : "sysadm",
|
|
"name" : "systeminfo",
|
|
"args" : {
|
|
"action" : "externalmounts"
|
|
}
|
|
}
|
|
|
|
**WebSocket Response**
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"args": {
|
|
"externalmounts": {
|
|
"/dev/fuse": {
|
|
"filesystem": "fusefs",
|
|
"path": "/usr/home/kris/.gvfs",
|
|
"type": "UNKNOWN"
|
|
}
|
|
}
|
|
},
|
|
"id": "fooid",
|
|
"name": "response",
|
|
"namespace": "sysadm"
|
|
}
|