Change the API Path 43/10543/2
authorGuangrong Fu <fu.guangrong@zte.com.cn>
Wed, 6 Sep 2017 09:52:01 +0000 (17:52 +0800)
committerGuangrong Fu <fu.guangrong@zte.com.cn>
Wed, 6 Sep 2017 12:23:27 +0000 (20:23 +0800)
Change the API path from onapapi to api

Change-Id: Ie607942ce1554f0e3bb0abf72c3ed6a2d54dacc9
Issue-ID: HOLMES-39
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
rulemgt-standalone/src/main/assembly/conf/rulemgt.yml
rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
rulemgt/src/main/java/org/onap/holmes/rulemgt/constant/RuleMgtConstant.java
rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleDao.java
rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java
rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java

index 0b9a24a..29d56d7 100644 (file)
@@ -9,7 +9,7 @@ apidescription: ZTE Holmes rule Management rest API
 
 server:
   type: simple
-  rootPath:  '/onapapi/holmes-rule-mgmt/v1/*'
+  rootPath:  '/api/holmes-rule-mgmt/v1/*'
   applicationContextPath: /
   adminContextPath: /admin
   connector:
@@ -50,7 +50,7 @@ database:
   driverClass: org.postgresql.Driver
   user: holmes
   password: holmespwd
-  url: jdbc:postgresql://169.254.59.196:5432/holmes
+  url: jdbc:postgresql://10.74.156.206:5432/holmes
   properties:
     charSet: UTF-8
   maxWaitForConnection: 1s
index 0aeb584..0ee539b 100644 (file)
@@ -58,7 +58,7 @@ public class RuleActiveApp extends IOCApplication<RuleAppConfig> {
         MicroServiceInfo msinfo = new MicroServiceInfo();
         msinfo.setServiceName("holmes-rule-mgmt");
         msinfo.setVersion("v1");
-        msinfo.setUrl("/onapapi/holmes-rule-mgmt/v1");
+        msinfo.setUrl("/api/holmes-rule-mgmt/v1");
         msinfo.setProtocol("REST");
         msinfo.setVisualRange("0|1");
         Set<Node> nodes = new HashSet<>();
index debfb05..a5ec87c 100644 (file)
@@ -24,6 +24,6 @@ public class RuleMgtConstant {
     public static final int STATUS_RULE_CLOSE = 0;\r
     public static final int STATUS_RULE_ALL = 2;\r
     public static final String PACKAGE = "package";\r
-    public static final String ENGINE_PATH = "/onapapi/holmes-engine-mgmt/v1/rule";\r
+    public static final String ENGINE_PATH = "/api/holmes-engine-mgmt/v1/rule";\r
     public static final int RESPONSE_STATUS_OK = 200;\r
 }\r
index 2a422c4..6b55d98 100644 (file)
@@ -31,9 +31,9 @@ public abstract class CorrelationRuleDao {
 \r
     @GetGeneratedKeys\r
     @SqlUpdate("INSERT INTO APLUS_RULE  (NAME,DESCRIPTION,ENABLE,TEMPLATEID,ENGINETYPE,CREATOR,UPDATOR,PARAMS,CONTENT ,VENDOR,CREATETIME,UPDATETIME,ENGINEID,PACKAGE,RID) VALUES (:name,:description,:enabled,:templateID,:engineType,:creator,:modifier,:params,:content,:vendor,:createTime,:updateTime,:engineID,:packageName,:rid)")\r
-    protected abstract int addRule(@BindBean CorrelationRule correlationRule);\r
+    protected abstract String addRule(@BindBean CorrelationRule correlationRule);\r
 \r
-    @SqlUpdate("UPDATE APLUS_RULE SET DESCRIPTION=:description,ENABLE=:enabled,CONTENT=:content,UPDATOR=:modifier,UPDATETIME=:updateTime WHERE RID=:rid")\r
+    @SqlUpdate("UPDATE APLUS_RULE SET DESCRIPTION=:description,ENABLE=:enabled,CONTENT=:content,UPDATOR=:modifier,UPDATETIME=:updateTime, PACKAGE=:packageName WHERE RID=:rid")\r
     protected abstract int updateRuleByRid(@BindBean CorrelationRule correlationRule);\r
 \r
     @SqlUpdate("DELETE FROM APLUS_RULE WHERE RID=:rid")\r
index 322006d..648be06 100644 (file)
@@ -69,7 +69,7 @@ public class CorrelationRuleQueryDao {
         correlationRule.setRid((String) value.get("rid"));\r
         correlationRule.setDescription((String) value.get("description"));\r
         correlationRule.setEnabled((Integer) value.get("enable"));\r
-        correlationRule.setTemplateID((Integer) value.get("templateID"));\r
+        correlationRule.setTemplateID((Long) value.get("templateID"));\r
         correlationRule.setEngineID((String) value.get("engineID"));\r
         correlationRule.setEngineType((String) value.get("engineType"));\r
         correlationRule.setCreator((String) value.get("creator"));\r
index 3854cdc..e028a2c 100644 (file)
@@ -131,7 +131,7 @@ public class CorrelationRuleQueryDaoTest {
         value.put("rid", "rule_" + System.currentTimeMillis());\r
         value.put("description", "desc");\r
         value.put("enable", 0);\r
-        value.put("templateID", 1);\r
+        value.put("templateID", 1L);\r
         value.put("engineId", "engine-001");\r
         value.put("engineType", "engineType-001");\r
         value.put("creator", "admin");\r