summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/doc_stl/api
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-03-31 16:49:55 +0300
committerHanoh Haim <hhaim@cisco.com>2016-03-31 16:49:55 +0300
commit72508ce12379dae35ec41b321d43638135e223ba (patch)
tree101fbd96e46dcfc0c64fb5b8ded2bbc7001b455a /scripts/automation/trex_control_plane/doc_stl/api
parent7e1049ae12c1cb31bdf9a7aeaf602db5d99dfd51 (diff)
some david sphinx cleanup
Diffstat (limited to 'scripts/automation/trex_control_plane/doc_stl/api')
-rwxr-xr-xscripts/automation/trex_control_plane/doc_stl/api/client_code.rst21
1 files changed, 15 insertions, 6 deletions
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 ():