diff options
Diffstat (limited to 'lifecycle-test')
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>
*
|