summaryrefslogtreecommitdiffstats
path: root/huawei/vnfmadapter/VnfmadapterService/service
diff options
context:
space:
mode:
authorluxin <luxin7@huawei.com>2018-02-07 14:53:31 +0800
committerluxin <luxin7@huawei.com>2018-02-07 14:53:31 +0800
commit976a51ba32577b023684b30a890bad8055d6fa53 (patch)
tree6e94d07ac45c6badf1e33067f09e55902969336c /huawei/vnfmadapter/VnfmadapterService/service
parent9e52c23ed5acc5f081f2fb289405be08e976a2a2 (diff)
Modify query job status implement
Change-Id: I8ac8cc59387e0c33d98eee820f4e09d21d87ea02 Issue-ID: VFC-749 Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService/service')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/AuthRoa.java5
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java34
2 files changed, 34 insertions, 5 deletions
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
* <br/>
* <p>
- * </p>
+ * auth tokens interface is provided by platform
+ * not in nfvo for vnfm
+ * differences from other interface
+ * </p>
*
* @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");
}
+
+ /**
+ * <br>
+ * 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);
+ }
}