diff options
author | Gao Weitao <victor.gao@huawei.com> | 2017-10-30 09:51:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-30 09:51:31 +0000 |
commit | 19b7c9420f8e53c507516682959d9d0f92788a70 (patch) | |
tree | be02c5fa54d5cc4437c5f2d06c3079a8af2891c0 | |
parent | c8ef1d3751ec0893a4e7a138b653693abf2045d1 (diff) | |
parent | 7e053f4792b4e2d63c773356f46fa63354573571 (diff) |
Merge "Fix catalog query csar url"
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"; |