diff options
author | luxin <luxin7@huawei.com> | 2017-04-28 13:24:33 +0800 |
---|---|---|
committer | luxin <luxin7@huawei.com> | 2017-04-28 13:24:33 +0800 |
commit | 63e6575a65ef141ce965ae276642e3ebcffa0ba9 (patch) | |
tree | 05562f5d1e984fa609cb9810282abe1938d4b8a0 | |
parent | 6475ed53ff8455fed4d4e8c13b7370ab56247da2 (diff) |
validate status interface
NFVO-171
Change-Id: Ie7d7d64303cf72f1f2b001799655182da7cbf82a
Signed-off-by: luxin <luxin7@huawei.com>
4 files changed, 50 insertions, 0 deletions
diff --git a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/common/constant/UrlConstant.java b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/common/constant/UrlConstant.java index 67de902..8cf83fa 100644 --- a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/common/constant/UrlConstant.java +++ b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/common/constant/UrlConstant.java @@ -40,6 +40,9 @@ public class UrlConstant { */
public static final String NSLCM_VNFPACKAGE_URL = "/openoapi/nslcm/v1/vnfonboarding";
+ public static final String MARKETPLACE_UPDATE_STATUS_URL =
+ "/openoapi/vnfsdk-marketplace/v1/PackageResource/updatestatus";
+
public static final String QUERY_VNFPACKAGE_URL = "/openoapi/nslcm/v1/vnfpackage/%s";
}
diff --git a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/impl/VnfpackageServiceImpl.java b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/impl/VnfpackageServiceImpl.java index 43c418b..e566577 100644 --- a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/impl/VnfpackageServiceImpl.java +++ b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/impl/VnfpackageServiceImpl.java @@ -58,6 +58,7 @@ public class VnfpackageServiceImpl implements VnfpackageService { resJson.put("message", "NS LCM response Error.");
return resJson;
}
+ LOGGER.info("VnfpackageServiceImpl::onboarding rsp:{}", rsp);
return JSONObject.fromObject(rsp);
}
@@ -77,7 +78,31 @@ public class VnfpackageServiceImpl implements VnfpackageService { resJson.put("message", "NS LCM response Error.");
return resJson;
}
+ LOGGER.info("VnfpackageServiceImpl::queryVnfpackage rsp:{}", rsp);
return rsp;
}
+ /**
+ * <br>
+ *
+ * @param object
+ * @return
+ * @since NFVO 0.5
+ */
+ @Override
+ public JSONObject updatestatus(JSONObject object) {
+ LOGGER.info("VnfpackageServiceImpl::updatestatus:{}", object.toString());
+ Map<String, String> paramsMap = new HashMap<>(3);
+ paramsMap.put("url", UrlConstant.MARKETPLACE_UPDATE_STATUS_URL);
+ paramsMap.put("methodType", RestfulUtil.TYPE_POST);
+ String rsp = RestfulUtil.getRemoteResponseContent(paramsMap, object.toString());
+ if(null == rsp) {
+ JSONObject resJson = new JSONObject();
+ resJson.put("message", "Marketplace response Error.");
+ return resJson;
+ }
+ LOGGER.info("VnfpackageServiceImpl::updatestatus rsp:{}", rsp);
+ return JSONObject.fromObject(rsp);
+ }
+
}
diff --git a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/inf/VnfpackageService.java b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/inf/VnfpackageService.java index f7977ad..5c5e670 100644 --- a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/inf/VnfpackageService.java +++ b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/business/inf/VnfpackageService.java @@ -46,4 +46,13 @@ public interface VnfpackageService { */
JSONObject queryVnfpackage(String csarId);
+ /**
+ * <br>
+ *
+ * @param object
+ * @return
+ * @since NFVO 0.5
+ */
+ JSONObject updatestatus(JSONObject object);
+
}
diff --git a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/rest/VnfpackageRoa.java b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/rest/VnfpackageRoa.java index 4c909bd..e1d271d 100644 --- a/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/rest/VnfpackageRoa.java +++ b/lifecycle-test/src/main/java/org/openo/vnfsdk/lctest/service/rest/VnfpackageRoa.java @@ -71,6 +71,19 @@ public class VnfpackageRoa { return vnfpackageService.onboarding(object);
}
+ @POST
+ @Path("/updatestatus")
+ public JSONObject updatestatus(@Context HttpServletRequest context) throws ServiceException {
+ JSONObject object = RequestUtil.getJsonRequestBody(context);
+ if(null == object) {
+ LOGGER.error("function=onboarding; msg=context is null.");
+ throw new ServiceException("org.openo.vnfsdk.lctest.service.rest.VnfpackageRoa.onboarding.null");
+ }
+
+ LOGGER.info("VnfpackageRoa::updatestatus:{}", object.toString());
+ return vnfpackageService.updatestatus(object);
+ }
+
/**
* <br>
*
|