Soft Patch Panel
 help / color / mirror / Atom feed
From: oda@valinux.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH v2 2/2] docs: add spp_mirror API api-reference
Date: Thu, 29 Nov 2018 11:04:13 +0900	[thread overview]
Message-ID: <20181129020413.20023-3-oda@valinux.co.jp> (raw)
In-Reply-To: <20181129020413.20023-1-oda@valinux.co.jp>

From: Itsuro Oda <oda@valinux.co.jp>

This patch adds spp_mirror API reference for spp-ctl.

Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
---
 docs/guides/spp-ctl/api-reference.rst | 316 ++++++++++++++++++++++++++
 1 file changed, 316 insertions(+)

diff --git a/docs/guides/spp-ctl/api-reference.rst b/docs/guides/spp-ctl/api-reference.rst
index 70eddd6..b0d367b 100644
--- a/docs/guides/spp-ctl/api-reference.rst
+++ b/docs/guides/spp-ctl/api-reference.rst
@@ -1168,3 +1168,319 @@ type is ``vlan``
 .. code-block:: none
 
     classifier_table {action} vlan {vlan} {mac_address} {port}
+
+
+API for spp_mirror
+------------------
+
+GET /v1/mirrors/{client_id}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Get the information of the ``spp_mirror`` process.
+
+* Normal response codes: 200
+* Error response codes: 400, 404
+
+Request(path)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_mirrors_get:
+
+.. table:: Request parameter for getting spp_mirror.
+
+    +-----------+---------+--------------------------+
+    | Name      | Type    | Description              |
+    |           |         |                          |
+    +===========+=========+==========================+
+    | client_id | integer | client id.               |
+    +-----------+---------+--------------------------+
+
+Request example
+^^^^^^^^^^^^^^^
+
+.. code-block:: console
+
+    curl -X GET -H 'application/json' \
+    http://127.0.0.1:7777/v1/mirrors/1
+
+Response
+^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_res:
+
+.. table:: Response params of getting spp_mirror.
+
+    +------------------+---------+-----------------------------------------------+
+    | Name             | Type    | Description                                   |
+    |                  |         |                                               |
+    +==================+=========+===============================================+
+    | client-id        | integer | client id.                                    |
+    +------------------+---------+-----------------------------------------------+
+    | ports            | array   | an array of port ids used by the process.     |
+    +------------------+---------+-----------------------------------------------+
+    | components       | array   | an array of component objects in the process. |
+    +------------------+---------+-----------------------------------------------+
+
+component object:
+
+.. _table_spp_ctl_spp_mirror_res_comp:
+
+.. table:: Component objects of getting spp_mirror.
+
+    +---------+---------+---------------------------------------------------------------------+
+    | Name    | Type    | Description                                                         |
+    |         |         |                                                                     |
+    +=========+=========+=====================================================================+
+    | core    | integer | core id running on the component                                    |
+    +---------+---------+---------------------------------------------------------------------+
+    | name    | string  | an array of port ids used by the process.                           |
+    +---------+---------+---------------------------------------------------------------------+
+    | type    | string  | an array of component objects in the process.                       |
+    +---------+---------+---------------------------------------------------------------------+
+    | rx_port | array   | an array of port objects connected to the rx side of the component. |
+    +---------+---------+---------------------------------------------------------------------+
+    | tx_port | array   | an array of port objects connected to the tx side of the component. |
+    +---------+---------+---------------------------------------------------------------------+
+
+port object:
+
+.. _table_spp_ctl_spp_mirror_res_port:
+
+.. table:: Port objects of getting spp_vf.
+
+    +---------+---------+---------------------------------------------------------------+
+    | Name    | Type    | Description                                                   |
+    |         |         |                                                               |
+    +=========+=========+===============================================================+
+    | port    | string  | port id. port id is the form {interface_type}:{interface_id}. |
+    +---------+---------+---------------------------------------------------------------+
+
+Response example
+^^^^^^^^^^^^^^^^
+
+.. code-block:: json
+
+    {
+      "client-id": 1,
+      "ports": [
+        "phy:0", "phy:1", "ring:0", "ring:1", "ring:2"
+      ],
+      "components": [
+        {
+          "core": 2,
+          "name": "mirror_0",
+          "type": "mirror",
+          "rx_port": [
+            {
+            "port": "ring:0"
+            }
+          ],
+          "tx_port": [
+            {
+              "port": "ring:1"
+            },
+            {
+              "port": "ring:2"
+            }
+          ]
+        },
+        {
+          "core": 3,
+          "type": "unuse"
+        }
+      ]
+    }
+
+The component which type is ``unused`` is to indicate unused core.
+
+Equivalent CLI command
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: none
+
+    sec {client_id};status
+
+
+POST /v1/mirrors/{client_id}/components
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Start the component.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+Request(path)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_components:
+
+.. table:: Request params of components of spp_mirror.
+
+    +-----------+---------+-------------+
+    | Name      | Type    | Description |
+    +===========+=========+=============+
+    | client_id | integer | client id.  |
+    +-----------+---------+-------------+
+
+
+Request(body)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_components_res:
+
+.. table:: Response params of components of spp_mirror.
+
+    +-----------+---------+----------------------------------------------------------------------+
+    | Name      | Type    | Description                                                          |
+    |           |         |                                                                      |
+    +===========+=========+======================================================================+
+    | name      | string  | component name. must be unique in the process.                       |
+    +-----------+---------+----------------------------------------------------------------------+
+    | core      | integer | core id.                                                             |
+    +-----------+---------+----------------------------------------------------------------------+
+    | type      | string  | component type. only ``mirror`` is available.                        |
+    +-----------+---------+----------------------------------------------------------------------+
+
+Request example
+^^^^^^^^^^^^^^^
+
+.. code-block:: console
+
+    curl -X POST -H 'application/json' \
+    -d '{"name": "mirror_1", "core": 12, "type": "mirror"}' \
+    http://127.0.0.1:7777/v1/mirrors/1/components
+
+Response
+^^^^^^^^
+
+There is no body content for the response of a successful ``POST`` request.
+
+Equivalent CLI command
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: none
+
+    sec {client_id};component start {name} {core} {type}
+
+
+DELETE /v1/mirrors/{client_id}/components/{name}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Stop the component.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+Request(path)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_del:
+
+.. table:: Request params of deleting component of spp_mirror.
+
+    +-----------+---------+---------------------------------+
+    | Name      | Type    | Description                     |
+    |           |         |                                 |
+    +===========+=========+=================================+
+    | client_id | integer | client id.                      |
+    +-----------+---------+---------------------------------+
+    | name      | string  | component name.                 |
+    +-----------+---------+---------------------------------+
+
+Request example
+^^^^^^^^^^^^^^^
+
+.. code-block:: console
+
+    curl -X DELETE -H 'application/json' \
+    http://127.0.0.1:7777/v1/mirrors/1/components/mirror_1
+
+Response
+^^^^^^^^
+
+There is no body content for the response of a successful ``POST`` request.
+
+Equivalent CLI command
+^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: none
+
+    sec {client_id};component stop {name}
+
+
+PUT /v1/mirrors/{client_id}/components/{name}/ports
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add or Delete port to the component.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+Request(path)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_comp_port:
+
+.. table:: Request params for ports of component of spp_mirror.
+
+    +-----------+---------+---------------------------+
+    | Name      | Type    | Description               |
+    |           |         |                           |
+    +===========+=========+===========================+
+    | client_id | integer | client id.                |
+    +-----------+---------+---------------------------+
+    | name      | string  | component name.           |
+    +-----------+---------+---------------------------+
+
+Request(body)
+^^^^^^^^^^^^^
+
+.. _table_spp_ctl_spp_mirror_comp_port_body:
+
+.. table:: Request body params for ports of component of spp_mirror.
+
+    +---------+---------+-----------------------------------------------------------------+
+    | Name    | Type    | Description                                                     |
+    |         |         |                                                                 |
+    +=========+=========+=================================================================+
+    | action  | string  | ``attach`` or ``detach``.                                       |
+    +---------+---------+-----------------------------------------------------------------+
+    | port    | string  | port id. port id is the form {interface_type}:{interface_id}.   |
+    +---------+---------+-----------------------------------------------------------------+
+    | dir     | string  | ``rx`` or ``tx``.                                               |
+    +---------+---------+-----------------------------------------------------------------+
+
+Request example
+^^^^^^^^^^^^^^^
+
+.. code-block:: console
+
+    curl -X PUT -H 'application/json' \
+    -d '{"action": "attach", "port": "ring:1", "dir": "rx"}' \
+    http://127.0.0.1:7777/v1/mirrors/1/components/mirror_1/ports
+
+.. code-block:: console
+
+    curl -X PUT -H 'application/json' \
+    -d '{"action": "detach", "port": "ring:0", "dir": "tx"} \
+    http://127.0.0.1:7777/v1/mirrors/1/components/mirror_1/ports
+
+Response
+^^^^^^^^
+
+There is no body content for the response of a successful ``PUT`` request.
+
+Equivalent CLI command
+^^^^^^^^^^^^^^^^^^^^^^
+
+action is ``attach``
+
+.. code-block:: none
+
+    sec {client_id};port add {port} {dir} {name}
+
+action is ``detach``
+
+.. code-block:: none
+
+    sec {client_id};port del {port} {dir} {name}
-- 
2.17.1

  parent reply	other threads:[~2018-11-29  2:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  0:55 [spp] [PATCH 0/2] spp_mirror API support oda
2018-11-29  0:55 ` [spp] [PATCH 1/2] " oda
2018-11-29  0:55 ` [spp] [PATCH 2/2] spp_mirror API api-reference oda
2018-11-29  1:36 ` [spp] [PATCH 0/2] spp_mirror API support Yasufumi Ogawa
2018-11-29  2:04 ` [spp] [PATCH v2 " oda
2018-11-29  2:04   ` [spp] [PATCH v2 1/2] spp-ctl: add " oda
2018-11-29  2:04   ` oda [this message]
2018-11-29 10:01   ` [spp] [PATCH v2 0/2] " Yasufumi Ogawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181129020413.20023-3-oda@valinux.co.jp \
    --to=oda@valinux.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).