blob: 14051121818d680b50baf72d8aa5e434e46f8161 [file] [log] [blame]
rajendrajaiswal8f0afd82019-02-11 12:30:26 +00001#!/bin/bash
rajendrajaiswal8f0afd82019-02-11 12:30:26 +00002# $1 is the IP address of the buscontroller
3# INITIALIZE: dmaap object
rajendrajaiswala1574702019-02-14 10:29:45 +00004JSON=/tmp/dmaap.json
rajendrajaiswal8f0afd82019-02-11 12:30:26 +00005cat << EOF > $JSON
6{
7"version": "1",
8"topicNsRoot": "org.onap.dmaap",
9"drProvUrl": "https://dmaap-dr-prov:8443",
rajendrajaiswala1574702019-02-14 10:29:45 +000010"dmaapName": "DataRouter",
rajendrajaiswal8f0afd82019-02-11 12:30:26 +000011"bridgeAdminTopic": "MM_AGENT_PROV"
12
13}
14EOF
15
16echo "Initializing /dmaap endpoint"
rajendrajaiswala1574702019-02-14 10:29:45 +000017curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap
18
19# INITIALIZE: dcaeLocation object
20JSON=/tmp/dcaeLocation.json
21cat << EOF > $JSON
22{
23"dcaeLocationName": "csit-pmmapper",
24"dcaeLayer": "central-cloud",
25"clli": "CSIT",
26"zone": "zoneA"
27}
28EOF
29
30echo "Initializing /dcaeLocations endpoint"
31curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations
32
33# INITIALIZE: MR object in 1 site
34DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP)
35JSON=/tmp/mr.json
36cat << EOF > $JSON
37{
38"dcaeLocationName": "csit-pmmapper",
39"fqdn": "$DMAAP_MR_IP",
40"topicProtocol" : "http",
41"topicPort": "3904"
42}
43EOF
44
45echo "Initializing /mr_clusters endpoint"
46curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters
47
48# CREATING: DR feed
49JSON=/tmp/feed.json
50cat << EOF > $JSON
51{
52"feedName":"pmmapper",
53"feedVersion": "1",
54"feedDescription":"PM Mapper Feed",
55"owner":"bulkpm",
rajendrajaiswal84f3d0c2019-03-06 11:47:06 +000056"asprClassification": "unclassified",
57"pubs": [
58 {
59 "dcaeLocationName": "csit-pmmapper",
60 "feedId": "1",
61 "lastMod": "2015-01-01T15:00:00.000Z",
62 "pubId": "10",
63 "status": "EMPTY",
64 "username": "pmmapper",
65 "userpwd": "pmmapper"
66 }
67 ]
rajendrajaiswala1574702019-02-14 10:29:45 +000068}
69EOF
70echo "Initializing /feeds endpoint"
71curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds
72sleep 5