From 976a51ba32577b023684b30a890bad8055d6fa53 Mon Sep 17 00:00:00 2001
From: luxin
Date: Wed, 7 Feb 2018 14:53:31 +0800
Subject: Modify query job status implement
Change-Id: I8ac8cc59387e0c33d98eee820f4e09d21d87ea02
Issue-ID: VFC-749
Signed-off-by: luxin
---
.../svnfm/vnfmadapter/service/rest/AuthRoa.java | 5 +++-
.../svnfm/vnfmadapter/service/rest/VnfRoa.java | 34 +++++++++++++++++++---
2 files changed, 34 insertions(+), 5 deletions(-)
(limited to 'huawei/vnfmadapter/VnfmadapterService/service/src/main/java')
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/AuthRoa.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/AuthRoa.java
index 34943770..2e7e28ca 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/AuthRoa.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/AuthRoa.java
@@ -43,7 +43,10 @@ import net.sf.json.JSONObject;
* Provide interfaces for authInfo
*
*
- *
+ * auth tokens interface is provided by platform
+ * not in nfvo for vnfm
+ * differences from other interface
+ *
*
* @author
* @version VFC 1.0 Aug 24, 2016
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 f40f741d..6ed28a81 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
@@ -87,17 +87,18 @@ public class VnfRoa {
/**
* Scale VNF
- *
+ *
+ * @param vnfmId
+ * @param vnfInstanceId
+ * @param resp
* @param context
- * * {
+ * {
* "vnfInstanceId":"5",
* "type":"SCALE_OUT",
* "aspectId":"101",
* "numberOfSteps":"1",
* "additionalParam":{}
* }
- * @param resp
- * @param vnfmId
* @return
* {
* "jobId":"1"
@@ -372,4 +373,29 @@ public class VnfRoa {
LOG.info("function=getVms, restJson: {}", restJson);
return restJson.getString("data");
}
+
+ /**
+ *
+ * Query job status from vnfm version 18.1
+ *
+ * @param jobId
+ * @param vnfmId
+ * @param responseId
+ * @return
+ * @throws ServiceException
+ * @since VFC 1.0
+ */
+ public String getJobFromVnfm(@PathParam("jobId") String jobId, @PathParam("vnfmId") String vnfmId,
+ @Context HttpServletResponse resp, @QueryParam("@responseId") String responseId) throws ServiceException {
+ LOG.warn("function=getJobFromVnfm, msg=enter to get a job: jobId: {}, responseId: {}", jobId, responseId);
+ JSONObject restJson = vnfMgr.getJobFromVnfm(jobId, vnfmId);
+
+ if(restJson.getInt(Constant.RETCODE) == Constant.REST_FAIL) {
+ LOG.error("function=getJobFromVnfm, msg=getJobFromVnfm fail");
+ resp.setStatus(Constant.HTTP_INNERERROR);
+ return restJson.toString();
+ }
+
+ return vnfMgr.transferToLcm(restJson);
+ }
}
--
cgit 1.2.3-korg