Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/4] docs: add launch of primary to REST API reference
Date: Thu, 31 Jan 2019 20:03:07 +0900	[thread overview]
Message-ID: <1548932589-21099-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1548932589-21099-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This patch is to add `launch` API for spp_primary which is for launching
a secondary process via REST API.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 docs/guides/api_ref/spp_primary.rst | 94 +++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/docs/guides/api_ref/spp_primary.rst b/docs/guides/api_ref/spp_primary.rst
index e46de21..3cbad10 100644
--- a/docs/guides/api_ref/spp_primary.rst
+++ b/docs/guides/api_ref/spp_primary.rst
@@ -174,3 +174,97 @@ Response
 ~~~~~~~~
 
 There is no body content for the response of a successful ``DELETE`` request.
+
+
+PUT /v1/primary/launch
+----------------------
+
+Launch a secondary process.
+
+* Normal response codes: 204
+* Error response codes: 400, 404
+
+
+Request (path)
+~~~~~~~~~~~~~~
+
+There is no params in this API.
+
+
+Request (body)
+~~~~~~~~~~~~~~
+
+There are four params for launching secondary process. ``eal`` object
+contains a set of EAL options, and ``app`` contains options of teh process.
+
+.. _table_spp_ctl_spp_primary_launch_body:
+
+.. table:: Request body params for launch secondary for spp_primary.
+
+    +-----------+---------+-------------------------------------------------+
+    | Name      | Type    | Description                                     |
+    |           |         |                                                 |
+    +===========+=========+=================================================+
+    | proc_name | string  | Process name such as ``spp_nfv`` or ``spp_vf``. |
+    +-----------+---------+-------------------------------------------------+
+    | client_id | integer | Secondary ID for the process.                   |
+    +-----------+---------+-------------------------------------------------+
+    | eal       | object  | Hash obj of DPDK's EAL options.                 |
+    +-----------+---------+-------------------------------------------------+
+    | app       | object  | Hash obj of options of secondary process.       |
+    +-----------+---------+-------------------------------------------------+
+
+``eal`` object is a hash of EAL options and its values. All of EAL options
+are referred in
+`EAL parameters
+<https://doc.dpdk.org/guides/linux_gsg/linux_eal_parameters.html>`_
+in DPDK's
+`Getting Started Guide for Linux
+<https://doc.dpdk.org/guides/linux_gsg/index.html>`_.
+
+``app`` object is a hash of options of secondary process, and you can refer
+options of each of processes in
+`How to Use
+<https://spp-tmp.readthedocs.io/en/latest/setup/howto_use.html>`_
+section.
+
+
+Request example
+~~~~~~~~~~~~~~~
+
+Launch ``spp_nfv`` with secondary ID 1 and lcores ``1,2``.
+
+.. code-block:: console
+
+    $ curl -X PUT -H 'application/json' \
+      -d "{'proc_name': 'spp_nfv', 'client_id': '1', \
+        'eal': {'-m': '512', '-l': '1,2', '--proc-type': 'secondary'}, \
+        'app': {'-s': '192.168.11.59:6666', '-n': '1'}}"
+      http://127.0.0.1:7777/v1/primary/launch
+
+Launch ``spp_vf`` with secondary ID 2 and lcores ``1,4-7``.
+
+.. code-block:: console
+
+    $ curl -X PUT -H 'application/json' \
+      -d "{'proc_name': 'spp_vf', 'client_id': '2', \
+        'eal': {'-m': '512', '-l': '1,4-7', '--proc-type': 'secondary'}, \
+        'app': {'-s': '192.168.11.59:6666', '--client-id': '2'}}"
+      http://127.0.0.1:7777/v1/primary/launch
+
+
+Response
+~~~~~~~~
+
+There is no body content for the response of a successful ``PUT`` request.
+
+
+Equivalent CLI command
+~~~~~~~~~~~~~~~~~~~~~~
+
+``proc_type`` is ``nfv``, ``vf`` or ``mirror`` or so.
+``eal_opts`` and ``app_opts`` are the same as launching from command line.
+
+.. code-block:: none
+
+    pri; launch {proc_type} {sec_id} {eal_opts} -- {app_opts}
-- 
2.7.4

  parent reply	other threads:[~2019-01-31 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 11:03 [spp] [PATCH 0/4] Update REST API reference and usecases ogawa.yasufumi
2019-01-31 11:03 ` [spp] [PATCH 1/4] docs: add lcores in pri status in REST API ogawa.yasufumi
2019-01-31 11:03 ` ogawa.yasufumi [this message]
2019-01-31 11:03 ` [spp] [PATCH 3/4] docs: refactor spp_nfv REST API reference ogawa.yasufumi
2019-01-31 11:03 ` [spp] [PATCH 4/4] docs: add usage of server add command in usecase ogawa.yasufumi

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=1548932589-21099-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --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).