[SDC-29] Amdocs OnBoard 1707 initial commit.

Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370
Signed-off-by: AviZi <avi.ziv@amdocs.com>
diff --git a/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py
index 7d6e32e..7f513af 100644
--- a/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py
+++ b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py
@@ -4,7 +4,7 @@
 #
 # action_library_client.py
 #
-# A command-line client for the SDC Action Library.
+# A command-line client for the ASDC Action Library.
 #
 #
 # Usage:
@@ -60,14 +60,14 @@
 #   - ALC_HTTP_INSECURE - allow untrusted SSL (server) connections.
 #   - ALC_TIMEOUT_SECONDS - invocation (e.g. HTTP) timeout in seconds.
 #   - ALC_JSON_DELIMITER - JSON delimiter in ouput.
-#   - ALC_ECOMP_INSTANCE_ID - X-ECOMP-InstanceID header
+#   - ALC_ECOMP_INSTANCE_ID - X-OPENECOMP-InstanceID header
 #
 # Configuration by 0600-mode INI file (section "action_library_client") is preferred.
 #
 # See:
 #    http://10.147.97.199:8080/api-docs/ - REST API Swagger docs
 #    https://www.python.org/dev/peps/pep-0008/ - style guide
-#    ../doc/SDC_Action_Lib_API_AID_1610_13.pdf - REST API dev guide
+#    ../doc/ASDC_Action_Lib_API_AID_1610_13.pdf - REST API dev guide
 #
 # Version history:
 # - 1.0.0 November 28th 2016, LP, initial impl.
@@ -102,7 +102,7 @@
     VERSION = "1.1.0"
     APPLICATION = "action_library_client"
     ACTIONS_URI = "onboarding-api/workflow/v1.0/actions"
-    ECOMP_INSTANCE_ID = "sdc_alc"
+    ECOMP_INSTANCE_ID = "asdc_alc"
     TIMEOUT_SECONDS_DEFAULT = 30
     JSON_DELIMITER_DEFAULT = "----------"
     LOG_FORMAT = "%(name)s\t%(levelname)s\t%(asctime)s\t%(message)s"
@@ -428,8 +428,8 @@
                 "Content-Type": "application/json",
                 "Accept": "application/json",
                 "Authorization": "Basic {0}".format(self.get_basic_credentials()),
-                "X-ECOMP-InstanceID": Constants.ECOMP_INSTANCE_ID,
-                "X-ECOMP-RequestID": IRESTClient.new_uuid()
+                "X-OPENECOMP-InstanceID": Constants.ECOMP_INSTANCE_ID,
+                "X-OPENECOMP-RequestID": IRESTClient.new_uuid()
             }
 
             handler = urllib2.HTTPHandler
@@ -520,8 +520,8 @@
         cmd.extend(["--header", "Accept: application/json"])
         cmd.extend(["--header", "Content-Type: application/json"])
         cmd.extend(["--header", "Authorization: Basic {0}".format(self.get_basic_credentials())])
-        cmd.extend(["--header", "X-ECOMP-InstanceID: {0}".format(Constants.ECOMP_INSTANCE_ID)])
-        cmd.extend(["--header", "X-ECOMP-RequestID: {0}".format(IRESTClient.new_uuid())])
+        cmd.extend(["--header", "X-OPENECOMP-InstanceID: {0}".format(Constants.ECOMP_INSTANCE_ID)])
+        cmd.extend(["--header", "X-OPENECOMP-RequestID: {0}".format(IRESTClient.new_uuid())])
         if extra_args:
             for extra_arg in extra_args:
                 cmd.append(extra_arg)
