From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06A7BA055A for ; Wed, 26 Feb 2020 12:43:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD4681BFB5; Wed, 26 Feb 2020 12:43:42 +0100 (CET) Received: from dish-sg.nttdocomo.co.jp (dish-sg.nttdocomo.co.jp [202.19.227.74]) by dpdk.org (Postfix) with ESMTP id F05C41BFC7 for ; Wed, 26 Feb 2020 12:43:40 +0100 (CET) X-dD-Source: Outbound Received: from zssg-mailmd101.ddreams.local (zssg-mailmd900.ddreams.local [10.160.172.63]) by zssg-mailou101.ddreams.local (Postfix) with ESMTP id 3F7B21200CD; Wed, 26 Feb 2020 20:43:40 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (zssg-mailmf900.ddreams.local [10.160.172.84]) by zssg-mailmd101.ddreams.local (dDREAMS) with ESMTP id <0Q6B00VPD4KSHOC0@dDREAMS>; Wed, 26 Feb 2020 20:43:40 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (unknown [127.0.0.1]) by zssg-mailmf106.ddreams.local (Postfix) with ESMTP id 13EC67E6032; Wed, 26 Feb 2020 20:43:40 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12BF48E6055; Wed, 26 Feb 2020 20:43:40 +0900 (JST) Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id 119EE8E6042; Wed, 26 Feb 2020 20:43:40 +0900 (JST) X-IMSS-HAND-OFF-DIRECTIVE: localhost:10026 Received: from zssg-mailmf106.ddreams.local (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B53A08E6042; Wed, 26 Feb 2020 20:43:39 +0900 (JST) Received: from davinci.ntt-tx.co.jp (unknown [10.160.183.139]) by zssg-mailmf106.ddreams.local (Postfix) with ESMTP; Wed, 26 Feb 2020 20:43:39 +0900 (JST) From: x-fn-spp-ml@ntt-tx.co.jp To: ferruh.yigit@intel.com, yasufum.o@gmail.com Cc: spp@dpdk.org Date: Wed, 26 Feb 2020 20:43:28 +0900 Message-id: <20200226114335.3865-5-x-fn-spp-ml@ntt-tx.co.jp> X-Mailer: git-send-email 2.18.0 In-reply-to: <20200226114335.3865-1-x-fn-spp-ml@ntt-tx.co.jp> References: <20200226114335.3865-1-x-fn-spp-ml@ntt-tx.co.jp> X-TM-AS-GCONF: 00 Subject: [spp] [PATCH 04/11] docs: add description of REST-APIs for flow rules 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: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Hideyuki Yamashita This patch adds REST-API description for flow rules. Signed-off-by: Hideyuki Yamashita Signed-off-by: Naoki Takada --- docs/guides/api_ref/spp_primary.rst | 208 ++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/docs/guides/api_ref/spp_primary.rst b/docs/guides/api_ref/spp_primary.rst index 382915f..afb37c6 100644 --- a/docs/guides/api_ref/spp_primary.rst +++ b/docs/guides/api_ref/spp_primary.rst @@ -438,3 +438,211 @@ Equivalent CLI command .. code-block:: none pri; launch {proc_type} {sec_id} {eal_opts} -- {app_opts} + +POST /v1/primary/flow_rules/port_id/{port_id}/validate +------------------------------------------------------ + +Validate flow rule for specific port_id. + +* Normal response codes: 200 + + +Request example +~~~~~~~~~~~~~~~ + +.. code-block:: console + + $ curl -X POST \ + http://127.0.0.1:7777/v1/primary/flow_rules/port_id/0/validate \ + -H "Content-type: application/json" \ + -d '{ \ + "rule": \ + { \ + "group": 0, \ + "priority": 0, \ + "direction": "ingress", \ + "transfer": true, \ + "pattern": \ + [ \ + "eth dst is 11:22:33:44:55:66 type mask 0xffff", \ + "vlan vid is 100" \ + ], \ + "actions": \ + [ \ + "queue index 1", \ + "of_pop_vlan" \ + ] \ + } \ + }' + +Response +~~~~~~~~ + +.. _table_spp_ctl_primary_flow_validate: + +.. table:: Response params of validate. + + +------------+--------+----------------------------------------+ + | Name | Type | Description | + | | | | + +============+========+========================================+ + | result | string | Validation result. | + +------------+-------++----------------------------------------+ + | message | string | Additional information if any. | + +------------+-------++----------------------------------------+ + +Response example +~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "result" : "success", + "message" : "Flow rule validated" + } + +POST /v1/primary/flow_rules/port_id/{port_id} +--------------------------------------------- + +Create flow rule for specific port_id. + +* Normal response codes: 200 + + +Request example +~~~~~~~~~~~~~~~ + +.. code-block:: console + + $ curl -X POST http://127.0.0.1:7777/v1/primary/flow_rules/port_id/0 \ + -H "Content-type: application/json" \ + -d '{ \ + "rule": \ + { \ + "group": 0, \ + "priority": 0, \ + "direction": "ingress", \ + "transfer": true, \ + "pattern": \ + [ \ + "eth dst is 11:22:33:44:55:66 type mask 0xffff", \ + "vlan vid is 100" \ + ], \ + "actions": \ + [ \ + "queue index 1", \ + "of_pop_vlan" \ + ] \ + } \ + }' + +Response +~~~~~~~~ + +.. _table_spp_ctl_primary_flow_create: + +.. table:: Response params of flow creation. + + +------------+--------+----------------------------------------+ + | Name | Type | Description | + | | | | + +============+========+========================================+ + | result | string | Creation result. | + +------------+--------+----------------------------------------+ + | message | string | Additional information if any. | + +------------+--------+----------------------------------------+ + | rule_id | string | Rule id allocated if successful. | + +------------+--------+----------------------------------------+ + +Response example +~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "result" : "success", + "message" : "Flow rule #0 created", + "rule_id" : "0" + } + +DELETE /v1/primary/flow_rule/port_id/{port_id} +---------------------------------------------- + +Delete all flow rule for specific port_id. + +* Normal response codes: 200 + + +Request example +~~~~~~~~~~~~~~~ + +.. code-block:: console + + $ curl -X DELETE http://127.0.0.1:7777/v1/primary/flow_rule/port_id/0 + +Response +~~~~~~~~ + +.. _table_spp_ctl_primary_flow_flush: + +.. table:: Response params of flow flush. + + +------------+--------+----------------------------------------+ + | Name | Type | Description | + | | | | + +============+========+========================================+ + | result | string | Deletion result. | + +------------+--------+----------------------------------------+ + | message | string | Additional information if any. | + +------------+--------+----------------------------------------+ + +Response example +~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "result" : "success", + "message" : "Flow rule all destroyed" + } + +DELETE /v1/primary/flow_rule/{rule_id}/port_id/{port_id} +-------------------------------------------------------- + +Delete specific flow rule for specific port_id. + +* Normal response codes: 200 + + +Request example +~~~~~~~~~~~~~~~ + +.. code-block:: console + + $ curl -X DELETE http://127.0.0.1:7777/v1/primary/flow_rules/0/port_id/0 + +Response +~~~~~~~~ + +.. _table_spp_ctl_primary_flow_delete: + +.. table:: Response params of flow deletion. + + +------------+--------+----------------------------------------+ + | Name | Type | Description | + | | | | + +============+========+========================================+ + | result | string | Deletion result. | + +------------+--------+----------------------------------------+ + | message | string | Additional information if any. | + +------------+--------+----------------------------------------+ + +Response example +~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "result" : "success", + "message" : "Flow rule #0 destroyed" + } -- 2.17.1