Merge "Adding owner to jobInfo"
[nonrtric.git] / test / cr / README.md
index 251f0b3..b8c4ad1 100644 (file)
@@ -2,7 +2,7 @@
 
 The callback receiver is intended for function tests to simulate a RAPP.
 The callback receiver exposes the read and write urls, used by the agent, as configured in service.
-The callback receiver receives notifications from PMS when synchronization happens between PMS and RICs.
+The callback receiver receives notifications from PMS when synchronization happens between PMS and RICs. However, the callback receiver can be uses to receive any json payload from any source.
 
 # Ports and certificates
 
@@ -24,23 +24,39 @@ The following REST operations are available:
 
 >Send a message to CR<br>
 This method puts a request message from PMS to notify that sychronization between PMS and certain RIC happens.<br>
-```URI and payload, (PUT or POST): /callbacks/<id> <json array of response messages>```<br><br>
+```URI and payload, (PUT or POST): /callbacks/<id> <json messages>```<br>
 ```response: OK 200 or 500 for other errors```
 
+>Fetch one message for an id from CR<br>
+This method fetches the oldes message for an id, and removes the message.<br>
+```URI and payload, (GET): /get-event/<id>```<br>
+```response:  <json messages> 200 or 500 for other errors```
+
+>Fetch all messages for an id from CR<br>
+This method fetches all message in an array for an id, and removes all messages.<br>
+```URI and payload, (GET): /get-all-events/<id>```<br>
+```response:  <json array of json messages> 200 or 500 for other errors```
+
+>Dump all currently wating callback messages in CR<br>
+This method fetches all message in an array for an id. Messages are left intact in the CR.<br>
+```URI and payload, (GET): /db```<br>
+```response:  <json> 200```
+
 >Metrics - counters<br>
 There are a number of counters that can be read to monitor the message processing. Do a http GET on any of the current counters and an integer value will be returned with http response code 200.
 ```/counter/received_callbacks``` - The total number of received callbacks<br>
 ```/counter/fetched_callbacks``` - The total number of fetched callbacks<br>
 ```/counter/current_messages``` - The current number of callback messages waiting to be fetched<br>
+All counters also support the query parameter "id" to fetch counter for one individual id, eg ```/counter/current_messages?id=my-id```
 
 
 ### Build and start ###
 
 >Build image<br>
-```docker build -t callback-receiver .```
+```docker build --build-arg NEXUS_PROXY_REPO=nexus3.onap.org:10001/ -t callback-receiver .```
 
 >Start the image on both http and https<br>
-```docker run -it -p 8090:8090 -p 8091:8091 callback-receiver```
+```docker run --rm -it -p 8090:8090 -p 8091:8091 callback-receiver```
 
 It will listen to http 8090 port and https 8091 port(using default certificates) at the same time.
 
@@ -53,16 +69,16 @@ file "pass" stores the password when you run the shell script
 This certificates/key can be overriden by mounting a volume when using "docker run" or "docker-compose"
 In 'docker run', use field:
 --volume "$PWD/certificate:/usr/src/app/cert" a1test
-```docker run -it -p 8090:8090 -p 8091:8091 -v "/PATH_TO_CERT/cert:/usr/src/app/cert" callback-receiver```
+```docker run --rm -it -p 8090:8090 -p 8091:8091 -v "/PATH_TO_CERT/cert:/usr/src/app/cert" callback-receiver```
 In 'docker-compose.yml', use field:
 volumes:
       - ./certificate:/usr/src/app/cert:ro
 
-The script ```crstub-build-start.sh``` do the above two steps in one go. This starts the callback-receiver container in stand-alone mode for basic test.<br>If the callback-receiver should be executed manually with the agent, replace docker run with this command to connect to the docker network with the correct service name (--name shall be aligned with the other components, i.e. the host named given in all callback urls).
-```docker run -it -p 8090:8090 -p 8091:8091 --network nonrtric-docker-net --name callback-receiver callback-receiver```
+The script ```cr-build-start.sh``` do the above two steps in one go. This starts the callback-receiver container in stand-alone mode for basic test.<br>If the callback-receiver should be executed manually with the agent, replace docker run with this command to connect to the docker network with the correct service name (--name shall be aligned with the other components, i.e. the host named given in all callback urls).
+```docker run --rm -it -p 8090:8090 -p 8091:8091 --network nonrtric-docker-net --name callback-receiver callback-receiver```
 
 >Start the image on http only<br>
-```docker run -it -p 8090:8090 callback-receiver```
+```docker run --rm -it -p 8090:8090 callback-receiver```
 
 ### Basic test ###