<commit_before>.. _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"                                                                               |
|                                 |               |                                                                                                                      |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+

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**

.. code-block:: json

 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": {
    "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"
 }<commit_msg>Update zfs.rst<commit_after>.. _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"                                                                               |
|                                 |               |                                                                                                                      |
+---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+

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**

.. code-block:: json

 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"
 }
{'fraction_non_alphanumeric': 0.3056541282233262, 'fraction_numerical': 0.003785190442394133, 'mean_word_length': 0.5689367229541659, 'pattern_counts': {'":': 28, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 118, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3580877', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1267, 'n_words': 402}