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
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
}
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
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
}
done
shift $((OPTIND-1))
+TOPIC=${1:-HV_VES_PERF3GPP}
+
DEVELOPMENT_BIN_DIRECTORY=$(realpath $(dirname "$0"))
source ${DEVELOPMENT_BIN_DIRECTORY}/constants.sh
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
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
}
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}
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
}