rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 1 | #!/bin/bash |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 2 | # $1 is the IP address of the buscontroller |
| 3 | # INITIALIZE: dmaap object |
rajendrajaiswal | a157470 | 2019-02-14 10:29:45 +0000 | [diff] [blame] | 4 | JSON=/tmp/dmaap.json |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 5 | cat << EOF > $JSON |
| 6 | { |
| 7 | "version": "1", |
| 8 | "topicNsRoot": "org.onap.dmaap", |
| 9 | "drProvUrl": "https://dmaap-dr-prov:8443", |
rajendrajaiswal | a157470 | 2019-02-14 10:29:45 +0000 | [diff] [blame] | 10 | "dmaapName": "DataRouter", |
rajendrajaiswal | 8f0afd8 | 2019-02-11 12:30:26 +0000 | [diff] [blame] | 11 | "bridgeAdminTopic": "MM_AGENT_PROV" |
| 12 | |
| 13 | } |
| 14 | EOF |
| 15 | |
| 16 | echo "Initializing /dmaap endpoint" |
rajendrajaiswal | a157470 | 2019-02-14 10:29:45 +0000 | [diff] [blame] | 17 | curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap |
| 18 | |
| 19 | # INITIALIZE: dcaeLocation object |
| 20 | JSON=/tmp/dcaeLocation.json |
| 21 | cat << EOF > $JSON |
| 22 | { |
| 23 | "dcaeLocationName": "csit-pmmapper", |
| 24 | "dcaeLayer": "central-cloud", |
| 25 | "clli": "CSIT", |
| 26 | "zone": "zoneA" |
| 27 | } |
| 28 | EOF |
| 29 | |
| 30 | echo "Initializing /dcaeLocations endpoint" |
| 31 | curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations |
| 32 | |
| 33 | # INITIALIZE: MR object in 1 site |
| 34 | DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) |
| 35 | JSON=/tmp/mr.json |
| 36 | cat << EOF > $JSON |
| 37 | { |
| 38 | "dcaeLocationName": "csit-pmmapper", |
| 39 | "fqdn": "$DMAAP_MR_IP", |
| 40 | "topicProtocol" : "http", |
| 41 | "topicPort": "3904" |
| 42 | } |
| 43 | EOF |
| 44 | |
| 45 | echo "Initializing /mr_clusters endpoint" |
| 46 | curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters |
| 47 | |
| 48 | # CREATING: DR feed |
| 49 | JSON=/tmp/feed.json |
| 50 | cat << EOF > $JSON |
| 51 | { |
| 52 | "feedName":"pmmapper", |
| 53 | "feedVersion": "1", |
| 54 | "feedDescription":"PM Mapper Feed", |
| 55 | "owner":"bulkpm", |
| 56 | "asprClassification": "unclassified" |
| 57 | } |
| 58 | EOF |
| 59 | echo "Initializing /feeds endpoint" |
| 60 | curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds |
| 61 | sleep 5 |