blob: bb8c6f269a1eef5b9b4ae7b9857aa804e7a0aa49 [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",
56"asprClassification": "unclassified"
57}
58EOF
59echo "Initializing /feeds endpoint"
60curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/feeds
61sleep 5