diff options
author | liuqian <liuqian13@huawei.com> | 2018-05-25 12:56:50 +0800 |
---|---|---|
committer | liuqian <liuqian13@huawei.com> | 2018-05-25 12:56:50 +0800 |
commit | 3deb44ab5e917eeab3313166f374fae6bf095dde (patch) | |
tree | 0f13bf1323beb249bc13edb25eb98c579436ed3b /huawei/vnfmadapter/VnfmadapterService | |
parent | 4d197a486a575d2e5a80af913a268b5922dee36c (diff) |
fix bug
Change-Id: Ibcdaf2f1cd7808e0ef515ca17a17b07bfc4b0ae0
Issue-ID: VFC-923
Signed-off-by: liuqian <liuqian13@huawei.com>
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService')
3 files changed, 14 insertions, 4 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java index 7b5c1baf..cf0e3b39 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java @@ -359,18 +359,22 @@ public class VnfMgr { JSONObject jobInfoJson = new JSONObject(); JSONObject jobInfo = restJson.getJSONObject("data").getJSONObject("job_info"); jobInfoJson.put("jobId", jobInfo.getString("job_id") + ":job"); - responseJson.put("progress", jobInfo.getString("task_progress_rate")); + String taskProgress = jobInfo.getString("task_progress_rate"); + responseJson.put("progress", taskProgress); + int responseId = Integer.parseInt(taskProgress); String taskStatus = jobInfo.getString("task_status"); if(taskStatus.equalsIgnoreCase("Successfully") || taskStatus.equalsIgnoreCase("finished")) { responseJson.put("status", "finished"); + responseId++; } else if(taskStatus.equalsIgnoreCase("Failed")) { responseJson.put("status", "error"); + responseId++; } else { responseJson.put("status", "processing"); } responseJson.put("errorCode", jobInfo.getString("error_code")); - responseJson.put("responseId", jobInfo.getString("task_progress_rate")); + responseJson.put("responseId", String.valueOf(responseId)); jobInfoJson.put("responsedescriptor", responseJson); LOG.warn("function=getJobBody, jobInfoJson: {}", jobInfoJson); return jobInfoJson.toString(); diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java index c16f0730..dbd87301 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java @@ -124,9 +124,15 @@ public class VnfResourceRoa { if(1 == dataObject.getInt("event_type")) { changeType = "added"; operation = "Instantiate"; - } else { + } else if(4 == dataObject.getInt("event_type")) { changeType = "removed"; operation = "Terminal"; + } else if(3 == dataObject.getInt("event_type")) { + changeType = "added"; + operation = "Scaleout"; + } else if(2 == dataObject.getInt("event_type")) { + changeType = "removed"; + operation = "Scalein"; } String vnfInstanceId = dataObject.getString("vnf_id"); for(int i = 0; i < vmList.size(); i++) { 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 15786b66..fc374b66 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 @@ -302,7 +302,7 @@ public class VnfRoa { * "affectedvm": { * "vmid": "804cca71 - 9ae9 - 4511 - 8e30 - d1387718caff", * "vduid": "vdu_100", - * "vmname": "ZTE_SSS_111_PP_2_L" + * "vmname": "SBC_111_PP_2_L" * } * } * @param resp |