mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Organization update 2:
- Moved API docs to general "docs" folder; all handbooks are now in the same area. - Deleted "pcbsd_style" from all three handbooks as it is now trueos_style. - Fixed a number of themeing elements for server and client handbooks. - Added logos to both handbooks.
This commit is contained in:
400
docs/api_reference/classes/beadm.rst
Normal file
400
docs/api_reference/classes/beadm.rst
Normal file
@@ -0,0 +1,400 @@
|
||||
.. _beadm:
|
||||
|
||||
beadm
|
||||
*****
|
||||
|
||||
The beadm class is used to manage boot environments.
|
||||
|
||||
Every beadm class request contains several parameters:
|
||||
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+======================================================================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| name | beadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "listbes", "renamebe", "activatebe", "createbe", "destroybe", "mountbe", and "umountbe" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: listbes, beadm
|
||||
|
||||
.. _List Boot Environments:
|
||||
|
||||
List Boot Environments
|
||||
======================
|
||||
|
||||
The "listbes" action retrieves the list of boot environments. For each
|
||||
boot environment, the response includes its name, its flags (where "R"
|
||||
is active on reboot, "N" is active now and "-" is inactive), the date it
|
||||
was created, its mount point, its nickname, and its size.
|
||||
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"action" : "listbes"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "beadm",
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "listbes"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"listbes": {
|
||||
"11.0-CURRENTJAN2016-up-20160128_150853": {
|
||||
"active": "NR",
|
||||
"date": "2016-01-28",
|
||||
"mount": "/",
|
||||
"nick": "14:57",
|
||||
"space": "10.2G"
|
||||
},
|
||||
"initial": {
|
||||
"active": "-",
|
||||
"date": "2016-01-28",
|
||||
"mount": "-",
|
||||
"nick": "07:00",
|
||||
"space": "1.2G"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: renamebe, beadm
|
||||
|
||||
.. _Rename a Boot Environment:
|
||||
|
||||
Rename a Boot Environment
|
||||
=========================
|
||||
|
||||
The "renamebe" action renames the specified boot environment. When using
|
||||
this action, specify the new name as the "source" and the boot
|
||||
environment as the "target".
|
||||
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"source" : "newname",
|
||||
"action" : "renamebe",
|
||||
"target" : "bootthingy"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"name" : "beadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"source" : "newname",
|
||||
"target" : "bootthingy",
|
||||
"action" : "renamebe"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"renamebe": {
|
||||
"source": "newname",
|
||||
"target": "bootthingy"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: activatebe, beadm
|
||||
|
||||
.. _Activate Boot Environment:
|
||||
|
||||
Activate Boot Environment
|
||||
=========================
|
||||
|
||||
The "activatebe" action activates the specified boot environment
|
||||
(target) so that it will be the default at next boot.
|
||||
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"target" : "bootthingy",
|
||||
"action" : "activatebe"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "beadm",
|
||||
"args" : {
|
||||
"action" : "activatebe",
|
||||
"target" : "bootthingy"
|
||||
},
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"activatebe": {
|
||||
"target": "bootthingy"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: createbe, beadm
|
||||
|
||||
.. _Create Boot Environment:
|
||||
|
||||
Create Boot Environment
|
||||
=======================
|
||||
|
||||
The "create" action creates a new boot environment. Specify the name of
|
||||
the boot environment as the "newbe". By default, this action clones the
|
||||
active boot environment. To specify another, inactive boot environment,
|
||||
also include "clonefrom" to specify which boot environment to clone from.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"action" : "createbe",
|
||||
"newbe" : "red",
|
||||
"clonefrom" : "green"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"newbe" : "red",
|
||||
"clonefrom" : "green",
|
||||
"action" : "createbe"
|
||||
},
|
||||
"namespace" : "sysadm",
|
||||
"name" : "beadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"createbe": {
|
||||
"clonefrom": "green",
|
||||
"newbe": "red"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: destroybe, beadm
|
||||
|
||||
.. _Destroy a Boot Environment:
|
||||
|
||||
Destroy a Boot Environment
|
||||
==========================
|
||||
|
||||
The "destroybe" action destroys the specified "target" boot environment
|
||||
and forcefully unmounts it.
|
||||
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"target" : "red",
|
||||
"action" : "destroybe"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "destroybe",
|
||||
"target" : "red"
|
||||
},
|
||||
"name" : "beadm",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"destroybe": {
|
||||
"target": "red"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: mountbe, beadm
|
||||
|
||||
.. _Mount a Boot Environment:
|
||||
|
||||
Mount a Boot Environment
|
||||
========================
|
||||
|
||||
The "mountbe" action mounts the specified boot environment. Use the
|
||||
optional "mountpoint" argument to specify the mount point.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"mountpoint" : "/tmp/mounteddir/",
|
||||
"action" : "mountbe",
|
||||
"be" : "green"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm",
|
||||
"name" : "beadm",
|
||||
"args" : {
|
||||
"mountpoint" : "/tmp/mounteddir/",
|
||||
"be" : "green",
|
||||
"action" : "mountbe"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"mountbe": {
|
||||
"be": "green",
|
||||
"mountpoint": "/tmp/mountdir"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: umountbe, beadm
|
||||
|
||||
.. _Unmount a Boot Environment:
|
||||
|
||||
Unmount a Boot Environment
|
||||
==========================
|
||||
|
||||
The "umountbe" action forcibly unmounts the specified boot environment,
|
||||
even if it is in use.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/beadm
|
||||
{
|
||||
"action" : "umountbe",
|
||||
"be" : "green"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "beadm",
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"be" : "green",
|
||||
"action" : "umountbe"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"umountbe": {
|
||||
"be": "green"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
134
docs/api_reference/classes/dispatcher.rst
Normal file
134
docs/api_reference/classes/dispatcher.rst
Normal file
@@ -0,0 +1,134 @@
|
||||
.. _dispatcher:
|
||||
|
||||
dispatcher
|
||||
**********
|
||||
|
||||
The dispatcher class is used to spin up external processes on demand,
|
||||
such as a user running a custom system setup script.
|
||||
|
||||
Every dispatcher class request contains the following parameters:
|
||||
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+======================================================================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| name | dispatcher | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| namespace | rpc | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "list", "kill" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: list, dispatcher
|
||||
|
||||
.. _List Processes:
|
||||
|
||||
List Processes
|
||||
==============
|
||||
|
||||
The "list" action lists all the currently running or pending processes
|
||||
within the dispatcher queues. Possible queues are "no_queue",
|
||||
"pkg_queue", and "iocage_queue".
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /rpc/dispatcher
|
||||
{
|
||||
"action" : "list"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "list"
|
||||
},
|
||||
"namespace" : "rpc",
|
||||
"name" : "dispatcher",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"jobs": {
|
||||
"pkg_queue": {
|
||||
"sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}": {
|
||||
"commands": [
|
||||
"pkg install -y --repository \"pcbsd-major\"misc/pcbsd-meta-mate"
|
||||
],
|
||||
"queue_position": "0",
|
||||
"state": "running"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "rpc"
|
||||
}
|
||||
|
||||
.. index:: kill, dispatcher
|
||||
|
||||
.. _Kill Processes:
|
||||
|
||||
Kill Processes
|
||||
==============
|
||||
|
||||
The "kill" action allows a user with full access to cancel pending or
|
||||
running jobs within the dispatcher system.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /rpc/dispatcher
|
||||
{
|
||||
"action" : "kill",
|
||||
"job_id" : "sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "kill",
|
||||
"job_id" : "sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"
|
||||
},
|
||||
"namespace" : "rpc",
|
||||
"name" : "dispatcher",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"killed": {
|
||||
"jobs": ["sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"]
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "rpc"
|
||||
}
|
||||
96
docs/api_reference/classes/fs.rst
Normal file
96
docs/api_reference/classes/fs.rst
Normal file
@@ -0,0 +1,96 @@
|
||||
.. _fs:
|
||||
|
||||
fs
|
||||
**
|
||||
|
||||
The fs class is used to manage the files and directories on the system.
|
||||
|
||||
Every fs class request contains the following parameters:
|
||||
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+======================================================================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| name | fs | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "dirlist" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: dirlist, fs
|
||||
|
||||
.. _List Directory:
|
||||
|
||||
List Directory
|
||||
==============
|
||||
|
||||
The "dirlist" action lists the contents of the specified directory.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/fs
|
||||
{
|
||||
"dir" : "/root",
|
||||
"action" : "dirlist"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"dir" : "/root",
|
||||
"action" : "dirlist"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"name" : "fs",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"dirlist": {
|
||||
"VirtualBox VMs": {
|
||||
"dir": true
|
||||
},
|
||||
"freenas-auto.iso": {
|
||||
"group": "wheel",
|
||||
"owner": "root",
|
||||
"size": 408049664
|
||||
},
|
||||
"ixbuild": {
|
||||
"dir": true
|
||||
},
|
||||
"pc-sysinstall.cfg": {
|
||||
"group": "wheel",
|
||||
"owner": "root",
|
||||
"size": 1741
|
||||
},
|
||||
"pc-sysinstall.log": {
|
||||
"group": "wheel",
|
||||
"owner": "root",
|
||||
"size": 125408
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
8
docs/api_reference/classes/index.rst
Normal file
8
docs/api_reference/classes/index.rst
Normal file
@@ -0,0 +1,8 @@
|
||||
=========
|
||||
Classes
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
|
||||
*
|
||||
1609
docs/api_reference/classes/iocage.rst
Normal file
1609
docs/api_reference/classes/iocage.rst
Normal file
File diff suppressed because it is too large
Load Diff
1047
docs/api_reference/classes/iohyve.rst
Normal file
1047
docs/api_reference/classes/iohyve.rst
Normal file
File diff suppressed because it is too large
Load Diff
1116
docs/api_reference/classes/lifepreserver.rst
Normal file
1116
docs/api_reference/classes/lifepreserver.rst
Normal file
File diff suppressed because it is too large
Load Diff
83
docs/api_reference/classes/logs.rst
Normal file
83
docs/api_reference/classes/logs.rst
Normal file
@@ -0,0 +1,83 @@
|
||||
.. _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 | rpc | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| 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 <http://doc.qt.io/qt-5/qdatetime.html#fromString>`_.
|
||||
|
||||
* **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" : {
|
||||
"<log_file_type>" : {
|
||||
"<date_time_stamp>" : "<message>",
|
||||
"<date_time_stamp2>" : "<message>"
|
||||
}
|
||||
}
|
||||
}
|
||||
99
docs/api_reference/classes/network.rst
Normal file
99
docs/api_reference/classes/network.rst
Normal file
@@ -0,0 +1,99 @@
|
||||
.. _network:
|
||||
|
||||
network
|
||||
*******
|
||||
|
||||
The network class is used to manage and retrieve information from
|
||||
Ethernet and wireless network devices.
|
||||
|
||||
Every network class request contains the following parameters:
|
||||
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+======================================================================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| name | network | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "list-devices" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: list-devices, network
|
||||
|
||||
.. _List Devices:
|
||||
|
||||
List Devices
|
||||
============
|
||||
|
||||
The "list-devices" action lists information about currently recognized
|
||||
network devices. For each network device, the response includes the
|
||||
device's MAC address, description, IPv4 address, IPv6 address, whether
|
||||
or not the device is active, whether or not the device is configured
|
||||
using DHCP, whether or not the device is wireless, its subnet mask, and
|
||||
its current status.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/network
|
||||
{
|
||||
"action" : "list-devices"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"action" : "list-devices"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"name" : "network"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"lo0": {
|
||||
"MAC": "00:00:00:00:00:00",
|
||||
"description": "",
|
||||
"ipv4": "127.0.0.1",
|
||||
"ipv6": "::1",
|
||||
"is_active": "true",
|
||||
"is_dhcp": "false",
|
||||
"is_wireless": "false",
|
||||
"netmask": "255.0.0.0",
|
||||
"status": "no carrier"
|
||||
},
|
||||
"re0": {
|
||||
"MAC": "fc:aa:14:77:a0:8d",
|
||||
"description": "RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet",
|
||||
"ipv4": "192.168.1.130",
|
||||
"ipv6": "fe80::feaa:14ff:fe77:a08d%re0",
|
||||
"is_active": "true",
|
||||
"is_dhcp": "true",
|
||||
"is_wireless": "false",
|
||||
"netmask": "255.255.255.0",
|
||||
"status": "active"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
1180
docs/api_reference/classes/pkg.rst
Normal file
1180
docs/api_reference/classes/pkg.rst
Normal file
File diff suppressed because it is too large
Load Diff
836
docs/api_reference/classes/systemmanager.rst
Normal file
836
docs/api_reference/classes/systemmanager.rst
Normal file
@@ -0,0 +1,836 @@
|
||||
.. _systemmanager:
|
||||
|
||||
systemmanager
|
||||
*************
|
||||
|
||||
The systemmanager class is used to retrieve information about the system.
|
||||
Every systemmanager class request contains the following parameters:
|
||||
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+======================================================================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| name | systemmanager | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "memorystats", "cpupercentage", "cputemps", "procinfo", "killproc", "batteryinfo", |
|
||||
| | | "externalmounts", "systemmanager", "sysctllist", "setsysctl", "halt", and "reboot" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: memorystats, systemmanager
|
||||
|
||||
.. _Memory Statistics:
|
||||
|
||||
Memory Statistics
|
||||
=================
|
||||
|
||||
The "memorystats" action returns memory statistics, including the amount
|
||||
of active, cached, free, inactive, and total physical (wired) memory.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "memorystats"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"memorystats": {
|
||||
"active": "818",
|
||||
"cache": "69",
|
||||
"free": "4855",
|
||||
"inactive": "2504",
|
||||
"wired": "1598"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "memorystats"
|
||||
},
|
||||
"namespace" : "sysadm",
|
||||
"name" : "systemmanager"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"memorystats": {
|
||||
"active": "826",
|
||||
"cache": "69",
|
||||
"free": "4847",
|
||||
"inactive": "2505",
|
||||
"wired": "1598"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: cpupercentage, systemmanager
|
||||
|
||||
.. _CPU Usage:
|
||||
|
||||
CPU Usage
|
||||
=========
|
||||
|
||||
The "cpupercentage" action returns the usage percentage of each CPU.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "cpupercentage"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"cpupercentage": {
|
||||
"busytotal": "28",
|
||||
"cpu1": {
|
||||
"busy": "28"
|
||||
},
|
||||
"cpu2": {
|
||||
"busy": "31"
|
||||
},
|
||||
"cpu3": {
|
||||
"busy": "29"
|
||||
},
|
||||
"cpu4": {
|
||||
"busy": "24"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "cpupercentage"
|
||||
},
|
||||
"name" : "systemmanager",
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"cpupercentage": {
|
||||
"busytotal": "28",
|
||||
"cpu1": {
|
||||
"busy": "28"
|
||||
},
|
||||
"cpu2": {
|
||||
"busy": "31"
|
||||
},
|
||||
"cpu3": {
|
||||
"busy": "29"
|
||||
},
|
||||
"cpu4": {
|
||||
"busy": "24"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: cputemps, systemmanager
|
||||
|
||||
.. _CPU Temperature:
|
||||
|
||||
CPU Temperature
|
||||
===============
|
||||
|
||||
The "cputemps" action returns the temperature of each CPU.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "cputemps"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"cputemps": {
|
||||
"cpu0": "27.0C",
|
||||
"cpu1": "34.0C",
|
||||
"cpu2": "33.0C",
|
||||
"cpu3": "31.0C"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "cputemps"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"cputemps": {
|
||||
"cpu0": "34.0C",
|
||||
"cpu1": "32.0C",
|
||||
"cpu2": "34.0C",
|
||||
"cpu3": "31.0C"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: procinfo, systemmanager
|
||||
|
||||
.. _Process Information:
|
||||
|
||||
Process Information
|
||||
===================
|
||||
|
||||
The "procinfo" action lists information about each running process.
|
||||
Since a system will have many running processes, the responses in this
|
||||
section only show one process as an example of the type of information
|
||||
listed by this action.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "procinfo"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"procinfo": {
|
||||
"228": {
|
||||
"command": "adjkerntz",
|
||||
"cpu": "3",
|
||||
"nice": "0",
|
||||
"pri": "52",
|
||||
"res": "1968K",
|
||||
"size": "8276K",
|
||||
"state": "pause",
|
||||
"thr": "1",
|
||||
"time": "0:00",
|
||||
"username": "root",
|
||||
"wcpu": "0.00%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm",
|
||||
"name" : "systemmanager",
|
||||
"args" : {
|
||||
"action" : "procinfo"
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"procinfo": {
|
||||
"228": {
|
||||
"command": "adjkerntz",
|
||||
"cpu": "3",
|
||||
"nice": "0",
|
||||
"pri": "52",
|
||||
"res": "1968K",
|
||||
"size": "8276K",
|
||||
"state": "pause",
|
||||
"thr": "1",
|
||||
"time": "0:00",
|
||||
"username": "root",
|
||||
"wcpu": "0.00%"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: killproc, systemmanager
|
||||
|
||||
.. _Kill a Process:
|
||||
|
||||
Kill a Process
|
||||
==============
|
||||
|
||||
The "killproc" action can be used to send the specified signal to the
|
||||
specified Process ID (PID). The following signals are supported: INT,
|
||||
QUIT, ABRT, KILL, ALRM, or TERM.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"signal" : "KILL",
|
||||
"pid" : "13939",
|
||||
"action" : "killproc"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"killproc": {
|
||||
"action": "killproc",
|
||||
"pid": "13939",
|
||||
"signal": "KILL"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"pid" : "13939",
|
||||
"action" : "killproc",
|
||||
"signal" : "KILL"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"name" : "systemmanager"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"killproc": {
|
||||
"action": "killproc",
|
||||
"pid": "13939",
|
||||
"signal": "KILL"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: batteryinfo, systemmanager
|
||||
|
||||
.. _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**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "batteryinfo"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"batteryinfo": {
|
||||
"battery": "false"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"name" : "systemmanager",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "batteryinfo"
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"batteryinfo": {
|
||||
"battery": "false"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: externalmounts, systemmanager
|
||||
|
||||
.. _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**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"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" : "systemmanager",
|
||||
"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"
|
||||
}
|
||||
|
||||
.. index:: systemmanager
|
||||
|
||||
.. _System Information:
|
||||
|
||||
System Information
|
||||
==================
|
||||
|
||||
The "systemmanager" action lists system information, including the
|
||||
architecture, number of CPUs, type of CPU, hostname, kernel name and
|
||||
version, system version and patch level, total amount of RAM, and the
|
||||
system's uptime.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "systemmanager"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"systemmanager": {
|
||||
"arch": "amd64",
|
||||
"cpucores": "4",
|
||||
"cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
|
||||
"hostname": "krisdesktop",
|
||||
"kernelident": "GENERIC",
|
||||
"kernelversion": "10.2-RELEASE-p11",
|
||||
"systemversion": "10.2-RELEASE-p12",
|
||||
"totalmem": 10720,
|
||||
"uptime": "up 2 days 5:09"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "systemmanager"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"systemmanager": {
|
||||
"arch": "amd64",
|
||||
"cpucores": "4",
|
||||
"cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
|
||||
"hostname": "krisdesktop",
|
||||
"kernelident": "GENERIC",
|
||||
"kernelversion": "10.2-RELEASE-p11",
|
||||
"systemversion": "10.2-RELEASE-p12",
|
||||
"totalmem": 10720,
|
||||
"uptime": "up 2 days 5:09"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: sysctllist, systemmanager
|
||||
|
||||
.. _List Sysctls:
|
||||
|
||||
List Sysctls
|
||||
============
|
||||
|
||||
The "sysctllist" action lists returns the list of all setable sysctl
|
||||
values. Since there are many, the example responses in this section have
|
||||
been truncated to just show a few.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "sysctllist"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"sysctllist": {
|
||||
"compat.ia32.maxdsiz": "536870912",
|
||||
"compat.ia32.maxssiz": "67108864",
|
||||
"compat.ia32.maxvmem": "0",
|
||||
"compat.linux.osname": "Linux",
|
||||
"compat.linux.osrelease": "2.6.18",
|
||||
"compat.linux.oss_version": "198144",
|
||||
"compat.linux32.maxdsiz": "536870912",
|
||||
"compat.linux32.maxssiz": "67108864",
|
||||
"compat.linux32.maxvmem": "0",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "sysctllist"
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"sysctllist": {
|
||||
"compat.ia32.maxdsiz": "536870912",
|
||||
"compat.ia32.maxssiz": "67108864",
|
||||
"compat.ia32.maxvmem": "0",
|
||||
"compat.linux.osname": "Linux",
|
||||
"compat.linux.osrelease": "2.6.18",
|
||||
"compat.linux.oss_version": "198144",
|
||||
"compat.linux32.maxdsiz": "536870912",
|
||||
"compat.linux32.maxssiz": "67108864",
|
||||
"compat.linux32.maxvmem": "0",
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: setsysctl, systemmanager
|
||||
|
||||
.. _Set a Sysctl:
|
||||
|
||||
Set a Sysctl
|
||||
============
|
||||
|
||||
The "setsysctl" action sets the specified setable sysctl to the
|
||||
specified value. The response indicates that the old value was changed
|
||||
to the new value.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"value" : "0",
|
||||
"sysctl" : "security.jail.mount_devfs_allowed",
|
||||
"action" : "setsysctl"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"setsysctl": {
|
||||
"response": "security.jail.mount_devfs_allowed: 1 -> 0",
|
||||
"sysctl": "security.jail.mount_devfs_allowed",
|
||||
"value": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"value" : "0",
|
||||
"action" : "setsysctl",
|
||||
"sysctl" : "security.jail.mount_devfs_allowed"
|
||||
},
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"setsysctl": {
|
||||
"response": "security.jail.mount_devfs_allowed: 1 -> 0",
|
||||
"sysctl": "security.jail.mount_devfs_allowed",
|
||||
"value": "0"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: halt, systemmanager
|
||||
|
||||
.. _Halt the System:
|
||||
|
||||
Halt the System
|
||||
===============
|
||||
|
||||
The "halt" action shuts down the system.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "halt"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "halt"
|
||||
},
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"halt": {
|
||||
"response": "true"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: reboot, systemmanager
|
||||
|
||||
.. _Reboot the System:
|
||||
|
||||
Reboot the System
|
||||
=================
|
||||
|
||||
The "reboot" action reboots the system.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/systemmanager
|
||||
{
|
||||
"action" : "reboot"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "reboot"
|
||||
},
|
||||
"name" : "systemmanager",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"reboot": {
|
||||
"response": "true"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
389
docs/api_reference/classes/updates.rst
Normal file
389
docs/api_reference/classes/updates.rst
Normal file
@@ -0,0 +1,389 @@
|
||||
.. _update:
|
||||
|
||||
update
|
||||
******
|
||||
|
||||
The update class is used to check for and manage system and software
|
||||
updates.
|
||||
|
||||
Every update class request contains the following parameters:
|
||||
|
||||
+----------------+------------+---------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+================+============+=======================================+
|
||||
| id | | any unique value for the request; |
|
||||
| | | examples include a hash, checksum, or |
|
||||
| | | uuid |
|
||||
+----------------+------------+---------------------------------------+
|
||||
| name | update | |
|
||||
| | | |
|
||||
+----------------+------------+---------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+----------------+------------+---------------------------------------+
|
||||
| action | | supported actions include |
|
||||
| | | "changesettings", "checkupdates", |
|
||||
| | | "listbranches", "listsettings", |
|
||||
| | | "startupdate", "stopupdate" |
|
||||
+----------------+------------+---------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: changesettings, update
|
||||
|
||||
.. _Change Settings:
|
||||
|
||||
Change Settings
|
||||
===============
|
||||
|
||||
Use :command:`changesettings` to change the various updatemanager
|
||||
settings (maxbe, package_set, package_url, auto_update).
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/update
|
||||
{
|
||||
"action" : "changesettings",
|
||||
"maxbe" : "6"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"name" : "update",
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"maxbe" : "6",
|
||||
"action" : "changesettings"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"changesettings": {
|
||||
"result": "success"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: checkupdates, update
|
||||
|
||||
.. _Check for Updates:
|
||||
|
||||
Check for Updates
|
||||
=================
|
||||
|
||||
The "checkupdates" action queries the update server to see if any
|
||||
updates are available. If an update is available, the response will
|
||||
indicate if it is a system security update, an upgrade to a newer
|
||||
version of the operating system, a system patch, or an update to
|
||||
installed software packages.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/update
|
||||
{
|
||||
"action" : "checkupdates"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"last_check" : "<ISO date/time stamp>",
|
||||
"checkupdates": {
|
||||
"status": "noupdates"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "update",
|
||||
"args" : {
|
||||
"action" : "checkupdates",
|
||||
"force":"[true/false]"
|
||||
},
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"last_check" : "<ISO date/time stamp>",
|
||||
"checkupdates": {
|
||||
"status": "noupdates"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: listbranches, update
|
||||
|
||||
.. _List Branches:
|
||||
|
||||
List Branches
|
||||
=============
|
||||
|
||||
The "listbranches" action retrieves the list of available branches
|
||||
(operating system versions). The currently installed version will be
|
||||
listed as "active".
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/update
|
||||
{
|
||||
"action" : "listbranches"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"listbranches": {
|
||||
"10.2-RELEASE": "active",
|
||||
"11.0-CURRENTJAN2016": "available"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "listbranches"
|
||||
},
|
||||
"namespace" : "sysadm",
|
||||
"name" : "update",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"listbranches": {
|
||||
"10.2-RELEASE": "active",
|
||||
"11.0-CURRENTJAN2016": "available"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: listsettings, update
|
||||
|
||||
.. _List Settings:
|
||||
|
||||
List Settings
|
||||
=============
|
||||
|
||||
:command:`listsettings` shows all of the current settings.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/update
|
||||
{
|
||||
"action" : "listsettings"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "listsettings"
|
||||
},
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm",
|
||||
"name" : "update"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"listsettings": {
|
||||
"maxbe": " 5",
|
||||
"package_set": " EDGE"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: startupdate, update
|
||||
|
||||
.. _Start Updates:
|
||||
|
||||
Start Updates
|
||||
=============
|
||||
|
||||
The "startupdate" action starts the specified update. You must specify a
|
||||
"target" to indicate the type of update to perform. The available
|
||||
targets are:
|
||||
|
||||
* **chbranch:** will update to the specified "branch" (operating system
|
||||
version). You can determine which branches are available by using the
|
||||
"listbranches" action.
|
||||
|
||||
* **pkgupdate:** only update installed software.
|
||||
|
||||
* **standalone:** only apply the update specified as a "tag". Use the
|
||||
"checkupdates" action to determine the name (tag) of the update to
|
||||
specify.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/update
|
||||
{
|
||||
"action" : "startupdate",
|
||||
"target" : "pkgupdate"
|
||||
}
|
||||
|
||||
**REST Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"startupdate": {
|
||||
"queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
|
||||
"command": "pc-updatemanager pkgupdate",
|
||||
"comment": "Task Queued"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args" : {
|
||||
"action" : "startupdate",
|
||||
"target" : "pkgupdate"
|
||||
},
|
||||
"name" : "update",
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**WebSocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"startupdate": {
|
||||
"queueid": "611c89ae-c43c-11e5-9602-54ee75595566",
|
||||
"command": "pc-updatemanager pkgupdate",
|
||||
"comment": "Task Queued"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
**Dispatcher Events System Reply**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "events",
|
||||
"name" : "dispatcher",
|
||||
"id" : "none",
|
||||
"args" : {
|
||||
"event_system" : "sysadm/update",
|
||||
"state" : "finished",
|
||||
"update_log" : "<update log>",
|
||||
"process_details" : {
|
||||
"time_finished" : "<ISO 8601 time date string>",
|
||||
"cmd_list" : ["<command 1>", "<command 2>"],
|
||||
"return_codes/<command 1>" : "<code 1>",
|
||||
"return_codes/<command 2>" : "<code 2>",
|
||||
"process_id" : "<random>",
|
||||
"state" : "finished"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.. index:: stopupdate, update
|
||||
|
||||
.. _Stop Updates:
|
||||
|
||||
Stop Updates
|
||||
============
|
||||
|
||||
This will look for any currently-running pc-updatemanager processes
|
||||
and kill/stop them as needed.
|
||||
|
||||
**Websocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id":"dummy",
|
||||
"namespace":"sysadm",
|
||||
"name":"update",
|
||||
"args": {
|
||||
"action":"stopupdate"
|
||||
}
|
||||
}
|
||||
|
||||
**Websocket Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args":{
|
||||
"stopupdate": {
|
||||
"result": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
556
docs/api_reference/classes/users.rst
Normal file
556
docs/api_reference/classes/users.rst
Normal file
@@ -0,0 +1,556 @@
|
||||
.. _users:
|
||||
|
||||
users
|
||||
*****
|
||||
|
||||
The users class is used to manage users and groups on the system.
|
||||
Every user request will have several parameters:
|
||||
|
||||
+----------------+------------+----------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+================+============+========================================+
|
||||
| id | | any unique value for the request; |
|
||||
| | | examples include a hash, checksum, |
|
||||
| | | or uuid |
|
||||
+----------------+------------+----------------------------------------+
|
||||
| name | users | |
|
||||
| | | |
|
||||
+----------------+------------+----------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+----------------+------------+----------------------------------------+
|
||||
| action | | "groupadd", "groupdelete", "groupmod", |
|
||||
| | | "groupshow", "personacrypt_listdevs", |
|
||||
| | | "useradd", "userdelete", "usermod", |
|
||||
| | | "usershow" |
|
||||
+----------------+------------+----------------------------------------+
|
||||
|
||||
.. index:: groupadd, users
|
||||
|
||||
.. _groupadd:
|
||||
|
||||
Group Add
|
||||
=========
|
||||
|
||||
:command:`groupadd` will create a new group on the system. The "name"
|
||||
field is required, the "gid" and "users" fields are optional.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
{
|
||||
"action" : "groupadd",
|
||||
"name" : "testgroup"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"action" : "groupadd",
|
||||
"name" : "testgroup"
|
||||
},
|
||||
"name" : "users"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: groupdelete, users
|
||||
|
||||
.. _groupdelete:
|
||||
|
||||
Group Delete
|
||||
============
|
||||
|
||||
:command:`groupdelete` deletes the designated group.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
{
|
||||
"action" : "groupdelete",
|
||||
"name" : "groupToDelete"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"action" : "groupdelete",
|
||||
"name" : "<groupToDelete>"
|
||||
},
|
||||
"name" : "users"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: groupmod, users
|
||||
|
||||
.. _groupmod:
|
||||
|
||||
Group Modify
|
||||
============
|
||||
|
||||
:command:`goupmod` modifies a given group on the system. There are two
|
||||
required fields: "name": "<desired group>", and any **one** of three
|
||||
choices:
|
||||
|
||||
* "users": ["<array of users>"] (will set the list of users for this
|
||||
group).
|
||||
* "add_users": ["<array of users>"] (will add the listed users to the
|
||||
current users).
|
||||
* "remove_users": ["<array of users>"] (will remove the listed users
|
||||
from the current users).
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT sysadm/users
|
||||
|
||||
{
|
||||
"action": "groupmod"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id":"sample",
|
||||
"namespace":"sysadm",
|
||||
"name":"users",
|
||||
"args":{
|
||||
"action":"groupmod",
|
||||
"name":"operator",
|
||||
"users":["user1","user2"]
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: groupshow, users
|
||||
|
||||
.. _groupshow:
|
||||
|
||||
Group Show
|
||||
==========
|
||||
|
||||
The action :command:`groupshow` lists all the known groups on the
|
||||
system and any users associated with them (if all access) or which
|
||||
ones the current user is in (if limited access).
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"action" : "groupshow"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"name" : "users",
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"action" : "groupshow"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"_dhcp": {
|
||||
"gid": "65",
|
||||
"name": "_dhcp",
|
||||
"users": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"_ntp": {
|
||||
"gid": "123",
|
||||
"name": "_ntp",
|
||||
"users": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"_pflogd": {
|
||||
"gid": "64",
|
||||
"name": "_pflogd",
|
||||
"users": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"_tss": {
|
||||
"gid": "601",
|
||||
"name": "_tss",
|
||||
"users": [
|
||||
""
|
||||
]
|
||||
},
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: personacryptlistdevs, users
|
||||
|
||||
.. _personacryptlistdevs:
|
||||
|
||||
Personacrypt List Devices
|
||||
=========================
|
||||
|
||||
:command:`personacrypt_listdevs` will run personacrypt and return any
|
||||
removeable devices which may be used as PC devices.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"action" : "personacrypt_listdevs"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"name" : "users",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "personacrypt_listdevs"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"da0": "<SanDisk Cruzer 1.26> 7.5G"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: useradd, users
|
||||
|
||||
.. _useradd:
|
||||
|
||||
User Add
|
||||
========
|
||||
|
||||
The `useradd` action will add a new user account on the system. There
|
||||
are a number of required and optional fields to add to the initial
|
||||
request:
|
||||
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| **Name** | **Required/** | **Description** |
|
||||
| | **Optional** | |
|
||||
+===============+================+====================================================+
|
||||
| change | Optional | Sets a time for the password to expire on the new |
|
||||
| | | account. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| class | Optional | Sets the login class for the user being created. |
|
||||
| | | |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| comment | Optional | This field sets the contents of the psswd GECOS |
|
||||
| | | field, which normally contains up to four |
|
||||
| | | comma-separated fields containing the user's full |
|
||||
| | | name, location, and work and home phone numbers. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| expire | Optional | Sets account expiration date, formatted as either |
|
||||
| | | a UNIX time in decimal or a date in 'dd-mmm-yyyy' |
|
||||
| | | format. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| group | Optional | Sets the account's primary group to the given |
|
||||
| | | group, either by name or group number. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| home_dir | Optional | Sets the account's home directory. |
|
||||
| | | |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| name/user id | Required | A unique string of characters which identifies the |
|
||||
| (uid) | | new user. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| other_groups | Optional | Sets secondary group memberships for an account. |
|
||||
| | | |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| password | Required | Locks the user account unless a unique string of |
|
||||
| | | characters is typed into the system first. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
| shell | Optional | Configure the user's login to a shell program. |
|
||||
| | | The full path to the shell program is required. |
|
||||
+---------------+----------------+----------------------------------------------------+
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"password" : "test",
|
||||
"name" : "test2",
|
||||
"action" : "useradd"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "users",
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"password" : "test",
|
||||
"name" : "test2",
|
||||
"action" : "useradd"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: userdelete, users
|
||||
|
||||
.. _userdelete:
|
||||
|
||||
User Delete
|
||||
===========
|
||||
|
||||
The :command:`userdelete` action will remove a user account from the
|
||||
system. The request requires a "name" field with the desired username
|
||||
value. The optional "clean_home" field will remove the user's home
|
||||
directory and all files within it. Its default value is "true".
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"name" : "test",
|
||||
"action" : "userdelete"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"id" : "fooid",
|
||||
"name" : "users",
|
||||
"args" : {
|
||||
"action" : "userdelete",
|
||||
"name" : "test"
|
||||
},
|
||||
"namespace" : "sysadm"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: usermod, users
|
||||
|
||||
.. _usermod:
|
||||
|
||||
User Mod
|
||||
========
|
||||
|
||||
The :command:`usermod` action is similar to the :command:`useradd`
|
||||
action, but performs changes to an existing user only. A user with
|
||||
limited access may modify their own account settings with this command,
|
||||
but no other user's settings. The field "newname" can also be added to
|
||||
the request to alter the existing user name.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"action" : "usermod",
|
||||
"comment" : "somecomment",
|
||||
"name" : "test2"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name" : "users",
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"name" : "test2",
|
||||
"comment" : "somecomment",
|
||||
"action" : "usermod"
|
||||
},
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"result": "success"
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: usershow, users
|
||||
|
||||
.. _usershow:
|
||||
|
||||
User Show
|
||||
=========
|
||||
|
||||
:command:`usershow` will display all user accounts registered on the
|
||||
system, regardless of active/inactive status.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/users
|
||||
|
||||
{
|
||||
"action" : "usershow"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"name" : "users",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "usershow"
|
||||
}
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"_dhcp": {
|
||||
"canremove": "false",
|
||||
"change": "0",
|
||||
"class": "",
|
||||
"comment": "dhcp programs",
|
||||
"expire": "0",
|
||||
"gid": "65",
|
||||
"home_dir": "/var/empty",
|
||||
"name": "_dhcp",
|
||||
"shell": "/usr/sbin/nologin",
|
||||
"uid": "65"
|
||||
},
|
||||
"_ntp": {
|
||||
"change": "0",
|
||||
"class": "",
|
||||
"comment": "NTP Daemon",
|
||||
"expire": "0",
|
||||
"gid": "123",
|
||||
"home_dir": "/var/empty",
|
||||
"name": "_ntp",
|
||||
"shell": "/usr/sbin/nologin",
|
||||
"uid": "123"
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
360
docs/api_reference/classes/zfs.rst
Normal file
360
docs/api_reference/classes/zfs.rst
Normal file
@@ -0,0 +1,360 @@
|
||||
.. _zfs:
|
||||
|
||||
zfs
|
||||
***
|
||||
|
||||
The zfs class is used to manage and retrieve information about ZFS pools.
|
||||
|
||||
Every zfs class request contains the following parameters:
|
||||
|
||||
+---------------------------------+---------------+------------------------------------------------------------------------------+
|
||||
| **Parameter** | **Value** | **Description** |
|
||||
| | | |
|
||||
+=================================+===============+==============================================================================+
|
||||
| id | | any unique value for the request; examples include a hash, checksum, or uuid |
|
||||
| | | |
|
||||
+---------------------------------+---------------+------------------------------------------------------------------------------+
|
||||
| name | zfs | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+------------------------------------------------------------------------------+
|
||||
| namespace | sysadm | |
|
||||
| | | |
|
||||
+---------------------------------+---------------+------------------------------------------------------------------------------+
|
||||
| action | | supported actions include "list_pools", "datasets" |
|
||||
| | | |
|
||||
+---------------------------------+---------------+------------------------------------------------------------------------------+
|
||||
|
||||
The rest of this section provides examples of the available *actions*
|
||||
for each type of request, along with their responses.
|
||||
|
||||
.. index:: list_pools, zfs
|
||||
|
||||
.. _List Pools:
|
||||
|
||||
List Pools
|
||||
==========
|
||||
|
||||
The "list_pools" action lists pool information. For each ZFS pool, the
|
||||
response includes the pool name, the amount of space that has been
|
||||
physically allocated, whether or not an alternate root has been defined,
|
||||
capacity (percent used), the deduplication ratio, amount of
|
||||
uninitialized space (expandsz, which usually applies to LUNs),
|
||||
percentage of fragmentation, amount of free space, pool health, and
|
||||
total size. This action is the equivalent of running
|
||||
:command:`zpool list` from the command line.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/zfs
|
||||
{
|
||||
"action" : "list_pools"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"args" : {
|
||||
"action" : "list_pools"
|
||||
},
|
||||
"name" : "zfs",
|
||||
"id" : "fooid"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"list_pools" : {
|
||||
"tank": {
|
||||
"alloc": "71.8G",
|
||||
"altroot": "-",
|
||||
"cap": "32%",
|
||||
"dedup": "1.00x",
|
||||
"expandsz": "-",
|
||||
"frag": "18%",
|
||||
"free": "148G",
|
||||
"health": "ONLINE",
|
||||
"size": "220G"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
|
||||
.. index:: datasets, zfs
|
||||
|
||||
.. _List Datasets:
|
||||
|
||||
List Datasets
|
||||
=============
|
||||
|
||||
The "datasets" action lists the ZFS datasets on the specified pool.
|
||||
|
||||
**REST Request**
|
||||
|
||||
::
|
||||
|
||||
PUT /sysadm/zfs
|
||||
{
|
||||
"action" : "datasets",
|
||||
"zpool" : "tank"
|
||||
}
|
||||
|
||||
**WebSocket Request**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"namespace" : "sysadm",
|
||||
"id" : "fooid",
|
||||
"args" : {
|
||||
"action" : "datasets",
|
||||
"zpool" : "tank"
|
||||
},
|
||||
"name" : "zfs"
|
||||
}
|
||||
|
||||
**Response**
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"args": {
|
||||
"datasets": {
|
||||
"tank": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "none",
|
||||
"refer": "96K",
|
||||
"used": "125G"
|
||||
},
|
||||
"tank/ROOT": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "none",
|
||||
"refer": "96K",
|
||||
"used": "63.7G"
|
||||
},
|
||||
"tank/ROOT/11.0-CURRENTAPRIL2016-up-20160418_124146": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/",
|
||||
"refer": "34.7G",
|
||||
"used": "63.7G"
|
||||
},
|
||||
"tank/ROOT/11.0-CURRENTFEB2016-up-20160303_094216": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/",
|
||||
"refer": "29.7G",
|
||||
"used": "272K"
|
||||
},
|
||||
"tank/ROOT/11.0-CURRENTMAR2016-up-20160304_102405": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/",
|
||||
"refer": "30.5G",
|
||||
"used": "248K"
|
||||
},
|
||||
"tank/ROOT/11.0-CURRENTMAR2016-up-20160315_092952": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/",
|
||||
"refer": "31.2G",
|
||||
"used": "256K"
|
||||
},
|
||||
"tank/ROOT/11.0-CURRENTMAR2016-up-20160318_090405": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/",
|
||||
"refer": "34.7G",
|
||||
"used": "280K"
|
||||
},
|
||||
"tank/ROOT/initial": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/mnt",
|
||||
"refer": "5.60G",
|
||||
"used": "232K"
|
||||
},
|
||||
"tank/iocage": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage",
|
||||
"refer": "152K",
|
||||
"used": "1.13G"
|
||||
},
|
||||
"tank/iocage/.defaults": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/.defaults",
|
||||
"refer": "96K",
|
||||
"used": "992K"
|
||||
},
|
||||
"tank/iocage/download": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/download",
|
||||
"refer": "96K",
|
||||
"used": "203M"
|
||||
},
|
||||
"tank/iocage/download/10.2-RELEASE": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/download/10.2-RELEASE",
|
||||
"refer": "202M",
|
||||
"used": "202M"
|
||||
},
|
||||
"tank/iocage/jails": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/jails",
|
||||
"refer": "104K",
|
||||
"used": "1000K"
|
||||
},
|
||||
"tank/iocage/releases": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/releases",
|
||||
"refer": "96K",
|
||||
"used": "953M"
|
||||
},
|
||||
"tank/iocage/releases/10.2-RELEASE": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/releases/10.2-RELEASE",
|
||||
"refer": "96K",
|
||||
"used": "952M"
|
||||
},
|
||||
"tank/iocage/releases/10.2-RELEASE/root": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/releases/10.2-RELEASE/root",
|
||||
"refer": "825M",
|
||||
"used": "951M"
|
||||
},
|
||||
"tank/iocage/templates": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iocage/templates",
|
||||
"refer": "96K",
|
||||
"used": "992K"
|
||||
},
|
||||
"tank/iohyve": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve",
|
||||
"refer": "96K",
|
||||
"used": "22.8G"
|
||||
},
|
||||
"tank/iohyve/Firmware": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve/Firmware",
|
||||
"refer": "96K",
|
||||
"used": "992K"
|
||||
},
|
||||
"tank/iohyve/ISO": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve/ISO",
|
||||
"refer": "96K",
|
||||
"used": "453M"
|
||||
},
|
||||
"tank/iohyve/ISO/FreeBSD-10.1-RELEASE-amd64-bootonly.iso": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve/ISO/FreeBSD-10.1-RELEASE-amd64-bootonly.iso",
|
||||
"refer": "219M",
|
||||
"used": "220M"
|
||||
},
|
||||
"tank/iohyve/ISO/FreeBSD-10.2-RELEASE-amd64-bootonly.iso": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve/ISO/FreeBSD-10.2-RELEASE-amd64-bootonly.iso",
|
||||
"refer": "231M",
|
||||
"used": "232M"
|
||||
},
|
||||
"tank/iohyve/bsdguest": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/iohyve/bsdguest",
|
||||
"refer": "96K",
|
||||
"used": "22.4G"
|
||||
},
|
||||
"tank/iohyve/bsdguest/disk0": {
|
||||
"avail": "341G",
|
||||
"mountpoint": "-",
|
||||
"refer": "1.75G",
|
||||
"used": "22.4G"
|
||||
},
|
||||
"tank/tmp": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/tmp",
|
||||
"refer": "2.95M",
|
||||
"used": "18.3M"
|
||||
},
|
||||
"tank/usr": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "none",
|
||||
"refer": "96K",
|
||||
"used": "37.5G"
|
||||
},
|
||||
"tank/usr/home": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/home",
|
||||
"refer": "96K",
|
||||
"used": "27.8G"
|
||||
},
|
||||
"tank/usr/home/kris": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/home/kris",
|
||||
"refer": "21.9G",
|
||||
"used": "27.8G"
|
||||
},
|
||||
"tank/usr/jails": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/jails",
|
||||
"refer": "96K",
|
||||
"used": "992K"
|
||||
},
|
||||
"tank/usr/obj": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/obj",
|
||||
"refer": "4.68G",
|
||||
"used": "4.75G"
|
||||
},
|
||||
"tank/usr/ports": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/ports",
|
||||
"refer": "2.20G",
|
||||
"used": "2.96G"
|
||||
},
|
||||
"tank/usr/src": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/usr/src",
|
||||
"refer": "1.82G",
|
||||
"used": "2.01G"
|
||||
},
|
||||
"tank/var": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "none",
|
||||
"refer": "96K",
|
||||
"used": "13.5M"
|
||||
},
|
||||
"tank/var/audit": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/var/audit",
|
||||
"refer": "96K",
|
||||
"used": "992K"
|
||||
},
|
||||
"tank/var/log": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/var/log",
|
||||
"refer": "1.43M",
|
||||
"used": "5.21M"
|
||||
},
|
||||
"tank/var/mail": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/var/mail",
|
||||
"refer": "120K",
|
||||
"used": "1.21M"
|
||||
},
|
||||
"tank/var/tmp": {
|
||||
"avail": "320G",
|
||||
"mountpoint": "/var/tmp",
|
||||
"refer": "3.20M",
|
||||
"used": "5.99M"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "fooid",
|
||||
"name": "response",
|
||||
"namespace": "sysadm"
|
||||
}
|
||||
Reference in New Issue
Block a user