From ed792f66fccdd6857542badbee5bc884119de97c Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Wed, 21 Aug 2019 11:52:13 +0000 Subject: Adding tenant endpoints Change-Id: I956422b6383a913340f8c40735a25fdf7058c735 Issue-ID: SO-2219 Signed-off-by: waqas.ikram --- .../config/aai-simulator-populate-data/tenant.json | 4 ++++ .../so/integration-etsi-testing/config/populate-aai-simulator.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 plans/so/integration-etsi-testing/config/aai-simulator-populate-data/tenant.json (limited to 'plans/so/integration-etsi-testing/config') diff --git a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/tenant.json b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/tenant.json new file mode 100644 index 00000000..746131a6 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/tenant.json @@ -0,0 +1,4 @@ +{ + "tenant-id": "693c7729b2364a26a3ca602e6f66187d", + "tenant-name": "admin" +} diff --git a/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh b/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh index d96301cf..87062ed3 100755 --- a/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh +++ b/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh @@ -57,6 +57,7 @@ populate_aai_simulator() LINE_OF_BUSINESS_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/line-of-business.json PLATFORM_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/platform.json CLOUD_REGION_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/cloud-region.json + TENANT_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/tenant.json STATUS_CODE_ACCEPTED="202" echo "$SCRIPT_NAME $(current_timestamp): checking health of AAI Simulator" @@ -119,6 +120,14 @@ populate_aai_simulator() exit 1 fi + echo "$SCRIPT_NAME $(current_timestamp): Adding Tenant" + status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/EtsiCloudRegion/tenants/tenant/693c7729b2364a26a3ca602e6f66187d -X PUT -d @$"$TENANT_JSON_FILE") + + if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then + echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put Tenant data in AAI Simulator. Status code received: $status_code" + exit 1 + fi + echo "$SCRIPT_NAME $(current_timestamp): AAI Simulator Populated Successfully" } -- cgit 1.2.3-korg