diff --git a/openecomp-be/tools/build/scripts/action_library_client/doc/ASDC_Action_Lib_API_AID_1610_13.pdf b/openecomp-be/tools/build/scripts/action_library_client/doc/ASDC_Action_Lib_API_AID_1610_13.pdf
new file mode 100644
index 0000000..966cbd9
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/action_library_client/doc/ASDC_Action_Lib_API_AID_1610_13.pdf
Binary files differ
diff --git a/openecomp-be/tools/build/scripts/cassandra-commands.json b/openecomp-be/tools/build/scripts/cassandra-commands.json
index 8354ff2..3a60624 100644
--- a/openecomp-be/tools/build/scripts/cassandra-commands.json
+++ b/openecomp-be/tools/build/scripts/cassandra-commands.json
@@ -12,12 +12,12 @@
     "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, version frozen<version>, fg_id text, name text, description text, part_num text, ep_ids set<text>, lkg_ids set<text>, ref_la_ids set<text>, PRIMARY KEY ((vlm_id, version), fg_id))",
     "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text, version frozen<version>, lkg_id text,name text,description text, type text, operational_scope frozen<multi_choice_or_other>, ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), lkg_id))",
     "entitlement_pool": "CREATE TABLE IF NOT EXISTS entitlement_pool (vlm_id text, version frozen<version>, ep_id text,name text,description text,threshold float,threshold_unit text,entitlement_metric frozen<choice_or_other>,increments text,aggregation_func frozen<choice_or_other>, operational_scope frozen<multi_choice_or_other>, time frozen<choice_or_other>,manufacturer_ref_num text,ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), ep_id))",
-    "vsp_information": "CREATE TABLE IF NOT EXISTS vsp_information (VSP_ID text, version frozen<version>, NAME text,DESCRIPTION text,CATEGORY text,SUB_CATEGORY text,ICON text,PACKAGE_NAME text,PACKAGE_VERSION text,vendor_name text, vendor_id text,LICENSE_AGREEMENT text,FEATURE_GROUPS list<text>,VALIDATION_DATA text,CONTENT_DATA blob, questionnaire_data text, vlm_version frozen<version>, PRIMARY KEY ((VSP_ID, version)))",
+    "vsp_information": "CREATE TABLE IF NOT EXISTS vsp_information (VSP_ID text, version frozen<version>, NAME text,DESCRIPTION text,CATEGORY text,SUB_CATEGORY text,ICON text,PACKAGE_NAME text,PACKAGE_VERSION text,vendor_name text, vendor_id text,LICENSE_AGREEMENT text,FEATURE_GROUPS list<text>,VALIDATION_DATA text,CONTENT_DATA blob, questionnaire_data text, vlm_version frozen<version>, is_old_version text, PRIMARY KEY ((VSP_ID, version)))",
     "package_details": "CREATE TABLE IF NOT EXISTS package_details (VSP_ID text, version frozen<version>,DISPLAY_NAME text,vsp_name text,vsp_description text,VENDOR_NAME text,CATEGORY text,SUB_CATEGORY text,VENDOR_RELEASE text,PACKAGE_CHECKSUM text,PACKAGE_TYPE text,TRANSLATE_CONTENT blob,PRIMARY KEY ((VSP_ID, version)))",
     "vsp_network": "CREATE TABLE IF NOT EXISTS vsp_network (vsp_id text, version frozen<version>, network_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), network_id))",
     "vsp_component": "CREATE TABLE IF NOT EXISTS vsp_component (vsp_id text, version frozen<version>, component_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id))",
     "vsp_component_nic": "CREATE TABLE IF NOT EXISTS vsp_component_nic (vsp_id text, version frozen<version>, component_id text, nic_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, nic_id))",
-    "vsp_process" : "CREATE TABLE IF NOT EXISTS vsp_process (vsp_id text, version frozen<version>, component_id text, process_id text, name text, description text, artifact_name text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, process_id))",
+    "vsp_process" : "CREATE TABLE IF NOT EXISTS vsp_process (vsp_id text, version frozen<version>, component_id text, process_id text, name text, description text, type text, artifact_name text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, process_id))",
     "vsp_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_service_artifact (vsp_id text, version frozen<version>, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
     "vsp_service_template" : "CREATE TABLE IF NOT EXISTS vsp_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
     "vsp_enriched_service_template" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
@@ -32,7 +32,11 @@
     "ecomp_component": "CREATE TABLE IF NOT EXISTS dox.ecompcomponent(id text PRIMARY KEY, name text)",
     "vsp_component_artifact": "CREATE TABLE IF NOT EXISTS vsp_component_artifact (vsp_id text, version frozen<version>, component_id text, artifact_type text, artifact_id text, name text, description text, artifact blob,  PRIMARY KEY ((vsp_id, version), component_id, artifact_type, artifact_id))",
     "name_index": "CREATE INDEX IF NOT EXISTS action_name ON dox.Action (name)",
