From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.valinux.co.jp (mail.valinux.co.jp [210.128.90.3]) by dpdk.org (Postfix) with ESMTP id 72D9F255 for ; Sun, 23 Sep 2018 04:25:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.valinux.co.jp (Postfix) with ESMTP id 78C26B3C68 for ; Sun, 23 Sep 2018 11:25:39 +0900 (JST) X-Virus-Scanned: Debian amavisd-new at valinux.co.jp Received: from mail.valinux.co.jp ([127.0.0.1]) by localhost (mail.valinux.co.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DCHjfJ6ix554 for ; Sun, 23 Sep 2018 11:25:39 +0900 (JST) Received: from [127.0.0.1] (vagw.valinux.co.jp [210.128.90.14]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.valinux.co.jp (Postfix) with ESMTPS id 634E4B3B4E for ; Sun, 23 Sep 2018 11:25:39 +0900 (JST) Date: Sun, 23 Sep 2018 11:25:39 +0900 From: Itsuro ODA To: spp@dpdk.org In-Reply-To: <20180923112233.2D71.277DD91C@valinux.co.jp> References: <20180923112233.2D71.277DD91C@valinux.co.jp> Message-Id: <20180923112539.2D75.277DD91C@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.71.01 [ja] Subject: [spp] [PATCH v2 1/9] docs: overview X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2018 02:25:42 -0000 From: Itsuro Oda Signed-off-by: Itsuro Oda --- docs/guides/spp-ctl/overview.rst | 102 +++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 docs/guides/spp-ctl/overview.rst diff --git a/docs/guides/spp-ctl/overview.rst b/docs/guides/spp-ctl/overview.rst new file mode 100644 index 0000000..847b9dc --- /dev/null +++ b/docs/guides/spp-ctl/overview.rst @@ -0,0 +1,102 @@ +==================================== +spp-ctl: SPP controller with Web API +==================================== + +Overview +======== + +spp-ctl is a SPP controller with a REST like web API. + +spp-ctl maintains the connections from the SPP processes and at the same +time exposes the API for the user to request for the SPP processes. + +Background and motivation +------------------------- + +Current CLI (spp.py/spp_vf.py) can be used by intaractive only. +Therefore, spp-agent, a component of networking-spp which make SPP +available on OpenStack environment, implements SPP controller in +itself. (see. https://github.com/openstack/networking-spp ) + +Either CLI or spp-agent, there is a problem that other people can not +request to SPP processes while using. spp-ctl is invented to solve this +problem. + +Both CLI and spp-agent can be used spp-ctl to request SPP processes +instead of owning contoroller itself. In that case, multiple people +can request to SPP processes at the same time. +Note that spp-agent has a plan to change to use spp-ctl. +It is also available not using CLI but requesting spp-ctl directly. + +Architecture +------------ + +The design goal of spp-ctl is to be as simple as possible. +It is stateless. Basically, spp-ctl only converts API requests into +commands of SPP processes and throws request, thouth it does syntax and +lexical check for API requests. + +spp-ctl adopts bottle (it is simple and well known) as a web framework +and eventlet for parallel processing. spp-ctl can process multiple APIs +at the same time, however, requests for per SPP process are serialized +internally. + + +Setup +===== + +spp-ctl is a simple program written in python3. Installation of related +packages is as follows (assume ubuntu). + +:: + + $ sudo apt update + $ sudo apt install python3 + $ sudo apt install python3-pip + $ sudo pip3 install -r requirements.txt + +Usage +----- + +:: + + usage: spp-ctl [-p PRI_PORT] [-s SEC_PORT] [-a API_PORT] + + optional arguments: + -p PRI_PORT primary port. default is 5555. + -s SEC_PORT secondary port. default is 6666. + -a API_PORT web api port. default is 7777. + +Using systemd +------------- + +Although spp-ctl runs as a daemon process normaly, it assumes to the +use of systemd and does not daemonize itself. + +The service file for systemd is simple as shown below:: + + [Unit] + Description = SPP Controller + + [Service] + ExecStart = {SPP install path}/spp_ctl/spp-ctl -p 5555 -s 6666 -a 7777 + User = root + +API Usage +========= + +For API details, see API-reference_. + +.. _API-reference: ./api-reference.rst + +Since spp-ctl provides the web API, for example, you can use curl to execute +requests as follows:: + + $ curl http://localhost:7777/v1/processes + [{"type": "primary"}, {"client-id": 1, "type": "vf"}, {"client-id": 2, "type": "vf"}] + $ curl http://localhost:7777/v1/vfs/1 + ... snip + $ curl -X POST http://localhost:7777/v1/vfs/1/components \ + -d '{"core": 2, "name": "forward_0_tx", "type": "forward"}' + $ + -- 2.17.0 -- Itsuro ODA