blob: a06d8835037a9f07e46c4f32944a95f32dcce34c [file] [log] [blame]
Tomasz Wrobela800ace2021-08-04 12:29:37 +02001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2021 NOKIA
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# ============LICENSE_END=========================================================
17source ./env/containers_ip
18
19#Data Router healthcheck
20echo "Waiting for DataRouter ready"
21for i in $(seq 10); do
22 curl -sf 'http://localhost:8080/internal/prov' -o /dev/null
23 curl_status=$?
24 if [ curl_status -eq 0 ]; then
25 break
26 else
27 sleep 2
28 fi
29done
30
31# Data Router Configuration.
32docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP"
33docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP"
34
35# Create PM Mapper feed on data router
36curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./resources/createFeed.json --post301 --location-trusted -k https://localhost:8443