summaryrefslogtreecommitdiffstats
path: root/engine-d/src/main/java/org
diff options
context:
space:
mode:
author6092002067 <wu.youbo@zte.com.cn>2017-03-13 16:47:53 +0800
committer6092002067 <wu.youbo@zte.com.cn>2017-03-13 16:50:24 +0800
commitd2e00336e824c6fe34d33f2e7b8f18f956e1cdf8 (patch)
tree239e83e08f4e976cc58618d91ca74809c1d962cf /engine-d/src/main/java/org
parent8c3705448e558e0d4aed1b0bb152d437367c5b8e (diff)
Change the method returns the result
Change-Id: I2847f9b81d2b96214c56fe7188b4d6d94af60672 Issue-ID: HOLMES-47 Signed-off-by: youbowu <wu.youbo@zte.com.cn>
Diffstat (limited to 'engine-d/src/main/java/org')
-rw-r--r--engine-d/src/main/java/org/openo/holmes/engine/resources/EngineResources.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/engine-d/src/main/java/org/openo/holmes/engine/resources/EngineResources.java b/engine-d/src/main/java/org/openo/holmes/engine/resources/EngineResources.java
index c125d07..0025695 100644
--- a/engine-d/src/main/java/org/openo/holmes/engine/resources/EngineResources.java
+++ b/engine-d/src/main/java/org/openo/holmes/engine/resources/EngineResources.java
@@ -33,7 +33,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import lombok.extern.slf4j.Slf4j;
-import net.sf.json.JSONObject;
import org.jvnet.hk2.annotations.Service;
import org.openo.holmes.common.api.entity.ServiceRegisterEntity;
import org.openo.holmes.common.config.MicroServiceConfig;
@@ -72,8 +71,8 @@ public class EngineResources {
@ApiOperation(value = "Add rule to Engine and Cache", response = CorrelationRuleResponse.class)
@Produces(MediaType.APPLICATION_JSON)
@Timed
- public String deployRule(DeployRuleRequest deployRuleRequest,
- @Context HttpServletRequest httpRequest) {
+ public CorrelationRuleResponse deployRule(DeployRuleRequest deployRuleRequest,
+ @Context HttpServletRequest httpRequest) {
CorrelationRuleResponse crResponse = new CorrelationRuleResponse();
Locale locale = LanguageUtil.getLocale(httpRequest);
@@ -88,7 +87,7 @@ public class EngineResources {
throw ExceptionUtil.buildExceptionResponse(correlationException.getMessage());
}
- return JSONObject.fromObject(crResponse).toString();
+ return crResponse;
}
@DELETE
@@ -97,7 +96,7 @@ public class EngineResources {
@Timed
@Path("/{packageName}")
public boolean undeployRule(@PathParam("packageName") String packageName,
- @Context HttpServletRequest httpRequest) {
+ @Context HttpServletRequest httpRequest) {
Locale locale = LanguageUtil.getLocale(httpRequest);
@@ -118,7 +117,7 @@ public class EngineResources {
@Produces(MediaType.APPLICATION_JSON)
@Timed
public boolean compileRule(CompileRuleRequest compileRuleRequest,
- @Context HttpServletRequest httpRequest) {
+ @Context HttpServletRequest httpRequest) {
Locale locale = LanguageUtil.getLocale(httpRequest);
@@ -138,7 +137,7 @@ public class EngineResources {
serviceRegisterEntity.setVersion("v1");
serviceRegisterEntity.setUrl("/api/holmes-engine/v1");
serviceRegisterEntity.setSingleNode(MicroServiceConfig.getServiceIp(), "9102", 0);
- serviceRegisterEntity.setVisualRange("1");
+ serviceRegisterEntity.setVisualRange("1|0");
return serviceRegisterEntity;
}
}