diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-03-09 13:27:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@open-o.org> | 2017-03-09 13:27:34 +0000 |
commit | 292ecc8781b642f494638acc3595e33079303ced (patch) | |
tree | db69a64edd5ef9e43039bdce4f6d183c297ebb8c | |
parent | fe6e0e07f0cb2c78bfbd5dcf4ac7497273341bb2 (diff) | |
parent | 1c5dbb19bae635260fdd81615f57242c3ca85ec6 (diff) |
Merge "Add the static variable HTTP"
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()));
|