aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources/src/main/scripts')
-rw-r--r--aai-resources/src/main/scripts/PropertyChangeName.sh66
-rw-r--r--aai-resources/src/main/scripts/audit_schema.sh2
-rw-r--r--aai-resources/src/main/scripts/changePropertyCardinality.sh70
-rw-r--r--aai-resources/src/main/scripts/common_functions.sh17
-rw-r--r--aai-resources/src/main/scripts/createDBSchema.sh40
-rw-r--r--aai-resources/src/main/scripts/dataGrooming.sh131
-rw-r--r--aai-resources/src/main/scripts/dataRestoreFromSnapshot.sh70
-rw-r--r--aai-resources/src/main/scripts/deleteTool.sh2
-rw-r--r--aai-resources/src/main/scripts/deobfuscatePW.sh39
-rw-r--r--aai-resources/src/main/scripts/dupeTool.sh73
-rw-r--r--aai-resources/src/main/scripts/dynamicPayloadArchive.sh66
-rw-r--r--aai-resources/src/main/scripts/dynamicPayloadGenerator.sh87
-rw-r--r--aai-resources/src/main/scripts/edgeTagger.sh86
-rw-r--r--aai-resources/src/main/scripts/forceDeleteTool.sh84
-rw-r--r--aai-resources/src/main/scripts/getTool.sh4
-rw-r--r--aai-resources/src/main/scripts/increaseNodes.sh (renamed from aai-resources/src/main/scripts/dataSnapshot.sh)23
-rw-r--r--aai-resources/src/main/scripts/install/addManualData.sh20
-rw-r--r--aai-resources/src/main/scripts/install/updateQueryData.sh106
-rw-r--r--aai-resources/src/main/scripts/putTool.sh14
-rw-r--r--aai-resources/src/main/scripts/rshipTool.sh2
-rw-r--r--aai-resources/src/main/scripts/run_Migrations.sh47
-rw-r--r--aai-resources/src/main/scripts/schemaMod.sh70
-rw-r--r--aai-resources/src/main/scripts/uniquePropertyCheck.sh44
-rw-r--r--aai-resources/src/main/scripts/updatePem.sh (renamed from aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh)2
-rw-r--r--aai-resources/src/main/scripts/updateTool.sh13
25 files changed, 53 insertions, 1125 deletions
diff --git a/aai-resources/src/main/scripts/PropertyChangeName.sh b/aai-resources/src/main/scripts/PropertyChangeName.sh
deleted file mode 100644
index 8168928..0000000
--- a/aai-resources/src/main/scripts/PropertyChangeName.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# This script is used to add a target property name with the same value in the database schema
-# to a vertex which has an existing property. The existing property is not removed.
-#
-# Note also - This script just makes changes to the schema that is currently live.
-# If you were to create a new schema in a brandy-new environment, it would look like
-# whatever the oxm (as of July 2016) told it to look like. So, part of making a
-# change to the db schema should Always first be to make the change in the oxm so that
-# future environments will have the change. This script is just to change existing
-# instances of the schema since schemaGenerator (as of July 2015) does not update things - it
-# just does the initial creation.
-#
-# To use this script, you need to pass four parameters:
-# propertyName -- the name of the property that has the value to be used in the targetProperty
-# targetPropertyName -- the name of the targetProperty
-# targetNodeType -- NA if all propertyName instances in the DB are impacted, otherwise limit the change to this nodeType
-# skipCommit -- true or false. For testing, skips the commit when set to true.
-#
-# Ie. propertyNameChange service-id persona-model-id service-instance true
-#
-
-echo "RETIRED: Reach out to delivery team if this needs to be execued."
-#COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-#. ${COMMON_ENV_PATH}/common_functions.sh
-#start_date;
-#check_user;
-
-
-#if [ "$#" -ne 4 ]; then
-# echo "Illegal number of parameters"
-# echo "usage: $0 propertyName targetPropertyName targetNodeType skipCommit"
-# exit 1
-#fi
-
-#source_profile;
-#execute_spring_jar org.onap.aai.dbgen.PropertyNameChange ${PROJECT_HOME}/resources/etc/appprops/schemaMod-logback.xml "$1 $2 $3 $4"
-#if [ "$?" -ne "0" ]; then
-# echo "Problem executing propertyNameChange "
-# end_date;
-# exit 1
-#fi
-
-
-#end_date;
-#exit 0
diff --git a/aai-resources/src/main/scripts/audit_schema.sh b/aai-resources/src/main/scripts/audit_schema.sh
index 70aa535..ea66092 100644
--- a/aai-resources/src/main/scripts/audit_schema.sh
+++ b/aai-resources/src/main/scripts/audit_schema.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# ============LICENSE_START=======================================================
# org.onap.aai
diff --git a/aai-resources/src/main/scripts/changePropertyCardinality.sh b/aai-resources/src/main/scripts/changePropertyCardinality.sh
deleted file mode 100644
index 3be0178..0000000
--- a/aai-resources/src/main/scripts/changePropertyCardinality.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/ksh
-
-###
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-#
-# This script is used to change the cardinality of an existing database property.
-# It currently just allows you to change TO a SET cardinality with dataType = String.
-# It does not currently let you preserve the data (since we're just doing this for one
-# field which nobody uses yet).
-#
-# Note also - This script just makes changes to the schema that is currently live.
-# If you were to create a new schema in a brandy-new environment, it would look like
-# whatever ex5.json (as of Jan 2016) told it to look like. So, part of making a
-# change to the db schema should Always first be to make the change in ex5.json so that
-# future environments will have the change. This script is just to change existing
-# instances of the schema since schemaGenerator (as of Jan 2016) does not update things - it
-# just does the initial creation.
-#
-# Boy, this is getting to be a big comment section...
-#
-# To use this script, you need to pass four parameters:
-# propertyName -- the name of the property that you need to change Cardinality on.
-# targetDataType -- whether it's changing or not, you need to give it: For now -- we only allow "String"
-# targetCardinality -- For now -- only accepts "SET". In the future we should support ("SET", "LIST" or "SINGLE")
-# preserveDataFlag -- true or false. For now -- only supports "false"
-#
-# Ie. changePropertyCardinality.sh supplier-release-list String SET false
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-
-if [ "$#" -ne 4 ]; then
- echo "Illegal number of parameters"
- echo "usage: $0 propertyName targetDataType targetCardinality preserveDataFlag"
- exit 1
-fi
-
-source_profile;
-
-execute_spring_jar org.onap.aai.dbgen.ChangePropertyCardinality ${PROJECT_HOME}/resources/etc/appprops/schemaMod-logback.xml "$1 $2 $3 $4"
-if [ "$?" -ne "0" ]; then
- echo "Problem executing ChangePropertyCardinality "
- end_date;
- exit 1
-fi
-
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/common_functions.sh b/aai-resources/src/main/scripts/common_functions.sh
index 768a911..9c8e275 100644
--- a/aai-resources/src/main/scripts/common_functions.sh
+++ b/aai-resources/src/main/scripts/common_functions.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
#
# ============LICENSE_START=======================================================
# org.onap.aai
@@ -49,15 +49,24 @@ execute_spring_jar(){
shift 2;
- EXECUTABLE_JAR=$(ls ${PROJECT_HOME}/lib/aai-resources-*.jar);
+ EXECUTABLE_JAR=$(ls ${PROJECT_HOME}/lib/*.jar);
- JAVA_OPTS="${JAVA_PRE_OPTS}";
- JAVA_OPTS="-DAJSC_HOME=$PROJECT_HOME";
+ JAVA_OPTS="${JAVA_PRE_OPTS} -DAJSC_HOME=$PROJECT_HOME";
JAVA_OPTS="$JAVA_OPTS -DBUNDLECONFIG_DIR=resources";
JAVA_OPTS="$JAVA_OPTS -Daai.home=$PROJECT_HOME ";
JAVA_OPTS="$JAVA_OPTS -Dhttps.protocols=TLSv1.1,TLSv1.2";
JAVA_OPTS="$JAVA_OPTS -Dloader.main=${className}";
+ JAVA_OPTS="$JAVA_OPTS -Dloader.path=${PROJECT_HOME}/resources";
JAVA_OPTS="$JAVA_OPTS -Dlogback.configurationFile=${logbackFile}";
+
+ export SOURCE_NAME=$(grep '^schema.source.name=' ${PROJECT_HOME}/resources/application.properties | cut -d"=" -f2-);
+ # Needed for the schema ingest library beans
+ eval $(grep '^schema\.' ${PROJECT_HOME}/resources/application.properties | \
+ sed 's/^\(.*\)$/JAVA_OPTS="$JAVA_OPTS -D\1"/g' | \
+ sed 's/${server.local.startpath}/${PROJECT_HOME}\/resources/g'| \
+ sed 's/${schema.source.name}/'${SOURCE_NAME}'/g'\
+ )
+
JAVA_OPTS="${JAVA_OPTS} ${JAVA_POST_OPTS}";
${JAVA_HOME}/bin/java ${JVM_OPTS} ${JAVA_OPTS} -jar ${EXECUTABLE_JAR} "$@"
diff --git a/aai-resources/src/main/scripts/createDBSchema.sh b/aai-resources/src/main/scripts/createDBSchema.sh
deleted file mode 100644
index 00f49ca..0000000
--- a/aai-resources/src/main/scripts/createDBSchema.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-
-#
-# The script invokes GenTester java class to create the DB schema
-#
-# NOTE: you can pass an option GEN_DB_WITH_NO_SCHEMA if you want it to create an instance of
-# the graph - but with no schema (this is useful when using the Hbase copyTable to
-# copy our database to different environments).
-# Ie. createDbSchema.sh GEN_DB_WITH_NO_SCHEMA
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-start_date;
-check_user;
-source_profile;
-execute_spring_jar org.onap.aai.dbgen.GenTester ${PROJECT_HOME}/resources/etc/appprops/createDBSchema-logback.xml "$@"
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/dataGrooming.sh b/aai-resources/src/main/scripts/dataGrooming.sh
deleted file mode 100644
index f1ba4bc..0000000
--- a/aai-resources/src/main/scripts/dataGrooming.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# The script invokes the dataGrooming java class to run some tests and generate a report and
-# potentially do some auto-deleteing.
-#
-# Here are the allowed Parameters. Note - they are all optional and can be mixed and matched.
-#
-# -f oldFileName (see note below)
-# -autoFix
-# -sleepMinutes nn
-# -edgesOnly
-# -skipEdges
-# -timeWindowMinutes nn
-# -dontFixOrphans
-# -maxFix
-# -skipHostCheck
-# -singleCommits
-# -dupeCheckOff
-# -dupeFixOn
-# -ghost2CheckOff
-# -ghost2FixOn
-#
-# NOTES:
-# -f The name of a previous report can optionally be passed in with the "-f" option.
-# Just the filename -- ie. "dataGrooming.sh -f dataGrooming.201504272106.out"
-# The file will be assumed to be in the directory that it was created in.
-# If a filename is passed, then the "deleteCandidate" vertex-id's and bad edges
-# listed inside that report file will be deleted on this run if they are encountered as
-# bad nodes/edges again.
-#
-# -autoFix If you don't use the "-f" option, you could choose to use "-autofix" which will
-# automatically run the script twice: once to look for problems, then after
-# sleeping for a few minutes, it will re-run with the inital-run's output as
-# an input file.
-#
-# -maxFix When using autoFix, you might want to limit how many 'bad' records get fixed.
-# This is a safeguard against accidently deleting too many records automatically.
-# It has a default value set in AAIConstants: AAI_GROOMING_DEFAULT_MAX_FIX = 15;
-# If there are more than maxFix candidates found -- then none will be deleted (ie.
-# someone needs to look into it)
-#
-# -sleepMinutes When using autoFix, this defines how many minutes we sleep before the second run.
-# It has a default value set in AAIConstants: AAI_GROOMING_DEFAULT_SLEEP_MINUTES = 7;
-# The reason we sleep at all between runs is that our DB is "eventually consistant", so
-# we want to give it time to resolve itself if possible.
-#
-# -edgesOnly Can be used any time you want to limit this tool so it only looks at edges.
-# Note - as of 1710, we have not been seeing many purely bad edges,
-# (ie. not associated with a phantom node) so this option is not used often.
-#
-# -skipEdgeChecks Use it to bypass checks for bad Edges (which are pretty rare).
-#
-# -timeWindowMinutes Use it to limit the nodes looked at to ones whose update-timestamp tells us that it was last updated less than this many minutes ago. Note this is usually used along with the skipEdgeChecks option.
-#
-# -dontFixOrphans Since there can sometimes be a lot of orphan nodes, and they don't
-# harm processing as much as phantom-nodes or bad-edges, it is useful to be
-# able to ignore them when fixing things.
-#
-# -skipHostCheck By default, the grooming tool will check to see that it is running
-# on the host that is the first one in the list found in:
-# aaiconfig.properties aai.primary.filetransfer.serverlist
-# This is so that when run from the cron, it only runs on one machine.
-# This option lets you turn that checking off.
-#
-# -singleCommits By default, the grooming tool will do all of its processing and then do
-# a commit of all the changes at once. This option (maybe could have been named better)
-# is letting the user override the default behavior and do a commit for each
-# individual 'remove" one by one as they are encountered by the grooming logic.
-# NOTE - this only applies when using either the "-f" or "-autoFix" options since
-# those are the only two that make changes to the database.
-#
-# -dupeCheckOff By default, we will check all of our nodes for duplicates. This parameter lets
-# us turn this check off if we don't want to do it for some reason.
-#
-# -dupeFixOn When we're fixing data, by default we will NOT fix duplicates This parameter lets us turn
-# that fixing ON when we are comfortable that it can pick the correct duplicate to preserve.
-#
-# -ghost2CheckOff By default, we will check for the "new" kind of ghost that we saw on
-# Production in early February 2016. This parameter lets us turn this check off if we
-# don't want to do it for some reason.
-#
-# -ghost2FixOn When we're fixing data, by default we will NOT try to fix the "new" ghost nodes.
-# This parameter lets us turn that fixing ON if we want to try to fix them.
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-
-# Make sure that it's not already running
-processStat=`ps -ef|grep aaiadmin|grep -E "org.onap.aai.dbgen.DataGrooming"|grep -v grep`
-if [ "$processStat" != "" ]
- then
- echo "Found dataGrooming is already running: " $processStat
- exit 1
-fi
-
-# Make sure that it's not already running
-processStat=`ps -ef|grep aaiadmin|grep -E "org.onap.aai.dbgen.DataGrooming"|grep -v grep`
-if [ "$processStat" != "" ]
- then
- echo "Found dataGrooming is already running: " $processStat
- exit 1
-fi
-
-source_profile;
-execute_spring_jar org.onap.aai.dbgen.DataGrooming ${PROJECT_HOME}/resources/etc/appprops/dataGrooming-logback.xml "$@"
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/dataRestoreFromSnapshot.sh b/aai-resources/src/main/scripts/dataRestoreFromSnapshot.sh
deleted file mode 100644
index 042dd15..0000000
--- a/aai-resources/src/main/scripts/dataRestoreFromSnapshot.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# This script uses the dataSnapshot and SchemaGenerator (via GenTester) java classes to restore
-# data to a database by doing three things:
-# 1) clear out whatever data and schema are currently in the db
-# 2) rebuild the schema (using the SchemaGenerator)
-# 3) reload data from the passed-in datafile (which must found in the dataSnapShots directory and
-# contain an xml view of the db data).
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-
-if [ "$#" -lt 1 ]; then
- echo "Illegal number of parameters"
- echo "usage: $0 previous_snapshot_filename"
- exit 1
-fi
-
-source_profile;
-export PRE_JAVA_OPTS=${PRE_JAVA_OPTS:--Xms6g -Xmx8g};
-
-#### Step 1) clear out the database
-execute_spring_jar org.onap.aai.dbgen.DataSnapshot ${PROJECT_HOME}/resources/etc/appprops/dataSnapshot-logback.xml "CLEAR_ENTIRE_DATABASE" "$1" "$2"
-if [ "$?" -ne "0" ]; then
- echo "Problem clearing out database."
- exit 1
-fi
-
-#### Step 2) rebuild the db-schema
-execute_spring_jar org.onap.aai.dbgen.GenTester ${PROJECT_HOME}/resources/etc/appprops/createDBSchema-logback.xml "GEN_DB_WITH_NO_DEFAULT_CR"
-if [ "$?" -ne "0" ]; then
- echo "Problem rebuilding the schema (SchemaGenerator)."
- exit 1
-fi
-
-#### Step 3) reload the data from a snapshot file
-
-execute_spring_jar org.onap.aai.dbgen.DataSnapshot ${PROJECT_HOME}/resources/etc/appprops/dataSnapshot-logback.xml "RELOAD_DATA" "$1"
-if [ "$?" -ne "0" ]; then
- echo "Problem reloading data into the database."
- end_date;
- exit 1
-fi
-
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/deleteTool.sh b/aai-resources/src/main/scripts/deleteTool.sh
index 3d7f923..6cb27c8 100644
--- a/aai-resources/src/main/scripts/deleteTool.sh
+++ b/aai-resources/src/main/scripts/deleteTool.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
diff --git a/aai-resources/src/main/scripts/deobfuscatePW.sh b/aai-resources/src/main/scripts/deobfuscatePW.sh
deleted file mode 100644
index 6732b04..0000000
--- a/aai-resources/src/main/scripts/deobfuscatePW.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# The script invokes the utils.JettyObfuscationConversionCommandLineUtil class to
-# deobfuscate an obfuscated name from aaiconfig property file
-# e.g.
-# ./deobfuscatePW.sh odl.auth.password
-# will return:
-# admin
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-
-source_profile;
-execute_spring_jar org.onap.aai.util.AAIConfigCommandLinePropGetter ${PROJECT_HOME}/resources/etc/appprops/default-logback.xml "$1"
-end_date; \ No newline at end of file
diff --git a/aai-resources/src/main/scripts/dupeTool.sh b/aai-resources/src/main/scripts/dupeTool.sh
deleted file mode 100644
index f088d5b..0000000
--- a/aai-resources/src/main/scripts/dupeTool.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/ksh
-
-###
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-#
-# dupeTool.sh -- This tool is used to look at or fix duplicate nodes for one nodeType
-# at a time and can be used to limit what it's looking at to just nodes created
-# within a recent time window.
-# It is made to deal with situations (like we have in 1610/1702) where one type
-# of node keeps needing to have duplicates cleaned up (tenant nodes).
-# It is needed because DataGrooming cannot be run often and cannot be focused just
-# on duplicates or just on one nodeType.
-#
-# Parameters:
-#
-# -userId (required) must be followed by a userid
-# -nodeType (required) must be followed by a valid nodeType
-# -timeWindowMinutes (optional) by default we would look at all nodes of the
-# given nodeType, but if a window is given, then we will only look at
-# nodes created that many (or fewer) minutes ago.
-# -autoFix (optional) use this if you want duplicates fixed automatically (if we
-# can figure out which to delete)
-# -maxFix (optional) like with dataGrooming lets you override the default maximum
-# number of dupes that can be processed at one time
-# -skipHostCheck (optional) By default, the dupe tool will check to see that it is running
-# on the host that is the first one in the list found in:
-# aaiconfig.properties aai.primary.filetransfer.serverlist
-# This is so that when run from the cron, it only runs on one machine.
-# This option lets you turn that checking off.
-# -sleepMinutes (optional) like with DataGrooming, you can override the
-# sleep time done when doing autoFix between first and second checks of the data.
-# -params4Collect (optional) followed by a string to tell what properties/values to use
-# to limit the nodes being looked at. Must be in the format
-# of “propertName|propValue” use commas to separate if there
-# are more than one name/value being passed.
-# -specialTenantRule (optional) turns on logic which will use extra logic to figure
-# out which tenant node can be deleted in a common scenario.
-#
-#
-# For example (there are many valid ways to use it):
-#
-# dupeTool.sh -userId am8383 -nodeType tenant -timeWindowMinutes 60 -autoFix
-# or
-# dupeTool.sh -userId am8383 -nodeType tenant -specialTenantRule -autoFix -maxFix 100
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-source_profile;
-execute_spring_jar org.onap.aai.dbgen.DupeTool ${PROJECT_HOME}/resources/etc/appprops/dupeTool-logback.xml "$@"
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/dynamicPayloadArchive.sh b/aai-resources/src/main/scripts/dynamicPayloadArchive.sh
deleted file mode 100644
index 75d75d4..0000000
--- a/aai-resources/src/main/scripts/dynamicPayloadArchive.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/ksh
-
-###
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-#
-# The script is called to tar and gzip the files under /opt/app/aai-resources/resources/etc/scriptdata/addmanualdata/tenant_isolation which are the payload files created by the dynamicPayloadGenerator.sh tool.
-#
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-. /etc/profile.d/aai.sh
-PROJECT_HOME=/opt/app/aai-resources
-
-PROGNAME=$(basename $0)
-
-TS=$(date "+%Y_%m_%d_%H_%M_%S")
-
-CHECK_USER="aaiadmin"
-userid=$( id | cut -f2 -d"(" | cut -f1 -d")" )
-if [ "${userid}" != $CHECK_USER ]; then
- echo "You must be $CHECK_USER to run $0. The id used $userid."
- exit 1
-fi
-DIRECTORY=${PROJECT_HOME}/resources/etc/scriptdata/addmanualdata/tenant_isolation
-if [ ! -d ${DIRECTORY} ]
-then
- echo " ${DIRECTORY} doesn't exist"
- exit 1
-fi
-
-tar c ${DIRECTORY}/* -f /var/tmp/dynamicPayloadArchive_${TS}.tar
-if [ $? -ne 0 ]
-then
- echo " Unable to tar ${DIRECTORY}"
- exit 1
-fi
-
-cd /var/tmp
-gzip /var/tmp/dynamicPayloadArchive_${TS}.tar
-if [ $? -ne 0 ]
-then
- echo " Unable to gzip /var/tmp/dynamicPayloadArchive_${TS}.tar"
- exit 1
-fi
-echo "Completed successfully: /var/tmp/dynamicPayloadArchive_${TS}.tar.gz"
-exit 0
diff --git a/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh b/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh
deleted file mode 100644
index 6d46546..0000000
--- a/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/ksh
-
-###
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-#
-# dynamicPayloadGenerator.sh -- This tool is used for Tenant-Isolation project
-# It is used to load a snapshot into memory and generate payloads for any input nodes
-#
-#
-# Parameters:
-#
-# -d (required) name of the fully qualified Datasnapshot file that you need to load
-# -s (optional) true or false to enable or disable schema, By default it is true for production,
-# you can change to false if the snapshot has duplicates
-# -c (optional) config file to use for loading snapshot into memory.
-# -o (required) output file to store the data files
-# -f (optional) PAYLOAD or DMAAP-MR
-# -n (optional) input file for the script
-#
-#
-# For example (there are many valid ways to use it):
-#
-# dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -o '/opt/app/aai-resources/resources/etc/scriptdata/addmanualdata/tenant_isolation/'
-#
-# or
-# dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -s false -c '/opt/app/aai-resources/resources/etc/appprops/dynamic.properties'
-# -o '/opt/app/aai-resources/resources/etc/scriptdata/addmanualdata/tenant_isolation/' -f PAYLOAD -n '/opt/app/aai-resources/resources/etc/scriptdata/nodes.json'
-#
-
-
-echo
-echo `date` " Starting $0"
-
-display_usage() {
- cat <<EOF
- Usage: $0 [options]
-
- 1. Usage: dynamicPayloadGenerator -d <graphsonPath> -o <output-path>
- 2. This script has 2 arguments that are required.
- a. -d (required) Name of the fully qualified Datasnapshot file that you need to load
- b. -o (required) output file to store the data files
- 3. Optional Parameters:
- a. -s (optional) true or false to enable or disable schema, By default it is true for production,
- b. -c (optional) config file to use for loading snapshot into memory.
- c. -f (optional) PAYLOAD or DMAAP-MR
- d. -n (optional) input file for the script
- 4. For example (there are many valid ways to use it):
- dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -o '/opt/app/aai-resources/resources/etc/scriptdata/addmanualdata/tenant_isolation/'
-
- dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -s false -c '/opt/app/aai-resources/resources/etc/appprops/dynamic.properties'
- -o '/opt/app/aai-resources/resources/etc/scriptdata/addmanualdata/tenant_isolation/' -f PAYLOAD -n '/opt/app/aai-resources/resources/etc/scriptdata/nodes.json'
-
-EOF
-}
-if [ $# -eq 0 ]; then
- display_usage
- exit 1
-fi
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-check_user;
-source_profile;
-export JVM_OPTS="-Xmx9000m -Xms9000m"
-execute_spring_jar org.onap.aai.dbgen.DynamicPayloadGenerator ${PROJECT_HOME}/resources/etc/appprops/dynamicPayloadGenerator-logback.xml "$@"
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/edgeTagger.sh b/aai-resources/src/main/scripts/edgeTagger.sh
deleted file mode 100644
index abb3428..0000000
--- a/aai-resources/src/main/scripts/edgeTagger.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-
-#
-# This script is used to synch-up the data in the database with the "edge-tags" definitions found in the DbEdgeRules.java file.
-# It is not needed during normal operation, but if a new tag (really a property) is defined for an edge or if an
-# existing tag is changed, then this script should be run to migrate existing data so that it matches the new
-# definition. Note: it is only dealing with the "tags" defined after position 2. For example, for our existing
-# rules, we have have "isParent" defined in position 2, and then other tags in positions 3, 4 and 5 as
-# mapped in DbEdgeRules.EdgeInfoMap:
-#
-# public static final Map<Integer, String> EdgeInfoMap;
-# static {
-# EdgeInfoMap = new HashMap<Integer, String>();
-# EdgeInfoMap.put(0, "edgeLabel");
-# EdgeInfoMap.put(1, "direction");
-# EdgeInfoMap.put(2, "isParent" );
-# EdgeInfoMap.put(3, "usesResource" );
-# EdgeInfoMap.put(4, "hasDelTarget" );
-# EdgeInfoMap.put(5, "SVC-INFRA" );
-# }
-#
-# -- The map above is used to interpret the data in the DbEdgeRules.EdgeRules map:
-#
-# public static final Multimap<String, String> EdgeRules =
-# new ImmutableSetMultimap.Builder<String, String>()
-# .putAll("availability-zone|complex","groupsResourcesIn,OUT,false,false,false,reverse")
-# .putAll("availability-zone|service-capability","supportsServiceCapability,OUT,false,false,false,false")
-# .putAll("complex|ctag-pool","hasCtagPool,OUT,true,false,false,false")
-# .putAll("complex|l3-network","usesL3Network,OUT,false,false,false,true")
-# etc...
-#
-# -- Valid values for the "tags" can be "true", "false" or "reverse". Read the T-space
-# write-up for a detailed explanation of this...
-#
-#
-# To use this script, You can either pass the parameter, "all" to update all the edge rules, or
-# you can pass the KEY to a single edge rule that you would like to update. NOTE - the
-# key is that first part of each edge rule that looks like, "nodeTypeA|nodeTypeB".
-#
-# Ie. ./edgeTagger.sh "all"
-# or ./edgeTagger.sh "complex|ctag-pool"
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-
-echo " NOTE - if you are deleting data, please run the dataSnapshot.sh script first or "
-echo " at least make a note the details of the node that you are deleting. "
-
-check_user;
-source_profile;
-
-execute_spring_jar org.onap.aai.dbgen.UpdateEdgeTags "" "$@"
-
-PROCESS_STATUS=$?;
-
-if [ ${PROCESS_STATUS} -ne 0 ]; then
- echo "Problem executing UpdateEdgeTags";
- exit 1;
-fi;
-
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/forceDeleteTool.sh b/aai-resources/src/main/scripts/forceDeleteTool.sh
deleted file mode 100644
index cb87b38..0000000
--- a/aai-resources/src/main/scripts/forceDeleteTool.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-
-#
-# forceDeleteTool.sh -- This tool is used to delete nodes that cannot be deleted using
-# the normal REST API because of internal DB problems. For example, Phantom nodes
-# and duplicate nodes cause errors to happen in "normal" REST API codes and must
-# be deleted using this tool.
-# Since it is not using the "normal" REST logic, it is also not invoking the "normal"
-# edge rules that we use to cascade deletes to "child" nodes. So - this tool can be dangerous.
-# Ie. if you accidently delete a parent node (like a cloud-region) that has many dependent
-# child nodes, there will be no way to get to any of those child-nodes after the cloud-region
-# has been deleted.
-# There are several environment variables defined in aaiconfig.properties to help minimize errors like that.
-# aai.forceDel.protected.nt.list=cloud-region
-# aai.forceDel.protected.edge.count=10
-# aai.forceDel.protected.descendant.count=10
-#
-# Parameters:
-#
-# -action (required) valid values: COLLECT_DATA or DELETE_NODE or DELETE_EDGE
-# -userId (required) must be followed by a userid
-# -params4Collect (followed by a string to tell what properties/values to use
-# as part of a COLLECT_DATA request. Must be in the format
-# of ?propertName|propValue? use commas to separate if there
-# are more than one name/value being passed.
-# -vertexId - required for a DELETE_NODE request
-# -edgeId - required for a DELETE_EDGE request
-# -overRideProtection --- WARNING ? This over-rides the protections we introduced!
-# It will let you override a protected vertex or vertex that has more
-# than the allowed number of edges or descendants.
-# -DISPLAY_ALL_VIDS (optional) - in the rare case when you want to see the
-# vertex-ids (vids) of all the CONNECTED vertices, you can use this. By
-# default, we do not show them.
-#
-#
-# For example:
-#
-# forceDeleteTool.sh -action COLLECT_DATA -userId am8383 -params4Collect "tenant-id|junk tenant01 ID 0224"
-#
-# forceDeleteTool.sh -action COLLECT_DATA -userId am8383 -params4Collect "cloud-owner|junkTesterCloudOwner 0224,cloud-region-id|junkTesterCloud REgion ID 0224"
-#
-# forceDeleteTool.sh -action DELETE_NODE -userId am8383 -vertexId 1234567
-#
-# forceDeleteTool.sh -action DELETE_EDGE -userId am8383 -edgeId 9876543
-#
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-start_date;
-
-echo " NOTE - if you are deleting data, please run the dataSnapshot.sh script first or "
-echo " at least make a note the details of the node that you are deleting. "
-
-check_user;
-source_profile;
-
-execute_spring_jar org.onap.aai.dbgen.ForceDeleteTool ${PROJECT_HOME}/resources/etc/appprops/forceDelete-logback.xml "$@"
-
-end_date;
-
-exit 0
diff --git a/aai-resources/src/main/scripts/getTool.sh b/aai-resources/src/main/scripts/getTool.sh
index 3f61ab1..b513d0b 100644
--- a/aai-resources/src/main/scripts/getTool.sh
+++ b/aai-resources/src/main/scripts/getTool.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
@@ -95,7 +95,7 @@ if [ $MISSING_PROP = false ]; then
else
AUTHSTRING="-u $CURLUSER:$CURLPASSWORD"
fi
- curl --request GET -sL -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" $RESTURL$RESOURCE | jq '.'
+ curl --request GET -sL -k $AUTHSTRING -H "X-FromAppId: $XFROMAPPID" -H "X-TransactionId: $XTRANSID" -H "Accept: application/json" $RESTURL$RESOURCE | jq -M '.' | sed 's/\r//g'
RC=$?;
else
echo "usage: $0 resource"
diff --git a/aai-resources/src/main/scripts/dataSnapshot.sh b/aai-resources/src/main/scripts/increaseNodes.sh
index 0e54a46..ce84ad6 100644
--- a/aai-resources/src/main/scripts/dataSnapshot.sh
+++ b/aai-resources/src/main/scripts/increaseNodes.sh
@@ -1,15 +1,16 @@
-#!/bin/ksh
-#
+#!/bin/bash
+
+###
# ============LICENSE_START=======================================================
# org.onap.aai
# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,21 +18,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============LICENSE_END=========================================================
-#
-
-#
-# This script invokes the dataSnapshot java class passing an option to tell it to take
-# a snapshot of the database and store it as a single-line XML file.
-#
+###
COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
. ${COMMON_ENV_PATH}/common_functions.sh
+# TODO: There is a better way where you can pass in the function
+# and then let the common functions check if the function exist and invoke it
+# So this all can be templated out
start_date;
check_user;
-
source_profile;
-execute_spring_jar org.onap.aai.dbgen.DataSnapshot ${PROJECT_HOME}/resources/etc/appprops/dataSnapshot-logback.xml "JUST_TAKE_SNAPSHOT"
-
+execute_spring_jar org.onap.aai.IncreaseNodesTool ${PROJECT_HOME}/resources/logback.xml "$@"
end_date;
exit 0
diff --git a/aai-resources/src/main/scripts/install/addManualData.sh b/aai-resources/src/main/scripts/install/addManualData.sh
index 9a5bb59..016c5c3 100644
--- a/aai-resources/src/main/scripts/install/addManualData.sh
+++ b/aai-resources/src/main/scripts/install/addManualData.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
@@ -75,19 +75,8 @@ error_exit () {
rel="/"$1"/"
k=0
-if [ "$1" = "tenant_isolation" ]
-then
- CR_TEXT_PATH=`find $PROJECT_HOME/resources/etc/scriptdata/addmanualdata/tenant_isolation/cloud-region -name "*.txt" -print | sort -f`
- AZ_TEXT_PATH=`find $PROJECT_HOME/resources/etc/scriptdata/addmanualdata/tenant_isolation/availability-zone -name "*.txt" -print | sort -f`
- COMPLEX_TEXT_PATH=`find $PROJECT_HOME/resources/etc/scriptdata/addmanualdata/tenant_isolation/complex -name "*.txt" -print | sort -f`
- ZONE_TEXT_PATH=`find $PROJECT_HOME/resources/etc/scriptdata/addmanualdata/tenant_isolation/zone -name "*.txt" -print | sort -f`
- PSERVER_TEXT_PATH=`find $PROJECT_HOME/resources/etc/scriptdata/addmanualdata/tenant_isolation/pserver -name "*.txt" -print | sort -f`
- TEXT_PATH="${CR_TEXT_PATH} ${AZ_TEXT_PATH} ${COMPLEX_TEXT_PATH} ${ZONE_TEXT_PATH} ${PSERVER_TEXT_PATH}"
- COMMAND=${TEXT_PATH}
-else
- TEXT_PATH=$PROJECT_HOME/resources/etc/scriptdata/addmanualdata/*/*.txt
- COMMAND=`ls ${TEXT_PATH} | sort -f`
-fi
+TEXT_PATH=$PROJECT_HOME/resources/etc/scriptdata/addmanualdata/*/*.txt
+COMMAND=`ls ${TEXT_PATH} | sort -f`
ls ${TEXT_PATH} >/dev/null 2>&1
if [ $? -ne 0 ]
@@ -107,7 +96,8 @@ while IFS=\n read -r i
do
echo "##### Begin putTool for $i ##### from file $filepath" | tee -a $OUTFILE
resource=`echo $i | tr -d '\r'`
-$PROJECT_HOME/scripts/putTool.sh $resource $jsonfile 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource" $j $filepath
+errorcode=412
+$PROJECT_HOME/scripts/putTool.sh $resource $jsonfile $errorcode 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource" $j $filepath
echo "##### End putTool for $resource #####" | tee -a $OUTFILE
echo "Begin getTool for $resource" | tee -a $OUTFILE
$PROJECT_HOME/scripts/getTool.sh $resource >> $OUTFILE 2>&1 || error_exit "$i" $j $filepath
diff --git a/aai-resources/src/main/scripts/install/updateQueryData.sh b/aai-resources/src/main/scripts/install/updateQueryData.sh
deleted file mode 100644
index 27fa24b..0000000
--- a/aai-resources/src/main/scripts/install/updateQueryData.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-
-PROGNAME=$(basename $0)
-OUTFILE=$PROJECT_HOME/logs/misc/${PROGNAME}.log.$(date +\%Y-\%m-\%d)
-#OUTFILE=/c/temp/${PROGNAME}.log.$(date +\%Y-\%m-\%d)
-
-TS=$(date "+%Y-%m-%d %H:%M:%S")
-
-CHECK_USER="aaiadmin"
-userid=$( id | cut -f2 -d"(" | cut -f1 -d")" )
-if [ "${userid}" != $CHECK_USER ]; then
- echo "You must be $CHECK_USER to run $0. The id used $userid."
- exit 1
-fi
-
-error_exit () {
- echo "${PROGNAME}: failed for ${1:-"Unknown error"} on cmd $2" 1>&2
- echo "${PROGNAME}: failed for ${1:-"Unknown error"} on cmd $2" >> $OUTFILE
-# exit ${2:-"1"}
-}
-
-j=0
-for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/widget-model-json/*.json|sort -f`
-#for filepath in `ls /c/sources/aai/aaigitnew/bundleconfig-local/etc/scriptdata/widget-model-json/*.json|sort -f`
-do
-j=$(expr "$j" + 1)
-filename=$(basename $filepath)
-echo "Begin putTool for widget $filename" | tee -a $OUTFILE
-vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2`
-# last parameter will skip put if it exists
-resource=service-design-and-creation/models/model/$vers
-$PROJECT_HOME/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-#/c/sources/aai/aaigitnew/src/main/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-echo "End putTool for widget $filename" | tee -a $OUTFILE
-done
-
-j=0
-for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/named-query-json/*.json|sort -f`
-#for filepath in `ls /c/sources/aai/aaigitnew/bundleconfig-local/etc/scriptdata/named-query-json/*.json|sort -f`
-do
-j=$(expr "$j" + 1)
-filename=$(basename $filepath)
-echo "Begin putTool for named-query $filename" | tee -a $OUTFILE
-vers=`grep named-query-uuid $filepath|cut -d':' -f2|cut -d'"' -f2`
-# last parameter will skip put if it exists
-resource=service-design-and-creation/named-queries/named-query/$vers
-$PROJECT_HOME/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-#/c/sources/aai/aaigitnew/src/main/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-echo "End putTool for named-query $filename" | tee -a $OUTFILE
-done
-
-j=0
-for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/resource-model-json/*.json|sort -f`
-#for filepath in `ls /c/sources/aai/aaigitnew/bundleconfig-local/etc/scriptdata/resource-model-json/*.json|sort -f`
-do
-j=$(expr "$j" + 1)
-filename=$(basename $filepath)
-echo "Begin putTool for resource model $filename" | tee -a $OUTFILE
-vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2`
-# last parameter will skip put if it exists
-resource=service-design-and-creation/models/model/$vers
-$PROJECT_HOME/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-#/c/sources/aai/aaigitnew/src/main/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-echo "End putTool for resource model $filename" | tee -a $OUTFILE
-done
-
-j=0
-for filepath in `ls $PROJECT_HOME/bundleconfig/etc/scriptdata/service-model-json/*.json|sort -f`
-#for filepath in `ls /c/sources/aai/aaigitnew/bundleconfig-local/etc/scriptdata/service-model-json/*.json|sort -f`
-do
-j=$(expr "$j" + 1)
-filename=$(basename $filepath)
-echo "Begin putTool for service model $filename" | tee -a $OUTFILE
-vers=`grep model-invariant-id $filepath|cut -d':' -f2|cut -d'"' -f2`
-# last parameter will skip put if it exists
-resource=service-design-and-creation/models/model/$vers
-$PROJECT_HOME/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-#/c/sources/aai/aaigitnew/src/main/scripts/putTool.sh $resource $filepath 1 0 na 1 >> $OUTFILE 2>&1 || error_exit "$resource $filepath" $j
-echo "End putTool for service model $filename" | tee -a $OUTFILE
-done
-
-echo "$PROGNAME completed ${TS}" | tee -a $OUTFILE
-echo "See output and error file: $OUTFILE"
-
-exit 0
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
diff --git a/aai-resources/src/main/scripts/rshipTool.sh b/aai-resources/src/main/scripts/rshipTool.sh
index 3952d44..049ef2e 100644
--- a/aai-resources/src/main/scripts/rshipTool.sh
+++ b/aai-resources/src/main/scripts/rshipTool.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
diff --git a/aai-resources/src/main/scripts/run_Migrations.sh b/aai-resources/src/main/scripts/run_Migrations.sh
deleted file mode 100644
index 19dda2d..0000000
--- a/aai-resources/src/main/scripts/run_Migrations.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-###
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-
-# TODO: There is a better way where you can pass in the function
-# and then let the common functions check if the function exist and invoke it
-# So this all can be templated out
-start_date;
-check_user;
-source_profile;
-
-ARGS="-c ${PROJECT_HOME}/resources/etc/appprops/janusgraph-realtime.properties";
-
-if [ -f "$PROJECT_HOME/resources/application.properties" ]; then
- # Get the application properties file and look for all lines
- # starting with either jms dmaap or niws
- # Turn them into system properties and export JAVA_PRE_OPTS so
- # execute spring jar will get those values
- # This is only needed since dmaap is used by run_migrations
- JAVA_PRE_OPTS=$(egrep '^(dmaap|jms|niws)' $PROJECT_HOME/resources/application.properties | sed 's/^\(.*\)$/-D\1/g' | tr '\n' ' ');
- export JAVA_PRE_OPTS;
-fi;
-
-execute_spring_jar org.onap.aai.migration.MigrationController ${PROJECT_HOME}/resources/etc/appprops/migration-logback.xml ${ARGS} "$@"
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/schemaMod.sh b/aai-resources/src/main/scripts/schemaMod.sh
deleted file mode 100644
index c2d0c83..0000000
--- a/aai-resources/src/main/scripts/schemaMod.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# This script is used to correct mistakes made in the database schema.
-# It currently just allows you to change either the dataType and/or indexType on properties used by nodes.
-#
-# NOTE - Titan is not elegant in 0.5.3 about making changes to the schema. Bad properties never
-# actually leave the database, they just get renamed and stop getting used. So it is
-# really worthwhile to get indexes and dataTypes correct the first time around.
-# Note also - This script just makes changes to the schema that is currently live.
-# If you were to create a new schema in a brandy-new environment, it would look like
-# whatever ex5.json (as of June 2015) told it to look like. So, part of making a
-# change to the db schema should Always first be to make the change in ex5.json so that
-# future environments will have the change. This script is just to change existing
-# instances of the schema since schemaGenerator (as of June 2015) does not update things - it
-# just does the initial creation.
-#
-# Boy, this is getting to be a big comment section...
-#
-# To use this script, you need to pass four parameters:
-# propertyName -- the name of the property that you need to change either the index or dataType on
-# targetDataType -- whether it's changing or not, you need to give it: String, Integer, Boolean or Long
-# targetIndexInfo -- whether it's changing or not, you need to give it: index, noIndex or uniqueIndex
-# preserveDataFlag -- true or false. The only reason I can think of why you'd ever want to
-# set this to false would be maybe if you were changing to an incompatible dataType so didn't
-# want it to try to use the old data (and fail). But 99% of the time this will just be 'true'.
-#
-# Ie. schemaMod flavor-id String index true
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-start_date;
-check_user;
-
-if [ "$#" -ne 4 ]; then
- echo "Illegal number of parameters"
- echo "usage: $0 propertyName targetDataType targetIndexInfo preserveDataFlag"
- exit 1
-fi
-
-source_profile;
-execute_spring_jar org.onap.aai.dbgen.SchemaMod ${PROJECT_HOME}/resources/etc/appprops/schemaMod-logback.xml "$1 $2 $3 $4"
-if [ "$?" -ne "0" ]; then
- echo "Problem executing schemaMod "
- end_date;
- exit 1
-fi
-
-end_date;
-exit 0
diff --git a/aai-resources/src/main/scripts/uniquePropertyCheck.sh b/aai-resources/src/main/scripts/uniquePropertyCheck.sh
deleted file mode 100644
index 87f7aad..0000000
--- a/aai-resources/src/main/scripts/uniquePropertyCheck.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/ksh
-#
-# ============LICENSE_START=======================================================
-# org.onap.aai
-# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-
-#
-# The script invokes UniqueProperty java class to see if the passed property is unique in the db and if
-# not, to display where duplicate values are found.
-#
-# For example: uniquePropertyCheck.sh subscriber-name
-#
-
-COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
-. ${COMMON_ENV_PATH}/common_functions.sh
-start_date;
-check_user;
-source_profile;
-
-#execute_spring_jar org.onap.aai.util.UniquePropertyCheck ${PROJECT_HOME}/resources/etc/appprops/uniquePropertyCheck-logback.xml "$@"
-execute_spring_jar org.onap.aai.util.UniquePropertyCheck ${PROJECT_HOME}/resources/uniquePropertyCheck-logback.xml "$@"
-ret_code=$?
-if [ $ret_code != 0 ]; then
- end_date;
- exit $ret_code
-fi
-
-end_date;
-exit 0 \ No newline at end of file
diff --git a/aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh b/aai-resources/src/main/scripts/updatePem.sh
index 6e6ac6f..cb4ca8d 100644
--- a/aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh
+++ b/aai-resources/src/main/scripts/updatePem.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
###
# ============LICENSE_START=======================================================
diff --git a/aai-resources/src/main/scripts/updateTool.sh b/aai-resources/src/main/scripts/updateTool.sh
index 05377d6..c2b788d 100644
--- a/aai-resources/src/main/scripts/updateTool.sh
+++ b/aai-resources/src/main/scripts/updateTool.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh
+#!/bin/bash
#
# ============LICENSE_START=======================================================
# org.onap.aai
@@ -47,15 +47,18 @@ contains() {
display_usage() {
cat <<EOF
+Use the execTool starting 1806 for running the updateTool.sh in the format shown below:
+/opt/app/aai-resources/execTool.sh --debug ./updateTool.sh <node type> <update nodeURI> /tmp/updatepayload.json
+
Usage 1: updateTool.sh <node type> <update node URI> <property name>:<property value>
[,<property name>:<property value]* | where update node uri is the URI path for that node
for ex1: ./updateTool.sh pserver cloud-infrastructure/pservers/pserver/XXX prov-status:NEWSTATUS
ex2:./updateTool.sh pserver cloud-infrastructure/pservers/pserver/XXX 'prov-status:NEWSTATUS with space'
ex3:./updateTool.sh pserver cloud-infrastructure/pservers/pserver/XXX 'prov-status:NEWSTATUS,attribute2:value'
-Usage 2. using .json file for update: ./updateTool.sh <node type> <update node URI> /tmp/updatepayload.json
+Usage 2. using .json file for update: ./updateTool.sh <node type> <update nodeURI> /tmp/updatepayload.json
Ex: ./updateTool.sh pserver cloud-infrastructure/pservers/pserver/XXX /tmp/testpayload.json
-
+testpayload.json should be only under /tmp
EOF
}
@@ -93,7 +96,7 @@ fi
. /etc/profile.d/aai.sh
PROJECT_HOME=/opt/app/aai-resources
-prop_file=$PROJECT_HOME/bundleconfig/etc/appprops/aaiconfig.properties
+prop_file=$PROJECT_HOME/resources/etc/appprops/aaiconfig.properties
log_dir=$PROJECT_HOME/logs/misc
today=$(date +\%Y-\%m-\%d)
@@ -168,7 +171,7 @@ EOF
if [ $MISSING_PROP = false ]; then
if [ $USEBASICAUTH = false ]; then
- AUTHSTRING="--cert $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/bundleconfig/etc/auth/aaiClientPrivateKey.pem"
+ AUTHSTRING="--cert $PROJECT_HOME/resources/etc/auth/aaiClientPublicCert.pem --key $PROJECT_HOME/resources/etc/auth/aaiClientPrivateKey.pem"
else
AUTHSTRING="-u $CURLUSER:$CURLPASSWORD"
fi