-    "action_artifact":"CREATE TABLE IF NOT EXISTS action_artifact(artifactuuid text, effective_version int, artifact blob, PRIMARY KEY(artifactuuid, effective_version)) WITH CLUSTERING ORDER BY (effective_version DESC)"
+    "action_artifact":"CREATE TABLE IF NOT EXISTS action_artifact(artifactuuid text, effective_version int, artifact blob, PRIMARY KEY(artifactuuid, effective_version)) WITH CLUSTERING ORDER BY (effective_version DESC)",
+    "vsp_orchestration_template_candidate" : "CREATE TABLE IF NOT EXISTS vsp_orchestration_template_candidate (vsp_id text, version frozen<version>, files_data_structure text, content_data blob, PRIMARY KEY ((vsp_id, version)))",
+    "vsp_component_dependency_model" : "CREATE TABLE IF NOT EXISTS vsp_component_dependency_model (vsp_id text, version frozen<version>, dependency_id text, sourcecomponent_id text, targetcomponent_id text, relation text, PRIMARY KEY ((vsp_id, version), dependency_id))",
+    "activity_log" : "CREATE TABLE IF NOT EXISTS activity_log (item_id text, version_id text, activity_id text, type text, user text, timestamp timestamp, success boolean, message text, comment text, PRIMARY KEY (item_id, version_id, activity_id))",
+    "migration": "CREATE TABLE IF NOT EXISTS migration (id text, ismigrated boolean, primary key(id))"
   },
   "drop": {
     "version_info": "DROP TABLE IF EXISTS version_info",
@@ -65,12 +69,21 @@
     "name_index" : "DROP INDEX IF EXISTS dox.action_name",
     "ecomp_component": "DROP TABLE IF EXISTS dox.ecompcomponent",
     "vsp_component_artifact": "DROP TABLE IF EXISTS dox.vsp_component_artifact",
-    "action_artifact":"DROP TABLE IF EXISTS action_artifact"
+    "action_artifact":"DROP TABLE IF EXISTS action_artifact",
+    "vsp_orchestration_template_candidate":"DROP TABLE IF EXISTS vsp_orchestration_template_candidate",
+    "vsp_component_dependency_model":"DROP TABLE IF EXISTS vsp_component_dependency_model",
+    "activity_log": "DROP TABLE IF EXISTS activity_log",
+    "migration": "DROP TABLE IF EXISTS migration"
   },
   "alter": {
     "vsp_information": "ALTER TABLE vsp_information ADD questionnaire_data text",
     "vsp_information_1": "ALTER TABLE vsp_information ADD vlm_version frozen<version>",
+    "vsp_process": "ALTER TABLE vsp_process ADD type text",
     "entitlement_pool": "alter table entitlement_pool ADD version_uuid text",
-    "license_key_group": "alter table license_key_group ADD version_uuid text"
+    "license_key_group": "alter table license_key_group ADD version_uuid text",
+    "application_config": "delete from application_config where namespace='vsp.monitoring' and key = 'component.ceilometer'"
+  },
+  "actions": {
+    "truncate_configuration": "truncate configuration"
   }
 }
diff --git a/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh
index e4e1ff0..ad3e6ad 100644
--- a/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh
+++ b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh
@@ -15,7 +15,7 @@
 ###
 ###
 ### Author: Avi Ziv
-### Version 1.0 for OPENECOMP
+### Version 1.0
 ### Date: 10 Aug 2016
 ###
 ##############################################################################
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh
index 827b3ab..1f3ae3b 100644
--- a/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh
@@ -12,7 +12,7 @@
 ###
 ###
 ### Author: Avi Ziv
-### Version 2.0 for OPENECOMP
+### Version 2.0
 ### Date: 21 Sep 2016
 ###
 ##############################################################################
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh
index ddbf846..f0f1da0 100644
--- a/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh
@@ -12,7 +12,7 @@
 ###
 ###
 ### Author: Avi Ziv
