From 4c4412642e40a92bebd26f2966bc72619e16ae79 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Thu, 18 Jan 2018 02:25:31 -0500 Subject: Sync up the latest logging code changes Issue-ID: AAI-493 Change-Id: I778acf7726b1f9881dee62b128b1fbc457bf7a7e Signed-off-by: Venkata Harish K Kajur --- .../src/main/scripts/dynamicPayloadGenerator.sh | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 aai-resources/src/main/scripts/dynamicPayloadGenerator.sh (limited to 'aai-resources/src/main/scripts/dynamicPayloadGenerator.sh') diff --git a/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh b/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh new file mode 100644 index 0000000..c386bed --- /dev/null +++ b/aai-resources/src/main/scripts/dynamicPayloadGenerator.sh @@ -0,0 +1,101 @@ +#!/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/bundleconfig/etc/scriptdata/addmanualdata/tenant_isolation/' +# +# or +# dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -s false -c '/opt/app/aai-resources/bundleconfig/etc/appprops/dynamic.properties' +# -o '/opt/app/aai-resources/bundleconfig/etc/scriptdata/addmanualdata/tenant_isolation/' -f PAYLOAD -n '/opt/app/aai-resources/bundleconfig/etc/scriptdata/nodes.json' +# + + +echo +echo `date` " Starting $0" + +display_usage() { + cat < -o + 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/bundleconfig/etc/scriptdata/addmanualdata/tenant_isolation/' + + dynamicPayloadGenerator.sh -d '/opt/app/snapshots/snaphot.graphSON' -s false -c '/opt/app/aai-resources/bundleconfig/etc/appprops/dynamic.properties' + -o '/opt/app/aai-resources/bundleconfig/etc/scriptdata/addmanualdata/tenant_isolation/' -f PAYLOAD -n '/opt/app/aai-resources/bundleconfig/etc/scriptdata/nodes.json' + +EOF +} +if [ $# -eq 0 ]; then + display_usage + exit 1 +fi + + + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DBUNDLECONFIG_DIR=bundleconfig -DAJSC_HOME=$PROJECT_HOME \ + -Daai.home=$PROJECT_HOME -Dlogback.configurationFile=$PROJECT_HOME/bundleconfig/etc/appprops/dynamicPayloadGenerator-logback.xml -Xmx9000m -Xms9000m \ + org.onap.aai.dbgen.DynamicPayloadGenerator "$@" + + +echo `date` " Done $0" + +exit 0 -- cgit 1.2.3-korg