summaryrefslogtreecommitdiffstats
path: root/openecomp-be/tools/build/scripts
diff options
context:
space:
mode:
authorAviZi <avi.ziv@amdocs.com>2017-06-09 02:39:56 +0300
committerAviZi <avi.ziv@amdocs.com>2017-06-09 02:39:56 +0300
commit280f8015d06af1f41a3ef12e8300801c7a5e0d54 (patch)
tree9c1d3978c04cd28068f02073038c936bb49ca9e0 /openecomp-be/tools/build/scripts
parentfd3821dad11780d33c5373d74c957c442489945e (diff)
[SDC-29] Amdocs OnBoard 1707 initial commit.
Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370 Signed-off-by: AviZi <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-be/tools/build/scripts')
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/action_library_client.py16
-rw-r--r--openecomp-be/tools/build/scripts/action_library_client/doc/ASDC_Action_Lib_API_AID_1610_13.pdfbin0 -> 1619194 bytes
-rw-r--r--openecomp-be/tools/build/scripts/cassandra-commands.json23
-rw-r--r--openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh2
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh2
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh2
-rw-r--r--openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh5
-rw-r--r--openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json20
-rw-r--r--openecomp-be/tools/build/scripts/zusammen-generate-cassandra-init-cql.sh44
9 files changed, 95 insertions, 19 deletions
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 7d6e32e4a8..7f513afe86 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 @@ class Constants(object):
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 @@ class NativeRESTClient(IRESTClient):
"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 @@ class CURLRESTClient(IRESTClient):
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 0000000000..966cbd9447
--- /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 8354ff2532..3a606241bd 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 e4e1ff0075..ad3e6ad43d 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 827b3ab330..1f3ae3becb 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 ddbf846b30..f0f1da0eaf 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 65af5a51ae..0221b20a43 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 @@ main()
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 0000000000..1395fec8f1
--- /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 0000000000..b215fb3ce7
--- /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