2 # Copyright 2019 AT&T Intellectual Property. All rights reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
20 if [ ! -d $BUILD_DIR ]; then
25 # Get these from values.yaml
26 export AAI_DNS_NAME=aai.onap
30 export AAI_PROTOCOL=https
31 export VID_DNS_NAME=vid.onap
33 export VID_PROTOCOL=https
34 export SDC_DNS_NAME=sdc-fe.onap
36 export SDC_PROTOCOL=https
38 DATA_FILE=$BUILD_DIR"/get_tenant_id.json"
40 cat > $DATA_FILE <<EOF
43 "methods": ["password"],
46 "name": "$OPENSTACK_USER",
47 "domain": { "id": "default" },
48 "password": "$OPENSTACK_PASS"
54 "name": "$OPENSTACK_TENANT",
55 "domain": { "id": "default" }
65 until [ "$http_code" = "201" ] || [ $COUNTER -gt 360 ]; do
66 http_code=`curl -sL -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -d @"$DATA_FILE" "http://$OPENSTACK_IP/identity/v3/auth/tokens"`
68 echo "http_code $http_code"
69 COUNTER=$((COUNTER +1))
73 TENANT_ID=`curl -s -H "Content-Type: application/json" -d @"$DATA_FILE" "http://$OPENSTACK_IP/identity/v3/auth/tokens" | jq --raw-output '.token.project.id'`
76 echo "Failure getting tenant ID from openstack, exiting..."
80 export TENANT_ID=$TENANT_ID
82 URI="aai/util/echo?action=long"
86 until [ "$http_code" = "200" ] || [ $COUNTER -gt 180 ]; do
87 echo "performing aai healthcheck..."
88 http_code=`curl -sL -w "%{http_code}" -o /dev/null -I --insecure -u $AAI_USER:$AAI_PASS -X GET "$AAI_PROTOCOL://$AAI_DNS_NAME:$AAI_PORT/$URI" \
89 -H 'X-TransactionId: 9999' \
90 -H 'X-FromAppId: jimmy-postman' \
91 -H 'Real-Time: true' \
92 -H 'Cache-Control: no-cache'`
93 COUNTER=$((COUNTER +1))
97 if [ "$http_code" != "200" ]; then
98 echo "AAI Healthcheck unsuccessful :("
99 echo "Something went wrong during the ONAP installation."
103 echo "Creating CLLI $CLLI..."
106 echo "Creating Cloud Region $CLOUD_REGION..."
107 $DIR/create_cloud_region.sh
109 echo "Creating Cloud Region Relationship..."
110 $DIR/create_cloud_region_relationship.sh
112 echo "Creating Cloud Customer $CUSTOMER..."
113 $DIR/create_customer.sh
115 echo "Creating Cloud Service Type $SERVICE_TYPE..."
116 $DIR/create_service_type.sh
118 echo "Creating Subscription..."
119 $DIR/create_subscription.sh
121 echo "Creating Subscription Relationship..."
122 $DIR/create_cloud_region_subscriber_relationship.sh
124 echo "Creating Availability Zone $AZ..."
128 URI="vid/healthCheck"
132 until [ "$http_code" = "200" ] || [ $COUNTER -gt 180 ]; do
133 echo "performing vid healthcheck..."
134 http_code=`curl -sL -w "%{http_code}" -o /dev/null --insecure -I -X GET "$VID_PROTOCOL://$VID_DNS_NAME:$VID_PORT/$URI"`
135 COUNTER=$((COUNTER +1))
139 if [ "$http_code" != "200" ]; then
140 echo "VID Healthcheck unsuccessful :("
141 echo "Something went wrong during the ONAP installation."
145 echo "Creating Owning Entity $OE..."
146 $DIR/create_owning_entity.sh
148 echo "Creating Platform $PLATFORM..."
149 $DIR/create_platform.sh
151 echo "Creating Project $PROJECT..."
152 $DIR/create_project.sh
154 echo "Creating LOB $LOB..."
157 echo "Creating Cloud Site..."
158 $DIR/create_cloud_site.sh
160 URI="sdc1/rest/healthCheck"
164 until [ "$http_code" = "200" ] || [ $COUNTER -gt 180 ]; do
165 echo "performing sdc healthcheck..."
166 http_code=`curl -k -sL -w "%{http_code}" -o /dev/null -I -X GET "$SDC_PROTOCOL://$SDC_DNS_NAME:$SDC_PORT/$URI"`
167 COUNTER=$((COUNTER +1))
171 if [ "$http_code" != "200" ]; then
172 echo "SDC Healthcheck unsuccessful :("
173 echo "Something went wrong during the ONAP installation."