From: x-fn-spp-ml@ntt-tx.co.jp To: ferruh.yigit@intel.com, yasufum.o@gmail.com Cc: spp@dpdk.org Subject: [spp] [PATCH 04/11] docs: add description of REST-APIs for flow rules Date: Wed, 26 Feb 2020 20:43:28 +0900 Message-ID: <20200226114335.3865-5-x-fn-spp-ml@ntt-tx.co.jp> (raw) In-Reply-To: <20200226114335.3865-1-x-fn-spp-ml@ntt-tx.co.jp> From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch adds REST-API description for flow rules. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- 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
next prev parent reply other threads:[~2020-02-26 11:43 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-26 11:43 [spp] [PATCH 00/11] Add Hardware offload document x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 01/11] docs: add support for rte_flow x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 02/11] docs: add support of MLX5 PMD support in DPDK x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 03/11] docs: change primary process startup parameter x-fn-spp-ml 2020-02-26 11:43 ` x-fn-spp-ml [this message] 2020-02-26 11:43 ` [spp] [PATCH 05/11] docs: support flow syntax in primary command x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 06/11] docs: support multi-queue in spp_vf command x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 07/11] docs: add svg for classify case of hardware offload x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 08/11] docs: add svg for vlan " x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 09/11] docs: add svg for vm " x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 10/11] docs: add usecase for " x-fn-spp-ml 2020-02-26 11:43 ` [spp] [PATCH 11/11] docs: add install drivers for Mellanox NIC x-fn-spp-ml 2020-03-05 6:04 ` [spp] [PATCH 00/11] Add Hardware offload document Yasufumi Ogawa 2020-03-05 9:04 ` Yasufumi Ogawa 2020-03-13 0:46 ` 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=20200226114335.3865-5-x-fn-spp-ml@ntt-tx.co.jp \ --to=x-fn-spp-ml@ntt-tx.co.jp \ --cc=ferruh.yigit@intel.com \ --cc=spp@dpdk.org \ --cc=yasufum.o@gmail.com \ /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
Soft Patch Panel This inbox may be cloned and mirrored by anyone: git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \ spp@dpdk.org public-inbox-index spp Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.spp AGPL code for this site: git clone https://public-inbox.org/public-inbox.git