X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=plans%2Fdcaegen2-pmmapper%2Fpmmapper%2Fdmaapbc.sh;fp=plans%2Fdcaegen2-pmmapper%2Fpmmapper%2Fdmaapbc.sh;h=1430258999d178c32262f3425b8d11b870d7b2d8;hb=59a78505388a584234c1916a0062b3230f0192aa;hp=14051121818d680b50baf72d8aa5e434e46f8161;hpb=83cb247902ae67bc2a8c1f10309a7a3b55acce79;p=integration%2Fcsit.git diff --git a/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh b/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh index 14051121..14302589 100755 --- a/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh +++ b/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh @@ -1,22 +1,23 @@ #!/bin/bash # $1 is the IP address of the buscontroller + # INITIALIZE: dmaap object +echo $'\nInitializing /dmaap endpoint' JSON=/tmp/dmaap.json cat << EOF > $JSON { "version": "1", -"topicNsRoot": "org.onap.dmaap", +"topicNsRoot": "topic.org.onap.dmaap", "drProvUrl": "https://dmaap-dr-prov:8443", -"dmaapName": "DataRouter", +"dmaapName": "mr", "bridgeAdminTopic": "MM_AGENT_PROV" } EOF - -echo "Initializing /dmaap endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap # INITIALIZE: dcaeLocation object +echo $'\nInitializing /dcaeLocations endpoint' JSON=/tmp/dcaeLocation.json cat << EOF > $JSON { @@ -26,26 +27,25 @@ cat << EOF > $JSON "zone": "zoneA" } EOF - -echo "Initializing /dcaeLocations endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations # INITIALIZE: MR object in 1 site +echo $'\nInitializing /mr_clusters endpoint' +DMAAP=$(docker ps -a -q --filter="name=dmaap_1") DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) JSON=/tmp/mr.json cat << EOF > $JSON { "dcaeLocationName": "csit-pmmapper", -"fqdn": "$DMAAP_MR_IP", +"fqdn": "${DMAAP_MR_IP}", "topicProtocol" : "http", "topicPort": "3904" } EOF - -echo "Initializing /mr_clusters endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters # CREATING: DR feed +echo $'\nInitializing /feeds endpoint' JSON=/tmp/feed.json cat << EOF > $JSON { @@ -67,6 +67,30 @@ cat << EOF > $JSON ] } EOF -echo "Initializing /feeds endpoint" curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds + +# CREATING: MR Topic +echo $'\nInitializing /topic endpoint' +JSON=/tmp/topic.json +cat << EOF > $JSON +{ +"topicName":"test1", +"topicDescription":"PM Mapper - VES Event", +"owner":"pmmapper" +} +EOF +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/topics + +# CREATING: MR Client +echo $'\nInitializing /mr_clients endpoint' +JSON=/tmp/mrclients.json +cat << EOF > $JSON +{ +"fqtn": "topic.org.onap.dmaap.mr.test1", +"dcaeLocationName": "csit-pmmapper", +"clientRole": "org.onap.dmaap.mr.topic", +"action": [ "pub", "view" ] +} +EOF +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clients sleep 5 \ No newline at end of file