aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/scripts/putTool.sh
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2018-08-12 23:40:04 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2018-08-13 02:49:05 -0400
commit538aad3add38a0ce4ef6ac25333d50bba7b05ac5 (patch)
treeb0155c033b80bb6d6d316bd92cd5f280e4542e56 /aai-resources/src/main/scripts/putTool.sh
parent96b7ed4bff9a2259f1f28f288caa6cc11c97db59 (diff)
Update resources ms to use ingest library
Change the code to replace ModelIngestor with the NodeIngestor and replace the EdgeRules with the EdgeIngestor and EdgeSerializer Edge Ingestor for getting the rules from json files Edge Serializer for creating the edges between vertexes Node Ingestor is responsible for the multiple oxm files Issue-ID: AAI-1462 Change-Id: I555916911dc4076ac017173d63478b3b76b36e42 Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/main/scripts/putTool.sh')
-rw-r--r--aai-resources/src/main/scripts/putTool.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/aai-resources/src/main/scripts/putTool.sh b/aai-resources/src/main/scripts/putTool.sh
index 46696b2..cb28413 100644
--- a/aai-resources/src/main/scripts/putTool.sh
+++ b/aai-resources/src/main/scripts/putTool.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
@@ -119,6 +119,14 @@ else
fi
fi
+fname=$JSONFILE
+if [ -f /tmp/$(basename $JSONFILE) ]; then
+ fname=/tmp/$(basename $JSONFILE)
+elif [ ! -f $JSONFILE ]; then
+ echo "The file $JSONFILE does not exist"
+ exit -1
+fi
+
if [ $MISSING_PROP = false ]; then
if [ $USEBASICAUTH = false ]; then
AUTHSTRING="--cert $PROJECT_HOME/resources/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/resources/etc/auth/aaiClientPrivateKey.pem"
@@ -126,10 +134,10 @@ if [ $MISSING_PROP = false ]; then
AUTHSTRING="-u $CURLUSER:$CURLPASSWORD"
fi
if [ $RETURNRESPONSE = true ]; then
- curl --request PUT -sL -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T /tmp/$(basename $JSONFILE) $RESTURL$RESOURCE | jq '.'
+ curl --request PUT -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -H "Content-Type: application/json" -T $fname $RESTURL$RESOURCE | jq '.'
RC=$?
else
- result=`curl --request PUT -sL -w "%{http_code}" -o /dev/null -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -T /tmp/$(basename $JSONFILE) $RESTURL$RESOURCE`
+ result=`curl --request PUT -w "%{http_code}" -o /dev/null -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" -H "Content-Type: application/json" -T $fname $RESTURL$RESOURCE`
#echo "result is $result."
RC=0;
if [ $? -eq 0 ]; then