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 DE4D0A057C for ; Fri, 27 Mar 2020 05:57:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D150A1BFD7; Fri, 27 Mar 2020 05:57:40 +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 B3BBF1C066 for ; Fri, 27 Mar 2020 05:57:38 +0100 (CET) X-dD-Source: Outbound Received: from zssg-mailmd102.ddreams.local (zssg-mailmd900.ddreams.local [10.160.172.63]) by zssg-mailou101.ddreams.local (Postfix) with ESMTP id F058F12013B; Fri, 27 Mar 2020 13:57:37 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (zssg-mailmf900.ddreams.local [10.160.172.84]) by zssg-mailmd102.ddreams.local (dDREAMS) with ESMTP id <0Q7U00M2J5S15GD0@dDREAMS>; Fri, 27 Mar 2020 13:57:37 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (unknown [127.0.0.1]) by zssg-mailmf106.ddreams.local (Postfix) with ESMTP id D0C167E6034; Fri, 27 Mar 2020 13:57:37 +0900 (JST) Received: from zssg-mailmf106.ddreams.local (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF1208E6068; Fri, 27 Mar 2020 13:57:37 +0900 (JST) Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id CCD888E6063; Fri, 27 Mar 2020 13:57:37 +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 E45968E6055; Fri, 27 Mar 2020 13:57:36 +0900 (JST) Received: from davinci.ntt-tx.co.jp (unknown [10.160.183.139]) by zssg-mailmf106.ddreams.local (Postfix) with ESMTP; Fri, 27 Mar 2020 13:57:36 +0900 (JST) From: x-fn-spp-ml@ntt-tx.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Fri, 27 Mar 2020 13:57:25 +0900 Message-id: <20200327045732.18463-5-x-fn-spp-ml@ntt-tx.co.jp> X-Mailer: git-send-email 2.25.1 In-reply-to: <20200226113521.3787-1-x-fn-spp-ml@ntt-tx.co.jp> References: <20200226113521.3787-1-x-fn-spp-ml@ntt-tx.co.jp> MIME-version: 1.0 Content-transfer-encoding: 8bit X-TM-AS-GCONF: 00 Subject: [spp] [PATCH v2 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..fbf8874 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