Update development scripts 04/84504/3
authorFilip Krzywka <filip.krzywka@nokia.com>
Mon, 8 Apr 2019 10:40:26 +0000 (12:40 +0200)
committerFilip Krzywka <filip.krzywka@nokia.com>
Wed, 10 Apr 2019 09:34:24 +0000 (09:34 +0000)
Change-Id: I51c6f834ea6d47d055baab81d08eb7484eebef20
Issue-ID: DCAEGEN2-1399
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
development/bin/consul.sh
development/bin/dcae-msgs.sh
development/bin/dcae-reset.sh
development/bin/dcae-topic.sh
development/bin/xnf-simulation.sh

index 2a6bc0f..5f9271f 100755 (executable)
@@ -60,22 +60,22 @@ DOMAIN=${1:-perf3gpp}
 TOPIC=${2:-HV_VES_PERF3GPP}
 
 CONFIGURATION="{
-  "streams_publishes": {
-    "${DOMAIN}": {
-      "type": "kafka",
-      "kafka_info": {
-        "bootstrap_servers": "message-router-kafka:9092",
-        "topic_name": "${TOPIC}"
+  \"streams_publishes\": {
+    \"${DOMAIN}\": {
+      \"type\": \"kafka\",
+      \"kafka_info\": {
+        \"bootstrap_servers\": \"message-router-kafka:9092\",
+        \"topic_name\": \"${TOPIC}\"
       }
     }
   }
 }"
-CONFIGURATION_ENDPOINT=localhost:8500/v1/kv/veshv-config
+CONFIGURATION_ENDPOINT=localhost:8500/v1/kv/dcae-hv-ves-collector
 
 
 if [ -n "${VERBOSE+x}" ]; then
     echo "Configuration: ${CONFIGURATION}"
-    echo "Putting configuration under ${CONFIGURATION_ENDPOINT}."
+    echo "Putting configuration under ${CONFIGURATION_ENDPOINT}"
 fi
 curl --request PUT ${CONFIGURATION_ENDPOINT} -d "${CONFIGURATION}"
 echo
index 964be14..84cef97 100755 (executable)
 set -euo pipefail
 
 usage() {
-    echo "Return current amount of consumed messages by dcae-app-simulator"
-    echo "Usage: $0 [-h|--help] [-v|--verbose]"
+    echo "Return current amount of consumed messages by dcae-app-simulator on given topic"
+    echo "Usage: $0 [-h|--help] [-v|--verbose] <topic>"
+    echo ""
+    echo "  - topic : kafka topic to retrieve messages from, default `HV_VES_PERF3GPP`"
     exit 1
 }
 
@@ -56,12 +58,14 @@ while getopts "$optspec" arg; do
 done
 shift $((OPTIND-1))
 
+TOPIC=${1:-HV_VES_PERF3GPP}
+
 DEVELOPMENT_BIN_DIRECTORY=$(realpath $(dirname "$0"))
 source ${DEVELOPMENT_BIN_DIRECTORY}/constants.sh
 
 if [ -n "${VERBOSE+x}" ]; then
-    echo "All messages count currently consumed by dcae app simulator: "
+    echo "All messages count currently consumed by dcae app simulator on topic ${TOPIC}: "
 fi
 
-curl --request GET ${DCAE_APP_ADDRESS}/messages/all/count
+curl --request GET ${DCAE_APP_ADDRESS}/messages/${TOPIC}/count
 echo
index 03baf97..d2d8ebd 100755 (executable)
@@ -21,8 +21,10 @@ set -euo pipefail
 
 
 usage() {
-    echo "Resets dcae-app-simulator consumed messages count"
-    echo "Usage: $0 [-h|--help] [-v|--verbose]"
+    echo "Resets dcae-app-simulator consumed messages count on given topic"
+    echo "Usage: $0 [-h|--help] [-v|--verbose] <topic>"
+    echo ""
+    echo "  - topic : kafka topic to reset consumer for, default 'HV_VES_PERF3GPP'"
     exit 1
 }
 
@@ -57,6 +59,8 @@ while getopts "$optspec" arg; do
 done
 shift $((OPTIND-1))
 
+TOPIC=${1:-HV_VES_PERF3GPP}
+
 DEVELOPMENT_BIN_DIRECTORY=$(realpath $(dirname "$0"))
 source ${DEVELOPMENT_BIN_DIRECTORY}/constants.sh
 
@@ -64,5 +68,5 @@ if [ -n "${VERBOSE+x}" ]; then
     echo "Requesting DCAE app running on port ${DCAE_APP_PORT} to reset messages count"
 fi
 
-curl --request DELETE ${DCAE_APP_ADDRESS}/messages
+curl --request DELETE ${DCAE_APP_ADDRESS}/messages/${TOPIC}
 echo
index aefb1d0..b4c2638 100755 (executable)
 set -euo pipefail
 
 usage() {
-    echo "Set dcae-app-simulator to start consuming messages from given topic (HV_VES_PERF3GPP by default)"
-    echo "Usage: $0 [-h|--help] [-v|--verbose] [topic]"
+    echo "Set dcae-app-simulator to start consuming messages from given comma-separated topics (HV_VES_PERF3GPP by default)"
+    echo "Usage: $0 [-h|--help] [-v|--verbose] [topics]"
+    echo ""
+    echo "Example invocations:"
+    echo "./dcae-topic.sh FAULT_TOPIC,HEARTBEAT_TOPIC,HV_VES_PERF3GPP"
     exit 1
 }
 
@@ -62,7 +65,7 @@ source ${DEVELOPMENT_BIN_DIRECTORY}/constants.sh
 TOPIC=${1:-HV_VES_PERF3GPP}
 
 if [ -n "${VERBOSE+x}" ]; then
-    echo "Requesting DCAE app running on ${DCAE_APP_ADDRESS} to consume messages from topic: ${TOPIC}"
+    echo "Requesting DCAE app running on ${DCAE_APP_ADDRESS} to consume messages from topics: ${TOPIC}"
 fi
 
 curl --request PUT ${DCAE_APP_ADDRESS}/configuration/topics -d ${TOPIC}
index c3025b9..ade0e42 100755 (executable)
@@ -22,6 +22,14 @@ set -euo pipefail
 usage() {
     echo "Send request to xnf-simulator"
     echo "Usage: $0 [-h|--help] [-v|--verbose] [<xnf listen port> [<messages amount> [<messages type> [<xnf endpoint>]]]]"
+    echo ""
+    echo "Default values:"
+    echo "  - xnf listen port : 6062"
+    echo "  - messages amount : 1"
+    echo "  - messages type : VALID"
+    echo "  - xnf endpoint : simulator/async"
+    echo "Example invocations:"
+    echo "./xnf-simulation.sh -v 6062 1000 VALID"
     exit 1
 }