3 # Get the list of topic from curl ressult
4 dmaap_mr_host=message-router
6 temp_output_file=".tmpoutput"
7 curl -X GET http://$dmaap_mr_host:$dmaap_mr_port/topics > $temp_output_file
9 # Test topic POA-AUDIT-INIT, POA-AUDIT-RESULT, POA-RULE-VALIDATION
10 TOPICS="POA-AUDIT-INIT POA-RULE-VALIDATION POA-AUDIT-RESULT"
11 for i_topic in $TOPICS
13 echo "Looping ... topic: $i_topic"
14 if grep -iFq "$i_topic" $temp_output_file
17 echo "$i_topic found."
20 echo "$i_topic NOT found."
21 curl -X POST -H "content-type: application/json" --data '{"event":"create topic"}' http://$dmaap_mr_host:$dmaap_mr_port/events/$i_topic
25 # remove the temp file
26 rm -f $temp_output_file