summaryrefslogtreecommitdiffstats
path: root/huawei/vnfmadapter/VnfmadapterService
diff options
context:
space:
mode:
authorVictor Gao <victor.gao@huawei.com>2018-05-26 15:19:25 +0800
committerVictor Gao <victor.gao@huawei.com>2018-05-26 15:19:25 +0800
commit434aed3bb60a3bd591f66b02b004bb6f9c110dce (patch)
tree245e67b02950c8329b606858625ebadbcc3c5430 /huawei/vnfmadapter/VnfmadapterService
parenta97127783318ee42d800085ceb44dc361c02e3c3 (diff)
Update heal job response
Change-Id: I76c3b0b483d37953c0460e4100cecedf0ee50b61 Issue-ID: VFC-923 Signed-off-by: Victor Gao <victor.gao@huawei.com>
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java
index fc374b66..e56eef1f 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java
@@ -333,10 +333,26 @@ public class VnfRoa {
}
restJson.remove(Constant.RETCODE);
- restJson.put("jobId", vnfInstanceId + "_post");
+ //restJson.put("jobId", vnfInstanceId + "_post");
+ restJson.put("jobId", vnfInstanceId + ":heal");
return restJson.toString();
}
+ private String getHealJobBody(String jobId) {
+ LOG.warn("function=getHealJobBody");
+ JSONObject responseJson = new JSONObject();
+ JSONObject jobInfoJson = new JSONObject();
+ jobInfoJson.put("jobId", jobId);
+ responseJson.put("progress", "100");
+ responseJson.put("status", "finished");
+ responseJson.put("errorCode", "null");
+ responseJson.put("responseId", "100");
+ jobInfoJson.put("responsedescriptor", responseJson);
+
+ LOG.warn("function=getJobBody, jobInfoJson: {}", jobInfoJson);
+ return jobInfoJson.toString();
+ }
+
private String getJobBody(JSONObject restJson, String jobId) {
LOG.warn("function=getJobBody, restJson: {}", restJson);
JSONObject responseJson = new JSONObject();
@@ -419,6 +435,8 @@ public class VnfRoa {
if(flag.equalsIgnoreCase("no")) {
return getJobProcess(tmpJobId, vnfmId, resp, jobId);
+ } else if (flag.equalsIgnoreCase("heal")){
+ return getHealJobBody(jobId);
} else {
JSONObject restJson = vnfMgr.getJobFromVnfm(tmpJobId, vnfmId);