From 434aed3bb60a3bd591f66b02b004bb6f9c110dce Mon Sep 17 00:00:00 2001 From: Victor Gao Date: Sat, 26 May 2018 15:19:25 +0800 Subject: Update heal job response Change-Id: I76c3b0b483d37953c0460e4100cecedf0ee50b61 Issue-ID: VFC-923 Signed-off-by: Victor Gao --- .../vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'huawei/vnfmadapter/VnfmadapterService') 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); -- cgit 1.2.3-korg