From 72508ce12379dae35ec41b321d43638135e223ba Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 31 Mar 2016 16:49:55 +0300 Subject: some david sphinx cleanup --- .../trex_control_plane/doc_stl/api/client_code.rst | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'scripts/automation/trex_control_plane/doc_stl/api') diff --git a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst index fff3052e..4ae2b9fd 100755 --- a/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst +++ b/scripts/automation/trex_control_plane/doc_stl/api/client_code.rst @@ -12,10 +12,13 @@ The protocol is JSON-RPC2 over ZMQ transport. In addition to the Python API, a console-based API interface is also available. Python-like example:: -.. c.start(ports = [0, 1], mult = "5mpps", duration = 10) - + + c.start(ports = [0, 1], mult = "5mpps", duration = 10) + Console-like example:: -.. c.start_line (" -f ../../../../stl/udp_1pkt_simple.py -m 10mpps --port 0 1 ") + + c.start_line (" -f stl/udp_1pkt_simple.py -m 10mpps --port 0 1 ") + Example 1 - Typical Python API:: @@ -56,7 +59,8 @@ STLClient snippet ----------------- -Example 1: Minimal example of client interacting with the TRex server:: +.. code-block:: python + :caption: Example 1: Minimal example of client interacting with the TRex server c = STLClient() @@ -82,8 +86,9 @@ Example 1: Minimal example of client interacting with the TRex server:: c.disconnect() +.. code-block:: python + :caption: Example 2: Client can execute other functions while the TRex server is generating traffic -Example 2: Client can execute other functions while the TRex server is generating traffic:: c = STLClient() try: @@ -106,7 +111,10 @@ Example 2: Client can execute other functions while the TRex server is generatin c.disconnect() -Example 3: Console-like API interface:: + +.. code-block:: python + :caption: Example 3: Console-like API interface + def simple (): @@ -155,6 +163,7 @@ Example 3: Console-like API interface:: finally: c.disconnect() + Example 4: Load profile from a file:: def simple (): -- cgit 1.2.3-korg