diff --git a/api/classes/fs.rst b/api/classes/fs.rst index d5d4fc0..fb47751 100644 --- a/api/classes/fs.rst +++ b/api/classes/fs.rst @@ -3,7 +3,7 @@ fs ** -The fs class is used to to manage the files and directories on the system. +The fs class is used to manage the files and directories on the system. Every fs class request contains the following parameters: diff --git a/api/classes/logs.rst b/api/classes/logs.rst new file mode 100644 index 0000000..029c58a --- /dev/null +++ b/api/classes/logs.rst @@ -0,0 +1,71 @@ +.. _logs: + +logs +**** + +The logs class is used to interact with the log files created by the SysAdm server. + +Every logs class request contains the following parameters: + ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| **Parameter** | **Value** | **Description** | +| | | | ++=================================+===============+======================================================================================================================+ +| id | | any unique value for the request; examples include a hash, checksum, or uuid | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| name | logs | | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| namespace | sysadm | | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ +| action | | supported actions include "read_logs" | +| | | | ++---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ + +The rest of this section provides examples of the available *actions* for each type of request, along with their responses. + +.. index:: read_logs, logs + +.. _Read Logs: + +Read Logs +========= + +The "read_logs" action can be used to display log entries. It supports the following optional arguments: + +* **logs:** used to specify an array or string of log type(s). Valid types are "hostinfo", "dispatcher", "events-dispatcher","events-lifepreserver", and "events-state". + +* **time_format:** used to specify the format for "start_time" and "end_time". Valid Formats are "time_t_seconds", "epoch_mseconds, "relative_[day/month/second]", or a + `QDateTime String code `_. + +* **start_time:** displays log entries that occurred after the time specified using a valid "time_format". + +* **end_time:** displays log entries that occurred before the time specified using a valid "time_format". + +If the "time_format" is not specified, or if the "start_time" or "end_time" are not defined, the end time will be the current date and time and the start time will be 12 hours previous. + +If the "logs" argument is missing or empty, then all logs matching the search parameters will be returned. + +For example, this input returns all log entries within the last hour: + +.. code-block:: json + + { + "action" : "read_logs", + "time_format" : "relative_second", + "start_time" : "-3600" + } + +And will return this format: + +.. code-block:: json + + "args" : { + "" : { + "" : , + "" : + } + } +