Updating scripts to support APEX CLI Tosca editor 92/92092/2
authora.sreekumar <ajith.sreekumar@est.tech>
Fri, 26 Jul 2019 13:02:44 +0000 (13:02 +0000)
committera.sreekumar <ajith.sreekumar@est.tech>
Fri, 26 Jul 2019 13:02:44 +0000 (13:02 +0000)
As per the new LifeCycle API, the policies are expected to be defined as
a ToscaServiceTemplate. Hence, the Apex CLIEditor is extended to support the tosca way.
Scripts to support these changes are added here.

Change-Id: I1d9e9607af10cbb258d5c9994342cc4622962a23
Issue-ID: POLICY-1885
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
packages/apex-pdp-package-full/src/main/package/scripts/apexApps.bat
packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh
packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.bat [new file with mode: 0644]
packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh [new file with mode: 0644]

index ad176ce..f0c343f 100644 (file)
@@ -1,5 +1,6 @@
 :: ============LICENSE_START=======================================================
 ::  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+::  Modifications Copyright (C) 2019 Nordix Foundation.
 :: ================================================================================
 :: Licensed under the Apache License, Version 2.0 (the "License");
 :: you may not use this file except in compliance with the License.
@@ -85,6 +86,7 @@ set APEX_APP_MAP[tpl-event-json]=java -Dlogback.configurationFile=%APEX_HOME%\et
 set APEX_APP_MAP[model-2-cli]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -cp %CLASSPATH% %_CONFIG% org.onap.policy.apex.tools.model.generator.model2cli.Model2CliMain
 set APEX_APP_MAP[rest-editor]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-editor-%_VERSION%-editor.jar
 set APEX_APP_MAP[cli-editor]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -cp %CLASSPATH% %_CONFIG% org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain
+set APEX_APP_MAP[cli-tosca-editor]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -cp %CLASSPATH% %_CONFIG% org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain
 set APEX_APP_MAP[engine]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -cp %CLASSPATH% %_CONFIG% org.onap.policy.apex.service.engine.main.ApexMain
 set APEX_APP_MAP[eng-deployment]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-deployment-%_VERSION%-deployment.jar
 set APEX_APP_MAP[eng-monitoring]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-monitoring-%_VERSION%-monitoring.jar
@@ -100,6 +102,7 @@ set APEX_APP_DESCR_MAP[tpl-event-json]=provides JSON templates for events genera
 set APEX_APP_DESCR_MAP[model-2-cli]=generates CLI Editor Commands from a policy model
 set APEX_APP_DESCR_MAP[rest-editor]=starts the APEX REST Editor inside a simple webserver
 set APEX_APP_DESCR_MAP[cli-editor]=runs the APEX CLI Editor
+set APEX_APP_DESCR_MAP[cli-tosca-editor]=runs the APEX CLI Tosca Editor
 set APEX_APP_DESCR_MAP[engine]=starts the APEX engine
 set APEX_APP_DESCR_MAP[eng-deployment]=starts the APEX deployment client in a simple webserver
 set APEX_APP_DESCR_MAP[eng-monitoring]=starts the APEX engine monitoring client in a simple webserver
index d0c2745..2654341 100755 (executable)
@@ -3,6 +3,7 @@
 #-------------------------------------------------------------------------------
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+#  Modifications Copyright (C) 2019 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -94,6 +95,7 @@ APEX_APP_MAP["tpl-event-json"]="java -Dlogback.configurationFile=$APEX_HOME/etc/
 APEX_APP_MAP["model-2-cli"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -cp ${CLASSPATH} $_config org.onap.policy.apex.tools.model.generator.model2cli.Model2ClMain"
 APEX_APP_MAP["rest-editor"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-editor-$_version-editor.jar"
 APEX_APP_MAP["cli-editor"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -cp ${CLASSPATH} $_config org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain"
+APEX_APP_MAP["cli-tosca-editor"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -cp ${CLASSPATH} $_config org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain"
 APEX_APP_MAP["engine"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -cp ${CLASSPATH} $_config org.onap.policy.apex.service.engine.main.ApexMain"
 APEX_APP_MAP["eng-deployment"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-deployment-$_version-deployment.jar"
 APEX_APP_MAP["eng-monitoring"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-monitoring-$_version-monitoring.jar"
@@ -110,6 +112,7 @@ APEX_APP_DESCR_MAP["tpl-event-json"]="provides JSON templates for events generat
 APEX_APP_DESCR_MAP["model-2-cli"]="generates CLI Editor Commands from a policy model"
 APEX_APP_DESCR_MAP["rest-editor"]="starts the APEX REST Editor inside a simple webserver"
 APEX_APP_DESCR_MAP["cli-editor"]="runs the APEX CLI Editor"
+APEX_APP_DESCR_MAP["cli-tosca-editor"]="runs the APEX CLI Tosca Editor"
 APEX_APP_DESCR_MAP["engine"]="starts the APEX engine"
 APEX_APP_DESCR_MAP["eng-deployment"]="starts the APEX deployment client in a simple webserver"
 APEX_APP_DESCR_MAP["eng-monitoring"]="starts the APEX engine monitoring client in a simple webserver"
diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.bat b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.bat
new file mode 100644 (file)
index 0000000..9424ea5
--- /dev/null
@@ -0,0 +1,52 @@
+:: ============LICENSE_START=======================================================
+::  Copyright (C) 2019 Nordix Foundation.
+:: ================================================================================
+:: 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.
+::
+:: SPDX-License-Identifier: Apache-2.0
+:: ============LICENSE_END=========================================================
+
+::
+:: Script to run the APEX CLI Tosca Editor, calls apexApps.bat
+::
+:: @package    org.onap.policy.apex
+:: @author     Ajith Sreekumar <ajith.sreekumar@est.tech>
+:: @version    v1.0.0
+
+::
+:: DO NOT CHANGE CODE BELOW, unless you know what you are doing
+::
+
+@echo off
+setlocal enableDelayedExpansion
+
+
+if defined APEX_HOME (
+    if exist "%APEX_HOME%\" (
+        set _dummy=dir
+    ) else (
+        echo[
+        echo Apex directory 'APEX_HOME' not a directory
+        echo Please set environment for 'APEX_HOME'
+        echo[
+        exit /b
+    )
+) else (
+    echo[
+    echo Apex directory 'APEX_HOME' not set
+    echo Please set environment for 'APEX_HOME'
+    echo[
+    exit /b
+)
+
+%APEX_HOME%\bin\apexApps.bat cli-tosca-editor %*
diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh
new file mode 100644 (file)
index 0000000..3ed51ec
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+#-------------------------------------------------------------------------------
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+#-------------------------------------------------------------------------------
+
+##
+## Script to run the APEX CLI Tosca Editor, calls apexApps.sh
+##
+## @package    org.onap.policy.apex
+## @author     Ajith Sreekumar <ajith.sreekumar@est.tech>
+## @version    v1.0.0
+
+if [ -z $APEX_HOME ]
+then
+    APEX_HOME="/opt/app/policy/apex-pdp"
+fi
+
+if [ ! -d $APEX_HOME ]
+then
+    echo
+    echo 'Apex directory "'$APEX_HOME'" not set or not a directory'
+    echo "Please set environment for 'APEX_HOME'"
+    exit
+fi
+
+$APEX_HOME/bin/apexApps.sh cli-tosca-editor $*