aboutsummaryrefslogtreecommitdiffstats
path: root/plans/dcaegen2-pmmapper/pmmapper/dmaapbc.sh
blob: bb8c6f269a1eef5b9b4ae7b9857aa804e7a0aa49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# $1 is the IP address of the buscontroller
# INITIALIZE: dmaap object
JSON=/tmp/dmaap.json
cat << EOF > $JSON
{
"version": "1",
"topicNsRoot": "org.onap.dmaap",
"drProvUrl": "https://dmaap-dr-prov:8443",
"dmaapName": "DataRouter",
"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
JSON=/tmp/dcaeLocation.json
cat << EOF > $JSON
{
"dcaeLocationName": "csit-pmmapper",
"dcaeLayer": "central-cloud",
"clli": "CSIT",
"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
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",
"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
JSON=/tmp/feed.json
cat << EOF > $JSON
{
"feedName":"pmmapper",
"feedVersion": "1",
"feedDescription":"PM Mapper Feed",
"owner":"bulkpm",
"asprClassification": "unclassified"
}
EOF
echo "Initializing /feeds endpoint"
curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds
sleep 5