From d67f4a2fe9e775e25556d0938d12c5b4e9fa7bc5 Mon Sep 17 00:00:00 2001 From: Ulas Kozat Date: Mon, 6 Jun 2016 11:40:48 -0700 Subject: [PATCH] Updated documentation, moved some configuration parameters to the domino_conf.py file Change-Id: I31fe9cc150ed77bd200de8a78fb357b8d0761dab Signed-off-by: Ulas Kozat Updated documentation, moved some configuration parameters to the domino_conf.py file Change-Id: I419d647a8909f3ee88d96d311646843b1aef7c93 Signed-off-by: Ulas Kozat --- DominoClient.py | 4 ++-- DominoServer.py | 2 +- docs/userguide/api-documentation.rst | 45 ++++++++++++++++++++++++++++++++++-- domino_conf.py | 3 +++ 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/DominoClient.py b/DominoClient.py index d324e0d..9cdcc39 100755 --- a/DominoClient.py +++ b/DominoClient.py @@ -392,8 +392,8 @@ class DominoClient: def main(argv): client = DominoClient() - loglevel = 'WARNING' - interactive = "FALSE" + loglevel = LOGLEVEL + interactive = INTERACTIVE #process input arguments try: opts, args = getopt.getopt(argv,"hc:p:i:l:",["conf=","port=","ipaddr=","log=","iac=","cliport="]) diff --git a/DominoServer.py b/DominoServer.py index 3cb3db6..05f1ab2 100755 --- a/DominoServer.py +++ b/DominoServer.py @@ -339,7 +339,7 @@ class DominoServer: def main(argv): server = DominoServer() - loglevel = 'WARNING' + loglevel = LOGLEVEL #process input arguments try: opts, args = getopt.getopt(argv,"hc:l:",["conf=","log="]) diff --git a/docs/userguide/api-documentation.rst b/docs/userguide/api-documentation.rst index bd555de..24d63b5 100755 --- a/docs/userguide/api-documentation.rst +++ b/docs/userguide/api-documentation.rst @@ -11,9 +11,26 @@ | Using domino-cli Client ======================= -Make sure that domino-cli.py is in +x mode. +Prerequisites: -Change directory to where domino-cli.py is located or include file path in the PATH environment variable. +1. Make sure that domino-cli.py is in +x mode. + +2. Change directory to where domino-cli.py, DominoClient.py and DominoServer.py are located or include file path in the PATH environment variable. + +3. Start the Domino Server: + +.. code-block:: bash + + ./DominoServer.py --log=debug + +4. Start the Domino Client: + +.. code-block:: bash + + ./DominoClient.py -p --log=debug + +Note1: The default log level is WARNING and omitting --log option will lead to minimal/no logging on the console +Note2: domino_conf.py file includes most of the default values * Registration Command @@ -84,6 +101,14 @@ This message has the following fields that are automatically filled in. The following fields are filled in based on arguments passed on via -l/--label and -t/--ttype flags +Subscribe RPC also supports options for label using + --lop=APPEND/DELETE/OVERWRITE +and for supported template types using + --top=APPEND/DELETE/OVERWRITE. +When unspecified, the default is APPEND. +DELETE deletes existing labels (template types) specified in the current call via key -l/--label (-t/--ttype). +OVERWRITE removes the current set of labels (template types) and sets it to the new set of values passed in the same RPC call. + .. code-block:: bash Supported Template Types @@ -109,10 +134,26 @@ This message has the following fields that are automatically filled in. Template Type (= TOSCA) Template File +Note: Current version of the code has a hardcoded CLI port number, so no two Domino Clients can be run in the same port name space. + Interactive CLI mode ==================== +To enter this mode, start Domino Client with interactive console option set as true, i.e., --iac=true: + +.. code-block:: bash + + ./DominoClient -p --iax=true --log=DEBUG + +The rest of the API calls are the same as in the case of using domino-cli.py except that at the prompt there is no need to write domino-cli.py, e.g.,: + +.. code-block:: bash + >>register + >>heartbeat + >>subscribe -l -t + >>publish -t +The interactive CLI mode is preferred for manual, single host testing (i.e., all domino clients and servers run in the same machine). Revision: _sha1_ diff --git a/domino_conf.py b/domino_conf.py index 55f8367..8452f74 100644 --- a/domino_conf.py +++ b/domino_conf.py @@ -1,6 +1,9 @@ logfile = None +LOGLEVEL = 'DEBUG' #'WARNING' #ERROR, DEBUG, INFO #Client Parameters +INTERACTIVE = 'FALSE' + CLIENT_UDID = 1 CLIENT_SEQNO = 0 -- 2.16.6