diff options
author | Filip Krzywka <filip.krzywka@nokia.com> | 2019-04-08 12:40:26 +0200 |
---|---|---|
committer | Filip Krzywka <filip.krzywka@nokia.com> | 2019-04-10 09:34:24 +0000 |
commit | 4d76345d06ee7591d839723a82026f6d8e756c65 (patch) | |
tree | 4bbf6174d9ca95001aa1bc9b4b7e6345102feae4 /development/bin | |
parent | d52444107a3c62c1027e35178b76645ceb4d2c4e (diff) |
Update development scripts
Change-Id: I51c6f834ea6d47d055baab81d08eb7484eebef20
Issue-ID: DCAEGEN2-1399
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
Diffstat (limited to 'development/bin')
-rwxr-xr-x | development/bin/consul.sh | 16 | ||||
-rwxr-xr-x | development/bin/dcae-msgs.sh | 12 | ||||
-rwxr-xr-x | development/bin/dcae-reset.sh | 10 | ||||
-rwxr-xr-x | development/bin/dcae-topic.sh | 9 | ||||
-rwxr-xr-x | development/bin/xnf-simulation.sh | 8 |
5 files changed, 37 insertions, 18 deletions
diff --git a/development/bin/consul.sh b/development/bin/consul.sh index 2a6bc0f5..5f9271f2 100755 --- a/development/bin/consul.sh +++ b/development/bin/consul.sh @@ -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 diff --git a/development/bin/dcae-msgs.sh b/development/bin/dcae-msgs.sh index 964be14f..84cef972 100755 --- a/development/bin/dcae-msgs.sh +++ b/development/bin/dcae-msgs.sh @@ -20,8 +20,10 @@ 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 diff --git a/development/bin/dcae-reset.sh b/development/bin/dcae-reset.sh index 03baf97a..d2d8ebd0 100755 --- a/development/bin/dcae-reset.sh +++ b/development/bin/dcae-reset.sh @@ -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 diff --git a/development/bin/dcae-topic.sh b/development/bin/dcae-topic.sh index aefb1d0b..b4c2638d 100755 --- a/development/bin/dcae-topic.sh +++ b/development/bin/dcae-topic.sh @@ -20,8 +20,11 @@ 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} diff --git a/development/bin/xnf-simulation.sh b/development/bin/xnf-simulation.sh index c3025b9b..ade0e426 100755 --- a/development/bin/xnf-simulation.sh +++ b/development/bin/xnf-simulation.sh @@ -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 } |