summaryrefslogtreecommitdiffstats
path: root/huawei/vnfmadapter/VnfmadapterService
diff options
context:
space:
mode:
authorluxin <luxin7@huawei.com>2018-03-22 11:17:36 +0800
committerluxin <luxin7@huawei.com>2018-03-22 11:17:36 +0800
commitb851b7ee3c927bdabe4853a93553ccbfe31dfee1 (patch)
tree91ac272753e2004dd79f00101c2c14bb25db5735 /huawei/vnfmadapter/VnfmadapterService
parent37e6b6790110cf83c9a882cf637fe5fb97601e82 (diff)
Fix query vnf interface
Change-Id: Ied8e60d1804bb69dad598b16e29afc63ba03c62f Issue-ID: VFC-725 Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/ParamConstants.java4
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java5
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java17
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfRoa.java1
4 files changed, 13 insertions, 14 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/ParamConstants.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/ParamConstants.java
index f2f58c6c..549cc1d8 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/ParamConstants.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/ParamConstants.java
@@ -99,7 +99,9 @@ public class ParamConstants {
public static final String VNF_INSTANCE_DEL = "/v2/vapps/instances/%s";
- public static final String VNF_INSTANCE_GET = "/v2/vapps/instances/%s";
+ public static final String VNF_INSTANCE_GET_U2000 = "/v2/vapps/instances/%s";
+
+ public static final String VNF_INSTANCE_GET = "/v2/vnfm/instances/%s";
public static final String VNF_SCALE = "/v2/vapps/instances/%s/scale";
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
index 9c3a624b..d249d73f 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java
@@ -186,8 +186,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
restJson.put(Constant.RETCODE, Constant.REST_FAIL);
JSONObject queryResult = ResultRequestUtil.call(vnfmObject,
- String.format(ParamConstants.VNF_INSTANCE_GET, vnfId) + Constant.ROARAND + "&type=status", Constant.GET,
- null, Constant.CERTIFICATE);
+ String.format(ParamConstants.VNF_INSTANCE_GET, vnfId), Constant.GET, null, Constant.CERTIFICATE);
int statusCode = queryResult.getInt(Constant.RETCODE);
@@ -197,7 +196,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr {
return restJson;
}
restJson.put(Constant.RETCODE, Constant.REST_SUCCESS);
- restJson.put("data", JSONObject.fromObject(queryResult.getString("data")).getJSONArray("basic"));
+ restJson.put("data", JSONObject.fromObject(queryResult.getString("data")).getJSONArray("vnf_list"));
} else {
LOG.error("function=getVnf, msg=send get vnf msg to csm get wrong status: {}", statusCode);
}
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
index be8268a4..e4eb5efc 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/process/VnfMgr.java
@@ -198,16 +198,15 @@ public class VnfMgr {
JSONObject retJson = restJson.getJSONArray("data").getJSONObject(0);
- basicInfoJson.put("vnfInstanceId", retJson.getString("id"));
- basicInfoJson.put("vnfInstanceName", retJson.getString("vapp_name"));
- basicInfoJson.put("vnfInstanceDescription", "vFW");
-
- Vnfm vnfm = vnfmDao.getVnfmById(retJson.getString("id"));
- basicInfoJson.put(Constant.VNFDID, vnfm == null ? "" : vnfm.getVnfdId());
- basicInfoJson.put("vnfdPackageId", vnfm == null ? "" : vnfm.getVnfPackageId());
- basicInfoJson.put("version", vnfm == null ? "" : vnfm.getVersion());
+ basicInfoJson.put("vnfInstanceId", retJson.getString("vnf_id"));
+ basicInfoJson.put("vnfInstanceName", retJson.getString("vnf_name"));
+ basicInfoJson.put("vnfInstanceDescription", "");
+
+ basicInfoJson.put(Constant.VNFDID, retJson.getString("vnfd_id"));
+ basicInfoJson.put("vnfdPackageId", retJson.getString("vnfd_id"));
+ basicInfoJson.put("version", "1.0");
basicInfoJson.put("vnfProvider", "hw");
- basicInfoJson.put("vnfType", retJson.get("vapp_type"));
+ basicInfoJson.put("vnfType", retJson.get("vnf_type"));
basicInfoJson.put("vnfStatus", retJson.getString(Constant.STATUS));
vnfInfoJson.put("vnfInfo", basicInfoJson);
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 0fc36587..9f297451 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
@@ -203,7 +203,6 @@ public class VnfRoa {
* @param vnfmId
* @param resp
* @param vnfInstanceId
- * @param context
* @return
* @since VFC 1.0
*/