summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao Weitao <victor.gao@huawei.com>2018-02-07 04:07:10 +0000
committerGerrit Code Review <gerrit@onap.org>2018-02-07 04:07:10 +0000
commitbbe27313fe3e97e4106051e2dade049eb59f8239 (patch)
tree3901d651b0a7e3865e84bda93f3cbcb3e40c68e1
parent14b94e7f5f473bb303ac950d14666f42e427d15f (diff)
parent9e52c23ed5acc5f081f2fb289405be08e976a2a2 (diff)
Merge "Transfer data to nfv-lcm"
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java27
1 files changed, 27 insertions, 0 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 9e58d6bb..a4f0a697 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
@@ -319,4 +319,31 @@ public class VnfMgr {
restJson = (new VnfMgrVnfm()).healVnf(jsonObject, vnfmObjcet, vnfmId, vnfInstanceId);
return restJson;
}
+
+ public JSONObject getJobFromVnfm(String jobId, String vnfmId) {
+ LOG.warn("function=getJobFromVnfm, jobId:{}, vnfmId:{}", jobId, vnfmId);
+ JSONObject restJson = new JSONObject();
+ JSONObject vnfmObjcet = VnfmUtil.getVnfmById(vnfmId);
+ if(vnfmObjcet.isNullObject()) {
+ LOG.error("function=getJobFromVnfm, msg=vnfm not exists, vnfmId: {}", vnfmId);
+ return restJson;
+ }
+ restJson = (new VnfMgrVnfm()).getJobFromVnfm(vnfmObjcet, jobId);
+ return restJson;
+ }
+
+ public String transferToLcm(JSONObject restJson) {
+ LOG.warn("function=transferToLcm, restJson: {}", restJson);
+ JSONObject responseJson = new JSONObject();
+ JSONObject jobInfoJson = new JSONObject();
+ JSONObject jobInfo = restJson.getJSONObject("data").getJSONObject("job_info");
+ jobInfoJson.put("jobId", jobInfo.getString("job_id"));
+ responseJson.put("progress", jobInfo.getString("task_progress_rate"));
+ responseJson.put("status", jobInfo.getString("task_status"));
+ responseJson.put("errorCode", jobInfo.getString("error_code"));
+ responseJson.put("responseId", jobInfo.getString("task_progress_rate"));
+ jobInfoJson.put("responsedescriptor", responseJson);
+ LOG.warn("function=getJobBody, jobInfoJson: {}", jobInfoJson);
+ return jobInfoJson.toString();
+ }
}