Soft Patch Panel
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 1/5] docs: add pri APIs for forwarder
Date: Sun, 20 Oct 2019 02:04:39 +0900	[thread overview]
Message-ID: <20191019170443.23225-2-yasufum.o@gmail.com> (raw)
In-Reply-To: <20191019170443.23225-1-yasufum.o@gmail.com>

This update is to add REST APIs for `forward` and `patches` for
spp_primary.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 docs/guides/api_ref/spp_mirror.rst  |   4 +-
 docs/guides/api_ref/spp_nfv.rst     |   4 +-
 docs/guides/api_ref/spp_pcap.rst    |   4 +-
 docs/guides/api_ref/spp_primary.rst | 132 ++++++++++++++++++++++++++--
 docs/guides/api_ref/spp_vf.rst      |   4 +-
 5 files changed, 132 insertions(+), 16 deletions(-)

diff --git a/docs/guides/api_ref/spp_mirror.rst b/docs/guides/api_ref/spp_mirror.rst
index 1d4efee..a3f7c02 100644
--- a/docs/guides/api_ref/spp_mirror.rst
+++ b/docs/guides/api_ref/spp_mirror.rst
@@ -4,8 +4,8 @@
 .. _spp_ctl_rest_api_spp_mirror:
 
 
-API for spp_mirror
-==================
+spp_mirror
+==========
 
 GET /v1/mirrors/{client_id}
 ---------------------------
diff --git a/docs/guides/api_ref/spp_nfv.rst b/docs/guides/api_ref/spp_nfv.rst
index 949f772..7dbd43e 100644
--- a/docs/guides/api_ref/spp_nfv.rst
+++ b/docs/guides/api_ref/spp_nfv.rst
@@ -4,8 +4,8 @@
 
 .. _spp_ctl_rest_api_spp_nfv:
 
-API for spp_nfv
-===============
+spp_nfv
+=======
 
 GET /v1/nfvs/{client_id}
 ------------------------
diff --git a/docs/guides/api_ref/spp_pcap.rst b/docs/guides/api_ref/spp_pcap.rst
index 56ed542..6f5bec5 100644
--- a/docs/guides/api_ref/spp_pcap.rst
+++ b/docs/guides/api_ref/spp_pcap.rst
@@ -4,8 +4,8 @@
 
 .. _spp_ctl_rest_api_spp_pcap:
 
-API for spp_pcap
-================
+spp_pcap
+========
 
 GET /v1/pcaps/{client_id}
 -------------------------
diff --git a/docs/guides/api_ref/spp_primary.rst b/docs/guides/api_ref/spp_primary.rst
index 1345a46..382915f 100644
--- a/docs/guides/api_ref/spp_primary.rst
+++ b/docs/guides/api_ref/spp_primary.rst
@@ -4,8 +4,8 @@
 
 .. _spp_ctl_rest_api_spp_primary:
 
-API for spp_primary
-===================
+spp_primary
+===========
 
 GET /v1/primary/status
 ----------------------
@@ -136,6 +136,46 @@ Response example
     }
 
 
+PUT /v1/primary/forward
+-----------------------
+
+Start or stop forwarding.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+
+Request example
+~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+    $ curl -X PUT -H 'application/json' -d '{"action": "start"}' \
+      http://127.0.0.1:7777/v1/primary/forward
+
+
+Response
+~~~~~~~~
+
+There is no body content for the response of a successful ``PUT`` request.
+
+
+Equivalent CLI command
+~~~~~~~~~~~~~~~~~~~~~~
+
+Action is ``start``.
+
+.. code-block:: none
+
+    spp > pri; forward
+
+Action is ``stop``.
+
+.. code-block:: none
+
+    spp > pri; stop
+
+
 PUT /v1/primary/ports
 ---------------------
 
@@ -207,6 +247,88 @@ Response
 There is no body content for the response of a successful ``DELETE`` request.
 
 
+PUT /v1/primary/patches
+-----------------------
+
+Add a patch.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+
+Request (body)
+~~~~~~~~~~~~~~
+
+.. _table_spp_ctl_spp_primary_ports_patches_body:
+
+.. table:: Request body params of patches of ``spp_primary``.
+
+    +------+--------+------------------------------------+
+    | Name | Type   | Description                        |
+    |      |        |                                    |
+    +======+========+====================================+
+    | src  | string | Source port id.                    |
+    +------+--------+------------------------------------+
+    | dst  | string | Destination port id.               |
+    +------+--------+------------------------------------+
+
+
+Request example
+~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+    $ curl -X PUT -H 'application/json' \
+      -d '{"src": "ring:0", "dst": "ring:1"}' \
+      http://127.0.0.1:7777/v1/primary/patches
+
+
+Response
+~~~~~~~~
+
+There is no body content for the response of a successful ``PUT`` request.
+
+
+Equivalent CLI command
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: none
+
+    spp > pri; patch {src} {dst}
+
+
+DELETE /v1/primary/patches
+--------------------------
+
+Reset patches.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+
+Request example
+~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+    $ curl -X DELETE -H 'application/json' \
+      http://127.0.0.1:7777/v1/primary/patches
+
+
+Response
+~~~~~~~~
+
+There is no body content for the response of a successful ``DELETE`` request.
+
+
+Equivalent CLI command
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: none
+
+    spp > pri; patch reset
+
+
 DELETE /v1/primary
 ------------------
 
@@ -239,12 +361,6 @@ Launch a secondary process.
 * Error response codes: 400, 404
 
 
-Request (path)
-~~~~~~~~~~~~~~
-
-There is no params in this API.
-
-
 Request (body)
 ~~~~~~~~~~~~~~
 
diff --git a/docs/guides/api_ref/spp_vf.rst b/docs/guides/api_ref/spp_vf.rst
index d9d3719..77a52c2 100644
--- a/docs/guides/api_ref/spp_vf.rst
+++ b/docs/guides/api_ref/spp_vf.rst
@@ -4,8 +4,8 @@
 
 .. _spp_ctl_rest_api__spp_vf:
 
-API for spp_vf
-==============
+spp_vf
+======
 
 GET /v1/vfs/{client_id}
 -----------------------
-- 
2.17.1


  reply	other threads:[~2019-10-19 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19 17:04 [spp] [PATCH 0/5] Add descriptions for forwarder commands in spp_primary Yasufumi Ogawa
2019-10-19 17:04 ` Yasufumi Ogawa [this message]
2019-10-19 17:04 ` [spp] [PATCH 2/5] docs: add desc for primary design Yasufumi Ogawa
2019-10-19 17:04 ` [spp] [PATCH 3/5] docs: add intro in usecases Yasufumi Ogawa
2019-10-19 17:04 ` [spp] [PATCH 4/5] docs: add desc for using worker thread of pri Yasufumi Ogawa
2019-10-19 17:04 ` [spp] [PATCH 5/5] docs: add pri commands for forwarder 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=20191019170443.23225-2-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --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).