summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java8
-rw-r--r--ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverConfiguration.java14
-rw-r--r--ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml1
-rwxr-xr-xems/microservice-standalone/src/main/assembly/docker/instance_config.sh3
4 files changed, 21 insertions, 5 deletions
diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java
index 8d13d18..cda7982 100644
--- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java
+++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java
@@ -82,7 +82,7 @@ public class EmsDriverApplication extends Application<EmsDriverConfiguration> {
MsbConfiguration.setMsbAddress(configuration.getMsbAddress());
//MSB register
String registerFlag = configuration.getAutoServiceRegister();
- if ("false".equalsIgnoreCase(registerFlag)) {
+ if ("true".equalsIgnoreCase(registerFlag)) {
this.msbRegisteEmsDriverService(configuration);
}
//Start workThread
@@ -130,7 +130,7 @@ public class EmsDriverApplication extends Application<EmsDriverConfiguration> {
HttpConnectorFactory connector = (HttpConnectorFactory) simpleServerFactory.getConnector();
MsbRegisterVo registerVo = new MsbRegisterVo();
ServiceNodeVo serviceNode = new ServiceNodeVo();
- String ip = "";
+/* String ip = "";
try {
ip = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
@@ -138,8 +138,8 @@ public class EmsDriverApplication extends Application<EmsDriverConfiguration> {
}
if ("".equals(ip)) {
ip = connector.getBindHost();
- }
- serviceNode.setIp(ip);
+ }*/
+ serviceNode.setIp(configuration.getServiceIp());
serviceNode.setPort(String.valueOf(connector.getPort()));
serviceNode.setTtl(0);
diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverConfiguration.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverConfiguration.java
index 33bf306..3903903 100644
--- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverConfiguration.java
+++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverConfiguration.java
@@ -29,7 +29,9 @@ public class EmsDriverConfiguration extends Configuration {
@NotEmpty
private String defaultName = "EmsDriver-Stranger";
- @JsonProperty
+ private String serviceIp;
+
+ @JsonProperty
public String getMsbAddress() {
return msbAddress;
}
@@ -58,4 +60,14 @@ public class EmsDriverConfiguration extends Configuration {
public void setDefaultName(String name) {
this.defaultName = name;
}
+
+ @JsonProperty
+ public String getServiceIp() {
+ return serviceIp;
+ }
+
+ @JsonProperty
+ public void setServiceIp(String serviceIp) {
+ this.serviceIp = serviceIp;
+ }
}
diff --git a/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml b/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml
index 4259c54..6cde690 100644
--- a/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml
+++ b/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml
@@ -20,6 +20,7 @@ defaultName: EmsDriver-Stranger
#microservice Bus address
msbAddress: 10.74.205.123:80
autoServiceRegister: false
+serviceIp: 127.0.0.1
server:
type: simple
rootPath: '/api/emsdriver/v1/*'
diff --git a/ems/microservice-standalone/src/main/assembly/docker/instance_config.sh b/ems/microservice-standalone/src/main/assembly/docker/instance_config.sh
index 476c856..d856f57 100755
--- a/ems/microservice-standalone/src/main/assembly/docker/instance_config.sh
+++ b/ems/microservice-standalone/src/main/assembly/docker/instance_config.sh
@@ -10,6 +10,9 @@ PASSWORD=`echo $VES_AUTHINFO | cut -d: -f 2`
sed -i "s|msbAddress.*|msbAddress: $MSB_IP:$MSB_PORT|" emsdriver/conf/emsdriver.yml
sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" emsdriver/conf/emsdriver.yml
+if [ $SERVICE_IP ]; then
+ sed -i "s|serviceIp.*|serviceIp: $SERVICE_IP|" emsdriver/conf/emsdriver.yml
+fi
sed -i "s|msbAddress=.*|msbAddress=$MSB_IP:$MSB_PORT|" emsdriver/conf/config.properties
sed -i "s|event_api_url=.*|event_api_url=$VES_IP|" emsdriver/conf/config.properties
sed -i "s|port=.*|port=$VES_PORT|" emsdriver/conf/config.properties