From 2776a69095958d3217112ddec3467090d248a033 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Thu, 11 Feb 2016 11:44:01 -0500 Subject: [PATCH 1/5] Doc createjail action. --- api/classes/iocage.rst | 106 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/api/classes/iocage.rst b/api/classes/iocage.rst index 6e211ac..ea4af6f 100644 --- a/api/classes/iocage.rst +++ b/api/classes/iocage.rst @@ -21,8 +21,8 @@ Every iocage class request contains the following parameters: | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ | action | | supported actions include "getdefaultsettings", "listjails", "getjailsettings", "startjail", "stopjail", | -| | | "capjail", "clonejail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", "activatepool", and | -| | | "deactivatepool" | +| | | "capjail", "clonejail", "createjail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", "activatepool", | +| | | and "deactivatepool" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -942,6 +942,108 @@ In this example, no properties are specified so iocage populates its own values "namespace": "sysadm" } +.. index:: createjail, iocage + +.. _Create a Jail: + +Create a Jail +============= + +The "createjail" action creates a jail. + +In this example, the "tag" property sets the name of the new jail and the "release" property specifies which template to use. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/iocage + { + "action" : "createjail", + "props" : "tag=test release=10.2-RELEASE" + } + +**WebSocket Request** + +.. code-block:: json + + { + "args" : { + "props" : "tag=test release=10.2-RELEASE", + "action" : "createjail" + }, + "namespace" : "sysadm", + "name" : "iocage", + "id" : "fooid" + } + +**Response** + +.. code-block:: json + + { + "args": { + "createjail": { + "props": "tag=test release=10.2-RELEASE", + "success": { + "Successfully created": " 3030c554-d05e-11e5-8209-d05099728dbf (test)" + }, + "switches": "" + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + +In this example, the **-e** switch, which creates an empty jail, is specified using "switches". Refer to `iocage(8) `_ for the list +of available switches. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/iocage + { + "switches" : "-e", + "action" : "createjail", + "props" : "tag=emptytest" + } + +**WebSocket Request** + +.. code-block:: json + + { + "namespace" : "sysadm", + "args" : { + "props" : "tag=emptytest", + "action" : "createjail", + "switches" : "-e" + }, + "name" : "iocage", + "id" : "fooid" + } + +**Response** + +.. code-block:: json + + { + "args": { + "createjail": { + "props": "tag=emptytest", + "success": { + "uuid": "1325b8bc-d05e-11e5-8209-d05099728dbf" + }, + "switches": "-e" + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. index:: cleanjails, iocage .. _Clean Jails: From 231fb7e04409def6719d8ba753eb4342fb42a647 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Thu, 11 Feb 2016 11:58:39 -0500 Subject: [PATCH 2/5] Doc destroyjail action. --- api/classes/iocage.rst | 54 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/api/classes/iocage.rst b/api/classes/iocage.rst index ea4af6f..2ae47bb 100644 --- a/api/classes/iocage.rst +++ b/api/classes/iocage.rst @@ -21,8 +21,8 @@ Every iocage class request contains the following parameters: | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ | action | | supported actions include "getdefaultsettings", "listjails", "getjailsettings", "startjail", "stopjail", | -| | | "capjail", "clonejail", "createjail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", "activatepool", | -| | | and "deactivatepool" | +| | | "capjail", "clonejail", "createjail", "destroyjail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", | +| | | "activatepool", and "deactivatepool" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -1044,6 +1044,56 @@ of available switches. "namespace": "sysadm" } + .. index:: destroyjail, iocage + +.. _Destroy a Jail: + +Destroy a Jail +============== + +The "destroyjail" action destroys the specified jail. This action is irreversible and does not prompt for confirmation, but will fail if the jail is running. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/iocage + { + "action" : "destroyjail", + "jail" : "test" + } + +**WebSocket Request** + +.. code-block:: json + + { + "args" : { + "action" : "destroyjail", + "jail" : "test" + }, + "name" : "iocage", + "id" : "fooid", + "namespace" : "sysadm" + } + +**Response** + +.. code-block:: json + + { + "args": { + "destroyjail": { + "success": { + "Destroying": " 3030c554-d05e-11e5-8209-d05099728dbf" + } + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. index:: cleanjails, iocage .. _Clean Jails: From 37b55c6f8fd3b19fddf0cc45233a5cb007116995 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Thu, 11 Feb 2016 12:06:36 -0500 Subject: [PATCH 3/5] Doc df action. --- api/classes/iocage.rst | 64 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/api/classes/iocage.rst b/api/classes/iocage.rst index 2ae47bb..3c750a9 100644 --- a/api/classes/iocage.rst +++ b/api/classes/iocage.rst @@ -20,7 +20,7 @@ Every iocage class request contains the following parameters: | namespace | sysadm | | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ -| action | | supported actions include "getdefaultsettings", "listjails", "getjailsettings", "startjail", "stopjail", | +| action | | supported actions include "getdefaultsettings", "listjails", "getjailsettings", "df", "startjail", "stopjail", | | | | "capjail", "clonejail", "createjail", "destroyjail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", | | | | "activatepool", and "deactivatepool" | | | | | @@ -653,6 +653,68 @@ The "getjailsettings" action lists all of the settings that apply to the specifi "namespace": "sysadm" } +.. index:: df, iocage + +.. _List Resource Usage: + +List Resource Usage +=================== + +The "df" action lists resource usage for all jails. For each jail, the response includes: CRT (compression ratio), RES (reserved space), QTA (disk quota), USE (used space), AVA (available +space), and TAG (jail name). + +**REST Request** + +.. code-block:: json + + PUT /sysadm/iocage + { + "action" : "df" + } + +**WebSocket Request** + +.. code-block:: json + + { + "namespace" : "sysadm", + "name" : "iocage", + "id" : "fooid", + "args" : { + "action" : "df" + } + } + +**Response** + +.. code-block:: json + + { + "args": { + "df": { + "f250ab25-d062-11e5-8209-d05099728dbf": { + "ava": "83.4G", + "crt": "2.30x", + "qta": "none", + "res": "none", + "tag": "test", + "use": "1.69M" + }, + "f39318ae-d064-11e5-8209-d05099728dbf": { + "ava": "83.4G", + "crt": "2.30x", + "qta": "none", + "res": "none", + "tag": "test2", + "use": "1.69M" + } + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. index:: startjail, iocage .. _Start a Jail: From cfb7537d78663de45e2223957906841eb2c9e295 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Thu, 11 Feb 2016 12:35:37 -0500 Subject: [PATCH 4/5] Doc execjail action. --- api/classes/iocage.rst | 59 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/api/classes/iocage.rst b/api/classes/iocage.rst index 3c750a9..c69d2b3 100644 --- a/api/classes/iocage.rst +++ b/api/classes/iocage.rst @@ -21,8 +21,8 @@ Every iocage class request contains the following parameters: | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ | action | | supported actions include "getdefaultsettings", "listjails", "getjailsettings", "df", "startjail", "stopjail", | -| | | "capjail", "clonejail", "createjail", "destroyjail", "cleanjails", "cleanreleases", "cleantemplates", "cleanall", | -| | | "activatepool", and "deactivatepool" | +| | | "capjail", "clonejail", "createjail", "destroyjail", "execjail", "cleanjails", "cleanreleases", "cleantemplates", | +| | | "cleanall", "activatepool", and "deactivatepool" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -1156,6 +1156,61 @@ The "destroyjail" action destroys the specified jail. This action is irreversibl "namespace": "sysadm" } +.. index:: execjail, iocage + +.. _Run Command: + +Run Command +=========== + +The "execjail" action executes the specified "command" under the privileges of the specified "user" in the specified "jail". The response will indicate whether or not command execution +succeeded as well as any output from the command. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/iocage + { + "action" : "execjail", + "jail" : "test", + "command" : "echo hi", + "user" : "root" + } + +**WebSocket Request** + +.. code-block:: json + + { + "namespace" : "sysadm", + "name" : "iocage", + "args" : { + "user" : "root", + "action" : "execjail", + "jail" : "test", + "command" : "echo hi" + }, + "id" : "fooid" + } + +**Response** + +.. code-block:: json + + { + "args": { + "execjail": { + "success": { + "hi": "" + } + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" + } + .. index:: cleanjails, iocage .. _Clean Jails: From f351f85f741126dcaa6ea04542d80d33fe3bd500 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Thu, 11 Feb 2016 12:47:38 -0500 Subject: [PATCH 5/5] Doc mountbe action. --- api/classes/beadm.rst | 102 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/api/classes/beadm.rst b/api/classes/beadm.rst index 8424ea3..9518ce7 100644 --- a/api/classes/beadm.rst +++ b/api/classes/beadm.rst @@ -20,7 +20,7 @@ Every beadm class request contains the following parameters: | namespace | sysadm | | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ -| action | | supported actions include "listbes", "renamebe", "activatebe", "createbe" | +| action | | supported actions include "listbes", "renamebe", "activatebe", "createbe", "destroybe", and "mountbe" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -238,4 +238,104 @@ To specify another, inactive boot environment, also include "clonefrom" to speci "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** + +.. code-block:: json + + 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** + +.. code-block:: json + + 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": "" + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" } \ No newline at end of file