diff options
author | youbowu <wu.youbo@zte.com.cn> | 2017-03-09 20:51:50 +0800 |
---|---|---|
committer | 6092002067 <wu.youbo@zte.com.cn> | 2017-03-09 20:51:50 +0800 |
commit | 1c5dbb19bae635260fdd81615f57242c3ca85ec6 (patch) | |
tree | 81a0461bd7ce0288f7f65ec8511978fde63e4c12 /holmes-actions/src/main | |
parent | 31c419d91ab4f6b5644e1cb9c7a477038fbd3dea (diff) |
Add the static variable HTTP
Issue-ID: HOLMES-50
Change-Id: I4fad7c622f4aada0657f60063f38ce3f624611a2
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main')
3 files changed, 4 insertions, 2 deletions
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java b/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java index 9c6ab3c..c17ad4a 100644 --- a/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java +++ b/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java @@ -28,7 +28,7 @@ public class MicroServiceConfig { }
public static String getMsbServerAddr() {
- return getProperty("MSB_ADDR") + ":" + AlarmConst.MICRO_SERVICE_PORT;
+ return AlarmConst.HTTP+getProperty("MSB_ADDR") + ":" + AlarmConst.MICRO_SERVICE_PORT;
}
public static String getServiceIp() {
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java index 40e15eb..9e83d4c 100644 --- a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java +++ b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java @@ -36,4 +36,6 @@ public interface AlarmConst { int MICRO_SERVICE_STATUS_SUCCESS = 201;
int MICRO_SERVICE_PORT = 8086;
+
+ String HTTP = "http://";
}
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java index 5e806e4..9f66178 100644 --- a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java +++ b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java @@ -40,7 +40,7 @@ public class MSBRegisterUtil { try {
ObjectMapper mapper = new ObjectMapper();
String content = mapper.writeValueAsString(entity);
- HttpPost httpPost = new HttpPost("http://" + MicroServiceConfig.getMsbServerAddr()
+ HttpPost httpPost = new HttpPost(MicroServiceConfig.getMsbServerAddr()
+ "/api/microservices/v1/services?createOrUpdate=false");
if (StringUtils.isNotEmpty(content)) {
httpPost.setEntity(new ByteArrayEntity(content.getBytes()));
|