From f5c639eebbb0b60c68c159579fc2711760db8759 Mon Sep 17 00:00:00 2001 From: Ulas Kozat Date: Mon, 6 Mar 2017 09:26:47 -0800 Subject: Update README.md Change-Id: I7b93b2e19916cff86b7a51d5351bf44e86b4a3b1 Signed-off-by: Ulas Kozat --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0ebf5e0..5af3cda 100644 --- a/README.md +++ b/README.md @@ -5,42 +5,77 @@ Tested on Ubuntu 14.04 and OS X El Capitan ###Prerequisite: + git clone https://gerrit.opnfv.org/gerrit/domino + sudo apt-get install python-pip sudo pip install tosca-parser + sudo pip install heat-translator + +###Testing: +Proceed to the domino folder and run a smoke test that checks APIs + + cd domino + ./tests/run.sh + +###Common Errors +If "internal error" message is received, a python library is missing + +Clean the server side database: + + rm -r dominoserver.db + +Make sure that all the existing domino server and client processes are killed. + kill $(pgrep -f "DominoServer.py") + kill $(pgrep -f "DominoClient.py") ###Start Domino Server: ./DominoServer.py --log=DEBUG ###Start the first Domino Client: - ./DominoClient.py -p 9091 --log=DEBUG + ./DominoClient.py -p 9091 --cliport 9100 --log=DEBUG Note: if --log option is ommitted, the default logging level is Warning messages ###Start the second Domino Client: - ./DominoClient.py -p 9092 --log=DEBUG + ./DominoClient.py -p 9092 --cliport 9200 --log=DEBUG ##CLI at the Domino Client: -###send heartbeat - heartbeat +###Send heartbeat + python domino-cli.py heartbeat -###subscribe for policy labels - subscribe -l/--label :properties:key:value +###Subscribe for policy labels + python domino-cli.py subscribe -l/--label :properties:key:value Example: -First checkout the tosca file "./tosca-templates/tosca_helloworld_nfv.yaml" and see how policy types and rules are defined. Then, from any Domino Client, use subscribe command as: +First checkout the tosca file "./tosca-templates/tosca_helloworld_nfv.yaml" and see how policy types and rules are defined. Then, for the first Domino Client, use subscribe command as: - subscribe --label tosca.policies.Placement.Geolocation:properties:region:us-west-1 + python domino-cli.py 9100 subscribe --label tosca.policies.Placement.Geolocation:properties:region:us-west-1 -###publish default template file under tosca-templates - publish --tosca-file +###Publish default template file under tosca-templates + python domino-cli.py publish --tosca-file Example: -Run the following command from any Domino Client: +Run the following command for the second Domino Client: - publish --tosca-file ./tosca-templates/tosca_helloworld_nfv.yaml + python domino-cli.py 9200 publish --tosca-file ./tosca-templates/tosca_helloworld_nfv.yaml Now, inspect the files generated under ./toscafiles, where the original file as well as parts sent to each Domino Client are shown (each part identified by UDID assigned to that client) +###Query published tosca-templates for each client + python domino-cli.py list-tuids + +Example: +Run the following command for the second Domino Client: + python domino-cli.py 9200 list-tuids + +###Change the published template for a specific Template Unique ID (TUID) + python domino-cli.py publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k + +Example: +Run the following command for the second Domino Client: + TUID=$(python domino-cli.py 9200 list-tuids | cut -c3-34) + python domino-cli.py 9200 publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k "$TUID" + ##NOTES If accidentally you start DominoClient before DominoServer, don't panic. First start the DominoServer and then input the command on the DominoClient side: -- cgit 1.2.3-korg