diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2018-09-10 10:38:19 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2018-09-10 10:48:16 +0800 |
commit | 007a38bbfc6d2d933e58a25ff4b11c39f9847e68 (patch) | |
tree | b380b33f104f8bf72a02b241467d723119d93ddc | |
parent | b89d9d8084078a8b657dcb097b6ab854cf7bf432 (diff) |
getServiceList,getNetWorkResources do not get data
Change-Id: Icef68ca6061896943ceaf22497737346ba24e51e
Issue-ID: USECASEUI-141
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
3 files changed, 34 insertions, 16 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/sotn/NetWorkResource.java b/server/src/main/java/org/onap/usecaseui/server/bean/sotn/NetWorkResource.java index 0af66403..1acb3b0e 100644 --- a/server/src/main/java/org/onap/usecaseui/server/bean/sotn/NetWorkResource.java +++ b/server/src/main/java/org/onap/usecaseui/server/bean/sotn/NetWorkResource.java @@ -27,11 +27,14 @@ public class NetWorkResource { private List<Pnf> pnfs; private List<Pinterface> tps; + + private String aaiId; - public NetWorkResource(String networkId, List<Pnf> pnfs, List<Pinterface> tps) { + public NetWorkResource(String networkId, List<Pnf> pnfs, List<Pinterface> tps,String aaiId) { this.networkId = networkId; this.pnfs = pnfs; this.tps = tps; + this.aaiId = aaiId; } public NetWorkResource() { @@ -60,5 +63,13 @@ public class NetWorkResource { public void setTps(List<Pinterface> tps) { this.tps = tps; } + + public String getAaiId() { + return aaiId; + } + + public void setAaiId(String aaiId) { + this.aaiId = aaiId; + } } diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java index 9ed5b655..b201f614 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java @@ -26,6 +26,7 @@ import org.onap.usecaseui.server.bean.sotn.NetWorkResource; import org.onap.usecaseui.server.bean.sotn.Pinterface; import org.onap.usecaseui.server.bean.sotn.Pnf; import org.onap.usecaseui.server.service.sotn.SOTNService; +import org.onap.usecaseui.server.util.UuiCommonUtil; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -160,19 +161,25 @@ public class SotnController { List<Pnf> pnfs = new ArrayList<Pnf>(); String networkId=netNode.get(i).get("network-id").toString(); netResource.setNetworkId(networkId); - String relationJson = netNode.get(i).get("relationship-list").toString(); - JsonNode relationNode = mapper.readTree(relationJson); - - JsonNode shipNode = relationNode.get("relationship"); - for(int j=0;j<shipNode.size();j++){ - Pnf pnf = new Pnf(); - JsonNode shipDataNode = shipNode.get(j).get("relationship-data"); - String shipDataValue = shipDataNode.get(0).get("relationship-value").toString(); - pnf.setPnfName(shipDataValue); - pnfs.add(pnf); + if(UuiCommonUtil.isNotNullOrEmpty(netNode.get(i).get("relationship-list"))){ + String relationJson = netNode.get(i).get("relationship-list").toString(); + JsonNode relationNode = mapper.readTree(relationJson); + + JsonNode shipNode = relationNode.get("relationship"); + for(int j=0;j<shipNode.size();j++){ + Pnf pnf = new Pnf(); + JsonNode shipDataNode = shipNode.get(j).get("relationship-data"); + String shipDataValue = shipDataNode.get(0).get("relationship-value").toString(); + String shipDataKey = shipDataNode.get(0).get("relationship-key").toString(); + if("ext-aai-network.aai-id".equals(shipDataKey)){ + netResource.setAaiId(shipDataKey); + } + pnf.setPnfName(shipDataValue); + pnfs.add(pnf); + } + netResource.setPnfs(pnfs); + list.add(netResource); } - netResource.setPnfs(pnfs); - list.add(netResource); } } catch (IOException e) { e.printStackTrace(); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java index ad044b04..157da3b7 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java @@ -126,8 +126,8 @@ public interface AAIService { "Authorization: Basic QUFJOkFBSQ==", "Accept: application/json" }) - @GET("/api/aai-network/logical-links") - Call<ResponseBody> getSpecificLogicalLink(@Query("link-name") String linkName); + @GET("/api/aai-network/logical-links/logical-link/{link-name}") + Call<ResponseBody> getSpecificLogicalLink(@Path("link-name") String linkName); @Headers({ "X-TransactionId: 7777", @@ -198,7 +198,7 @@ public interface AAIService { "Authorization: Basic QUFJOkFBSQ==", "Accept: application/json" }) - @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}") + @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") Call<ResponseBody> getServiceInstances(@Path("global-customer-id}") String customerId,@Path("service-type}") String serviceType); @Headers({ |