summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrb7147 <rb7147@att.com>2017-10-26 14:14:29 -0400
committerrb7147 <rb7147@att.com>2017-10-26 14:14:41 -0400
commit381e7a284bfa5dfb6dd2325b573f6f3e5f349019 (patch)
tree8b3deb26a5c5028dd0f65cd65a978f0e08b09565
parent80fe81ee3f629deca919b3102ba2fcd88c667622 (diff)
Updated the DB Script with New TOSCA model
Added the caching issue while uploading the model to db. Issue-ID: POLICY-372 Change-Id: I10bfcead0a5cbcb1484858a79976b7c86fba3ece Signed-off-by: rb7147 <rb7147@att.com>
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java8
-rw-r--r--packages/base/src/files/install/mysql/data/171001_upgrade_script.sql2
2 files changed, 9 insertions, 1 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
index 0f55ba6ec..b349adacb 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java
@@ -1379,6 +1379,14 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController {
@RequestMapping(value={"/ms_dictionary/set_MSModelData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
public void SetMSModelData(HttpServletRequest request, HttpServletResponse response) throws IOException, FileUploadException{
+ modelList = new ArrayList<>();
+ dirDependencyList = new ArrayList<>();
+ classMap = new HashMap<>();
+ retmap = new HashMap<>();
+ uniqueKeys= new HashSet<>();
+ uniqueDataKeys= new HashSet<>();
+ dataListBuffer=new StringBuilder();
+ dataConstraints= new ArrayList <>();
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
boolean zip = false;
boolean yml= false;
diff --git a/packages/base/src/files/install/mysql/data/171001_upgrade_script.sql b/packages/base/src/files/install/mysql/data/171001_upgrade_script.sql
index f1a3e9096..8c61c91a8 100644
--- a/packages/base/src/files/install/mysql/data/171001_upgrade_script.sql
+++ b/packages/base/src/files/install/mysql/data/171001_upgrade_script.sql
@@ -28,4 +28,4 @@ CREATE TABLE `onap_sdk`.`rainydaytreatments` (
PRIMARY KEY (`id`)
);
-INSERT INTO `onap_sdk`.`microservicemodels` (`id`, `modelName`, `DESCRIPTION`, `Dependency`, `imported_by`, `attributes`, `ref_attributes`, `sub_attributes`, `version`) VALUES ('3', 'policy_tosca_tca', 'Micro Service Policy Tosca model', '[]', 'API', 'policyVersion=string:defaultValue-:required-true:MANY-false,policyName=string:defaultValue-:required-true:MANY-false,controlLoopSchemaType=string:defaultValue-:required-true:MANY-false,policyScope=string:defaultValue-:required-true:MANY-false,eventName=string:defaultValue-:required-true:MANY-false,', 'threshholds=Threshold:MANY-true,', '{\"Threshold\":{\"severity\":\"string:defaultValue-null:required-true:MANY-false\",\"fieldPath\":\"string:defaultValue-null:required-true:MANY-false\",\"thresholdValue\":\"integer:defaultValue-null:required-true:MANY-false\",\"closedLoopEventStatus\":\"string:defaultValue-null:required-true:MANY-false\",\"version\":\"string:defaultValue-1.0.2:required-true:MANY-false\",\"closedLoopControlName\":\"string:defaultValue-null:required-true:MANY-false\",\"direction\":\"string:defaultValue-null:required-true:MANY-false\"}}', '1.0.0');
+INSERT INTO `onap_sdk`.`microservicemodels` (`id`, `modelName`, `DESCRIPTION`, `Dependency`, `imported_by`, `attributes`, `ref_attributes`, `sub_attributes`, `version`, `enumValues`, `annotation`) VALUES ('1', 'tca_policy', 'MicroService TOSCA model', '[]', 'demo', '', 'tca_policy=tca_policy:MANY-false,', '{\"thresholds\":{\"severity\":\"string:defaultValue-null:required-null:MANY-false\",\"fieldPath\":\"string:defaultValue-null:required-null:MANY-false\",\"thresholdValue\":\"integer:defaultValue-null:required-null:MANY-false\",\"closedLoopEventStatus\":\"string:defaultValue-null:required-null:MANY-false\",\"closedLoopControlName\":\"string:defaultValue-null:required-null:MANY-false\",\"version\":\"string:defaultValue-null:required-null:MANY-false\",\"direction\":\"string:defaultValue-null:required-null:MANY-false\"},\"tca_policy\":{\"domain\":\"string:defaultValue-null:required-null:MANY-false\",\"metricsPerEventName\":\"metricsPerEventName:MANY-true\"},\"metricsPerEventName\":{\"policyVersion\":\"string:defaultValue-null:required-null:MANY-false\",\"thresholds\":\"thresholds:MANY-true\",\"policyName\":\"string:defaultValue-null:required-null:MANY-false\",\"controlLoopSchemaType\":\"string:defaultValue-null:required-null:MANY-false\",\"policyScope\":\"string:defaultValue-null:required-null:MANY-false\",\"eventName\":\"string:defaultValue-null:required-null:MANY-false\"}}', '1.1.0', '', '');