-### Version 1.0 for OPENECOMP
+### Version 1.0
 ### Date: 21 Sep 2016
 ###
 ##############################################################################
diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh
index 65af5a5..0221b20 100644
--- a/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh
+++ b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh
@@ -12,8 +12,8 @@
 ###
 ###
 ### Author: Avi Ziv
-### Version 2.0 for OPENECOMP
-### Date: 21 Sep 2016, added support for keyspace yes/no for OPENECOMP DevOps build
+### Version 2.0
+### Date: 21 Sep 2016, added support for keyspace yes/no for DevOps build
 ###
 ##############################################################################
 
@@ -31,7 +31,6 @@
         fi
         echo "USE dox;"
         $RUN_PATH/parse-json.py -t create -f $1
-
 }
 
 #### Functions - End    ####
diff --git a/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json b/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json
new file mode 100644
index 0000000..1395fec
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json
@@ -0,0 +1,20 @@
+{
+  "create": {
+    "item": "CREATE TABLE IF NOT EXISTS item (item_id text primary key, item_info text, creation_time timestamp, modification_time timestamp)",
+    "version": "CREATE TABLE IF NOT EXISTS version (space text, item_id text, version_id text,base_version_id text,info text,relations text,creation_time timestamp,modification_time timestamp,PRIMARY KEY (( space, item_id ), version_id))",
+    "version_elements": "CREATE TABLE IF NOT EXISTS version_elements (space text,item_id text,version_id text,element_ids set<text>,PRIMARY KEY (( space, item_id, version_id )))",
+    "element_namespace": "CREATE TABLE IF NOT EXISTS element_namespace (space text, item_id text, element_id text, namespace text, PRIMARY KEY ((space, item_id, element_id)))",
+    "element": "CREATE TABLE IF NOT EXISTS element (space text,item_id text,version_id text,element_id text,parent_id text,namespace text,info text,relations text,data blob,searchable_data blob,visualization blob,sub_element_ids set<text>,PRIMARY KEY (( space, item_id, version_id, element_id )))"
+  },
+  "drop": {
+    "item": "DROP TABLE IF EXISTS item",
+    "version": "DROP TABLE IF EXISTS version",
+    "version_elements": "DROP TABLE IF EXISTS version_elements",
+    "element_namespace": "DROP TABLE IF EXISTS element_namespace",
+    "element": "DROP TABLE IF EXISTS element"
+  },
+  "alter": {
+  },
+  "actions": {
+  }
+}
diff --git a/openecomp-be/tools/build/scripts/zusammen-generate-cassandra-init-cql.sh b/openecomp-be/tools/build/scripts/zusammen-generate-cassandra-init-cql.sh
new file mode 100644
index 0000000..b215fb3
--- /dev/null
+++ b/openecomp-be/tools/build/scripts/zusammen-generate-cassandra-init-cql.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+##############################################################################
+###
+### zusammen-generate-cassandra-init-cql.sh
+###
+### A script that generates the CQL commands of CREATE for the Cassnadra init for the Zusammen keyspace.
+###
+### Usage:
+###
+###    ./zusammen-generate-cassandra-init-cql.sh cassandra-commands.json
+###
+###
+### Author: Avi Ziv
+### Version 1.0
+### Date: 23 Apr 2017, first version for Zusammen
+###
+##############################################################################
+
+#GLOBALS
+KEYSPACE_ZUSAMMEN=zusammen_dox
+
+RUN_PATH=$(cd "$(dirname "$0")" && pwd)
+
+#### Functions - Start  ####
+usage() { echo "Usage: $0 <db-cql-json-file> keyspace yes/no, for example: $0 cassandra-commands.json keyspace yes" 1>&2; exit 1; }
+
+main()
+{
+        if [ $3 == 'yes' ]; then
+            echo "CREATE KEYSPACE IF NOT EXISTS $KEYSPACE_ZUSAMMEN WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };"
+        fi
+        echo "USE $KEYSPACE_ZUSAMMEN;"
+        $RUN_PATH/parse-json.py -t create -f $1
+}
+
+#### Functions - End    ####
+
+# Check arguements
+if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
+        usage
+fi
+
+main $1 $2 $3