-init() {
- echo "ENTER init"
- if [ ! -d $CONFIGMAP_ROOT ]
- then
- echo $CONFIGMAP_ROOT does not exist
- return
- fi
-
- #loop on get /dmaap until we get a good response to indicate other provisioning can continue
- rc=999
- while [ $rc != "200" ]
- do
- sleep 10
- rc=`curl -s -o /dev/null -I -w "%{http_code}" -X GET -H "Content-Type: application/json" http://dmaap-bc:8080/webapi/dmaap`
- echo "get dmaap response=${rc}"
- done
-
- cd $CONFIGMAP_ROOT
- pwd
- # order is important in this next list
- for uri in dmaap dcaeLocations mr_clusters topics feeds
- do
- if [ -d ${uri} ]
- then
- for j in `ls ${uri}/*.json`
- do
- echo "POST $j to $uri"
- rc=`curl -v -X POST -w "%{http_code}" -H "Content-Type: application/json" -d @${j} http://dmaap-bc:8080/webapi/${uri}`
- echo "response=$rc"
- done
- fi
- done
-}
-