diff options
author | luxin <luxin7@huawei.com> | 2017-10-30 16:27:34 +0800 |
---|---|---|
committer | luxin <luxin7@huawei.com> | 2017-10-30 16:54:44 +0800 |
commit | 7e053f4792b4e2d63c773356f46fa63354573571 (patch) | |
tree | 51396750ed533378b28214f59a29a9dc868a4266 | |
parent | 05e444d9445dbe21d5f427a3b5cd49edfd4eefbd (diff) |
Fix catalog query csar url
Change-Id: I30fb41acaf5596ecab5e6c5086a49981865c3230
Issue-Id:VFC-552
Signed-off-by: luxin <luxin7@huawei.com>
3 files changed, 5 insertions, 11 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/VnfmUtil.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/VnfmUtil.java index 9b8ef6ee..3ac3dbee 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/VnfmUtil.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/VnfmUtil.java @@ -62,7 +62,7 @@ public final class VnfmUtil { Base64 token = new Base64(); String authen = new String(token.encode(("AAI:AAI").getBytes())); headerMap.put("Authorization", "Basic " + authen); - LOGGER.info("getVimById headerMap: {}", headerMap.toString()); + LOGGER.info("getVnfmById headerMap: {}", headerMap.toString()); RestfulResponse rsp = VnfmRestfulUtil.getRemoteResponse(String.format(ParamConstants.ESR_GET_VNFM_URL, vnfmId), VnfmRestfulUtil.TYPE_GET, headerMap, null); @@ -77,7 +77,7 @@ public final class VnfmUtil { JSONObject esrVnfm = JSONObject.fromObject(rsp.getResponseContent()); LOGGER.info("esrVnfm: {}", esrVnfm); JSONObject vnfmJson = parseEsrVnfm(vnfmId, esrVnfm); - LOGGER.info("vnfmJson: {}", esrVnfm); + LOGGER.info("vnfmJson: {}", vnfmJson); return vnfmJson; } diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java index e3bc1b29..67e2497d 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java @@ -104,7 +104,7 @@ public class AdapterResourceManager implements IResourceManager { String downloadUri = ""; if(Integer.valueOf(csarobj.get(Constant.RETCODE).toString()) == Constant.HTTP_OK) { LOG.info("get CSAR info successful.", csarobj.get(Constant.RETCODE)); - downloadUri = csarobj.getString("downloadUri"); + downloadUri = csarobj.getJSONObject("packageInfo").getString("downloadUrl"); } else { LOG.error("get CSAR info fail.", csarobj.get(Constant.RETCODE)); resultObj.put(Constant.REASON, csarobj.get(Constant.REASON).toString()); @@ -148,13 +148,7 @@ public class AdapterResourceManager implements IResourceManager { // get VNFM connection info // getVnfmConnInfo(vnfmMap) JSONObject vnfmObject = VnfmUtil.getVnfmById(vnfmid); - if(Integer.valueOf(vnfmObject.get(Constant.RETCODE).toString()) != Constant.HTTP_OK) { - LOG.error("get Vnfm Connection Info fail.", vnfmObject.get(Constant.RETCODE)); - resultObj.put(Constant.REASON, vnfmObject.get(Constant.REASON).toString()); - resultObj.put(Constant.RETCODE, vnfmObject.get(Constant.RETCODE).toString()); - return resultObj; - } - LOG.info("get Vnfm Connection Info successful.", vnfmObject.get(Constant.RETCODE)); + LOG.info("get Vnfm Connection Info successful."); String vnfmUrl = vnfmObject.getString("url"); String userName = vnfmObject.getString(Constant.USERNAME); diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/UrlConstant.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/UrlConstant.java index 23f750a8..72ebb267 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/UrlConstant.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/UrlConstant.java @@ -28,7 +28,7 @@ public class UrlConstant { public static final String REST_DRIVERMGR_REGISTER = "/api/drivermgr/v1/drivers"; - public static final String REST_CSARINFO_GET = "/api/catalog/v1/csars/%s"; + public static final String REST_CSARINFO_GET = "/api/catalog/v1/vnfpackages/%s"; public static final String REST_VNFMINFO_GET = "/api/extsys/v1/vnfms/%s"; |