diff options
author | mukesh.paliwal1@huawei.com <mukesh.paliwal1@huawei.com> | 2020-03-25 13:42:49 +0530 |
---|---|---|
committer | mukesh.paliwal1@huawei.com <mukesh.paliwal1@huawei.com> | 2020-03-25 14:24:31 +0530 |
commit | eecac0b9a43c3479e2c4dd43c0fc0f673999c23f (patch) | |
tree | e4847045cd7b34fa79e1de09ce75b172d13e8cd3 | |
parent | f3c5de44550a972c18e3bd717c75a43dc882e1ac (diff) |
Service Topology Creation
Issue-ID: USECASEUI-419
Signed-off-by: mukesh.paliwal1@huawei.com <mukesh.paliwal1@huawei.com>
Change-Id: Ief73f310c4dab225481982bb352fd13999f7ede8
15 files changed, 758 insertions, 81 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java index 2ce79455..231c9950 100644 --- a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java @@ -34,12 +34,18 @@ import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; "in-maint", "network-ref", "transparent", - "operational-status" + "operational-status", + "speed-units", + "port-description" }) public class Pinterface { @JsonProperty("interface-name") private String interfaceName; + @JsonProperty("speed-units") + private String speedUnits; + @JsonProperty("port-description") + private String portDescription; @JsonProperty("speed-value") private String speedValue; @JsonProperty("equipment-identifier") @@ -145,4 +151,24 @@ public class Pinterface { public void setRelationshipList(RelationshipList relationshipList) { this.relationshipList = relationshipList; } + + @JsonProperty("speed-units") + public String getSpeedUnits() { + return speedUnits; + } + + @JsonProperty("speed-units") + public void setSpeedUnits(String speedUnits) { + this.speedUnits = speedUnits; + } + + @JsonProperty("port-description") + public String getPortDescription() { + return portDescription; + } + + @JsonProperty("port-description") + public void setPortDescription(String portDescription) { + this.portDescription = portDescription; + } } diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Uni.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Uni.java new file mode 100644 index 00000000..56e96c31 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Uni.java @@ -0,0 +1,85 @@ +/** + * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.*; +import lombok.Getter; +import lombok.Setter; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "tpId", + "resource-version", + "operational-status", + "relationship-list" +}) +public class Uni { + @JsonProperty("id") + private String id; + @JsonProperty("tpId") + private String tpId; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTpId() { + return tpId; + } + + public void setTpId(String tpId) { + this.tpId = tpId; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public String getOperationalStatus() { + return operationalStatus; + } + + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Vnfs.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Vnfs.java new file mode 100644 index 00000000..fde4ef5b --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Vnfs.java @@ -0,0 +1,118 @@ +/** + * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.*; +import lombok.Getter; +import lombok.Setter; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "vnf-id", + "in-maint", + "resource-version", + "vnf-instance-id", + "vnf-name", + "vnf-type", + "is-closed-loop-disabled", + "relationship-list" +}) +public class Vnfs { + @JsonProperty("vnf-id") + private String pnfName; + @JsonProperty("in-maint") + private Boolean inMaint; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("vnf-instance-id") + private String vnfInstanceId; + @JsonProperty("vnf-name") + private String vnfName; + @JsonProperty("vnf-type") + private String vnfType; + @JsonProperty("is-closed-loop-disabled") + private boolean isClosedLoopDisabled; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + public String getPnfName() { + return pnfName; + } + + public void setPnfName(String pnfName) { + this.pnfName = pnfName; + } + + public Boolean getInMaint() { + return inMaint; + } + + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public String getVnfInstanceId() { + return vnfInstanceId; + } + + public void setVnfInstanceId(String vnfInstanceId) { + this.vnfInstanceId = vnfInstanceId; + } + + public String getVnfName() { + return vnfName; + } + + public void setVnfName(String vnfName) { + this.vnfName = vnfName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public boolean isClosedLoopDisabled() { + return isClosedLoopDisabled; + } + + public void setClosedLoopDisabled(boolean closedLoopDisabled) { + isClosedLoopDisabled = closedLoopDisabled; + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java index 31446226..7745e45b 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java @@ -48,38 +48,52 @@ public class SotnServiceLcmController { @ResponseBody @RequestMapping(value = {"/uui-lcm/Sotnservices/servicesubscription/{subscriptionType}/serviceinstance/{instanceid}"}, method = RequestMethod.GET, produces = "application/json") - // @RequestMapping(value = {"ccvpncustomer/servicesubscriptions/uui-lcm/Sotnservices/servicesubscription/{subscriptionType}/serviceinstance/{instanceid}"}, method = RequestMethod.GET, produces = "application/json") public String getSotnService(@PathVariable("subscriptionType") String subscriptionType, @PathVariable("instanceid") String instanceid) { - + System.out.println("Get Service called."); return sotnServiceTemplateService.getService(subscriptionType, instanceid); + } - //return serviceOperation; + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/servicesubscription/{subscriptionType}/serviceinstance/{instanceid}"}, method = RequestMethod.DELETE, produces = "application/json") + public DeleteOperationRsp getDeleteSotnService(@PathVariable("subscriptionType") String subscriptionType, @PathVariable("instanceid") String instanceid) throws Exception { + System.out.println("Delete Service called."); + DeleteOperationRsp deleteOperationRsp = sotnServiceTemplateService.deleteService(subscriptionType, instanceid); + return deleteOperationRsp; } @ResponseBody @RequestMapping(value = {"/uui-lcm/Sotnservices_unni"}, method = RequestMethod.POST, produces = "application/json") - public ServiceOperation instantiateService_sotnunni(HttpServletRequest request,@RequestBody HashMap<String, Object> mp) { - System.out.println("request body == "+mp); - //ServiceOperation serviceOperation = sotnServiceTemplateService.instantiateService_sotnunni(mp); - - ServiceOperation serviceOperation = sotnServiceTemplateService.instantiate_CCVPN_Service(mp); - + public ServiceOperation instantiateService_sotnunni(HttpServletRequest request,@RequestBody HashMap<String, Object> serviceData) { + System.out.println("Create Service called."); + ServiceOperation serviceOperation = sotnServiceTemplateService.instantiate_CCVPN_Service(serviceData); return serviceOperation; } - - @ResponseBody @RequestMapping(value = {"/uui-lcm/Sotnservices/topology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}"}, method = RequestMethod.GET, produces = "application/json") public String getSiteInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId) throws Exception { + System.out.println("Site topology called."); return sotnServiceTemplateService.getSOTNSiteInformationTopology( servicetype, serviceInstanceId); } @ResponseBody @RequestMapping(value = {"/uui-lcm/Sotnservices/resourceTopology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}"}, method = RequestMethod.GET, produces = "application/json") public String getResourceInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId) throws Exception { + System.out.println("Resource topology called."); return sotnServiceTemplateService.getSOTNResourceInformationTopology( servicetype, serviceInstanceId); } + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/serviceTopology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}"}, method = RequestMethod.GET, produces = "application/json") + public String getServiceInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId) throws Exception { + System.out.println("Service topology called."); + return sotnServiceTemplateService.getServiceInformationTopology( servicetype, serviceInstanceId); + } + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/vpnbindingTopology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}/vpn-informations/vpn-information/{vpinId}"}, method = RequestMethod.GET, produces = "application/json") + public String getVpnInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vpinId") String vpinId) throws Exception { + System.out.println("Vpn Binding topology called."); + return sotnServiceTemplateService.getVPNBindingInformationTopology( servicetype, serviceInstanceId, vpinId); + } }
\ No newline at end of file diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java index 4058281f..cde87934 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java @@ -57,17 +57,17 @@ public class SotnServiceQryController { @ResponseBody @RequestMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, method = RequestMethod.GET , produces = "application/json") public String getSotnServiceInstances(@PathVariable(value="serviceType") String serviceType){ - + System.out.println("Get Service Instance called."); String response = sotnServiceQryService.getServiceInstances(serviceType); - return response; } @ResponseBody @RequestMapping(value = {"/uui-lcm/customers/service-subscriptions"}, method = RequestMethod.GET , produces = "application/json") public String getServiceSubscriptions(){ - String customerId=""; - return ccvpnCustomerService.querySubscriptionType(customerId); + System.out.println("Get Service Subscription called."); + String response = ccvpnCustomerService.querySubscriptionType(); + return response; } } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java index 02e85823..7dda53f7 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java @@ -18,8 +18,7 @@ package org.onap.usecaseui.server.service.customer; import org.onap.usecaseui.server.bean.customer.ServiceInstances; public interface CcvpnCustomerService { - public ServiceInstances getServiceInstances(String customerId, String serviceType); - public String querySubscriptionType(String customerId); + public String querySubscriptionType(); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java index c4cc848d..f7c67dd8 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java @@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import retrofit2.Response; +import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.*; @@ -98,12 +99,12 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { } - public String querySubscriptionType(String customerId) { + public String querySubscriptionType() { SubscriptionType subscriptions = new SubscriptionType(); String result = ""; ModelConfig modelConfig = readFile(); Map<String, Model> modelInfo = readConfigToMap(modelConfig); - customerId = modelConfig.getSubscriberId(); + String customerId = modelConfig.getSubscriberId(); ObjectMapper mapper = new ObjectMapper(); try { logger.info("aai querySubscriptionType is starting!"); @@ -140,24 +141,17 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { public ModelConfig readFile() { JSONParser parser = new JSONParser(); - //String absolutepath = "/home/root1/Desktop/Subhosree/gerrit clone for ui backend";//configure absolute path as per systempath - String jsonPath = "/home/modelconfig.json"; - String jsonString = null; + ClassLoader classLoader = new CcvpnCustomerServiceImpl().getClass().getClassLoader(); + File file = new File(classLoader.getResource("modelconfig.json").getFile()); ObjectMapper mapper = new ObjectMapper(); - try { - - Object object = parser.parse(new FileReader(jsonPath)); - //System.out.println(object.toString()); + Object object = parser.parse(new FileReader(file)); ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { }); - return modelInformation; } catch (ParseException | IOException ex) { logger.error("Exception occured while reading configuration file:" + ex); return null; } } - - }
\ No newline at end of file diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java index c57f9542..e2ed5b95 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java @@ -25,7 +25,9 @@ public interface SotnServiceTemplateService { public String getSOTNSiteInformationTopology(String subscriptionType, String instanceid); public ServiceOperation instantiate_CCVPN_Service(HashMap<String, Object> reqt); - //public DeleteOperationRsp deleteService(String serviceId, String subscriptionType, HttpServletRequest request); + public DeleteOperationRsp deleteService(String serviceId, String subscriptionType) throws Exception; public String getSOTNResourceInformationTopology(String subscriptionType, String instanceid) throws Exception; public String getService(String subscriptionType, String instanceid); + public String getServiceInformationTopology(String subscriptionType, String instanceid) throws Exception; + public String getVPNBindingInformationTopology(String subscriptionType, String instanceid, String vpnId) throws Exception; } 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 fdf622bc..3ba4fc90 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 @@ -438,4 +438,23 @@ public interface AAIService { @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions") Call<ResponseBody> getServiceSubscription(@Path("global-customer-id") String customerID); + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + + @GET("/aai/v19/network/generic-vnfs/generic-vnf/{vnf-id}") + Call<ResponseBody> getVNFsDetail(@Path("vnf-id") String vnfId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + + @GET("/aai/v19/network/unis/uni/{uni-id}") + Call<ResponseBody> getUNIInfo(@Path("uni-id") String uniId); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipData.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipData.java index d302f2cc..1a88f307 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipData.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipData.java @@ -26,7 +26,7 @@ public class RelationshipData { private String relationshipKey; - @JsonProperty("relationship-key") + @JsonProperty("relationship-value") public String getRelationshipValue() { return relationshipValue; } @@ -35,7 +35,7 @@ public class RelationshipData { this.relationshipValue = relationshipValue; } - @JsonProperty("relationship-value") + @JsonProperty("relationship-key") public String getRelationshipKey() { return relationshipKey; } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java index 4dd78c02..785cb6bc 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java @@ -27,6 +27,7 @@ import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ResponseServiceI import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceInstanceList; import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceInstanceListWrapper; //import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceSubscriptionWrapper; +import org.onap.usecaseui.server.service.customer.impl.CcvpnCustomerServiceImpl; import org.onap.usecaseui.server.service.lcm.SotnServiceQryService; import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; import org.onap.usecaseui.server.util.RestfulServices; @@ -37,6 +38,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; import retrofit2.Response; +import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; @@ -102,19 +104,13 @@ public class SotnServiceQryServiceImpl implements SotnServiceQryService { public ModelConfig readFile() { JSONParser parser = new JSONParser(); - //String jsonPath = "/home/root1/Desktop/modelconfig.json"; - //String absolutepath = "/home/root1/Desktop/Subhosree/gerrit clone for ui backend";//configure absolute path as per systempath - String jsonPath = "/home/modelconfig.json"; - String jsonString = null; + ClassLoader classLoader = new CcvpnCustomerServiceImpl().getClass().getClassLoader(); + File file = new File(classLoader.getResource("modelconfig.json").getFile()); ObjectMapper mapper = new ObjectMapper(); - try { - - Object object = parser.parse(new FileReader(jsonPath)); - //System.out.println(object.toString()); + Object object = parser.parse(new FileReader(file)); ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { }); - return modelInformation; } catch (ParseException | IOException ex) { logger.error("Exception occured while reading configuration file:" + ex); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java index 1e3411c6..845c94d0 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java @@ -20,15 +20,19 @@ package org.onap.usecaseui.server.service.lcm.impl; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.MediaType; +import okhttp3.RequestBody; import okhttp3.ResponseBody; //import org.onap.usecaseui.server.bean.lcm.sotne2eservice.*; //import org.onap.usecaseui.server.bean.lcm.sotne2eservice.Connectivity; //import org.onap.usecaseui.server.bean.sotn.Pinterface; import org.onap.usecaseui.server.bean.orderservice.ServiceEstimationBean; +import org.onap.usecaseui.server.service.customer.impl.CcvpnCustomerServiceImpl; import org.onap.usecaseui.server.service.lcm.SotnServiceTemplateService; import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; import org.onap.usecaseui.server.service.lcm.domain.aai.bean.Relationship; //import org.onap.usecaseui.server.service.lcm.domain.aai.bean.ServiceInstance; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp; import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation; import org.onap.usecaseui.server.service.lcm.domain.so.SOService; import org.onap.usecaseui.server.service.lcm.domain.so.bean.Operation; @@ -39,6 +43,8 @@ import retrofit2.Response; import org.onap.usecaseui.server.service.lcm.domain.aai.bean.RelationshipData; import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.File; import java.io.FileReader; import java.io.IOException; import org.json.simple.parser.JSONParser; @@ -71,15 +77,13 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic public ModelConfig readFile() { JSONParser parser = new JSONParser(); - //String jsonPath = "/home/modelconfig.json"; - String jsonPath = "/home/modelconfig.json"; - String jsonPath_2 = ""; - String jsonString = null; + ClassLoader classLoader = new CcvpnCustomerServiceImpl().getClass().getClassLoader(); + File file = new File(classLoader.getResource("modelconfig.json").getFile()); ObjectMapper mapper = new ObjectMapper(); try { - Object object = parser.parse(new FileReader(jsonPath)); + Object object = parser.parse(new FileReader(file)); ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { }); @@ -92,17 +96,13 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic public ModelConfig readFile_unni(){ JSONParser parser = new JSONParser(); - String jsonPath = "/home/modelconfigunni.json"; - String jsonPath_2 = ""; - String jsonString = null; + ClassLoader classLoader = new CcvpnCustomerServiceImpl().getClass().getClassLoader(); + File file = new File(classLoader.getResource("modelconfigunni.json").getFile()); ObjectMapper mapper = new ObjectMapper(); - try { - - Object object = parser.parse(new FileReader(jsonPath)); + Object object = parser.parse(new FileReader(file)); ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { }); - return modelInformation; } catch (ParseException | IOException ex) { // logger.error("Exception occured while reading configuration file:" + ex); @@ -543,30 +543,78 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic return jsonresponse; } + public DeleteOperationRsp deleteService(String serviceId, String subscriptionType) { + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + String customerId = modelConfig.getSubscriberId(); + E2EServiceDelete deleteRequest = new E2EServiceDelete(); + deleteRequest.setServiceType(subscriptionType); + deleteRequest.setGlobalSubscriberId(customerId); + String requestStr = deleteRequest.toString(); + Integer sleeptime = Integer.parseInt(modelConfig.getDeleteSleepTime()); + //Get the service information from AAI - Begin + ServiceInstance serviceInstance = new ServiceInstance(); + try { + serviceInstance = getServiceInstancesInfo(customerId, subscriptionType, serviceId); + if (serviceInstance == null) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + List<Relationship> ssrelationship = serviceInstance.getRelationshipList().getRelationship().stream() + .filter(siterelation -> siterelation.getRelatedTo().equalsIgnoreCase("service-instance")) + .collect(Collectors.toList()); + //Get the service information from AAI - Begin + for (Relationship siterelation : ssrelationship) { + String siteserviceId = siterelation.getRelatedLink().substring(siterelation.getRelatedLink().lastIndexOf("/") + 1); + try { +// logger.info("so begin terminate site service " + siteserviceId); + RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestStr); + Response<DeleteOperationRsp> response = soService.terminateService(siteserviceId, requestBody).execute(); +// logger.info("so terminate has finished"); + if (response.isSuccessful()) { +// logger.info("so terminated site service " + siteserviceId + "successfully..."); + } else { +// logger.error(String.format("Can not terminate service " + siteserviceId + " [code=%s, message=%s]", response.code(), response.message())); + throw new SOException("SO terminate service failed!"); + } + } catch (IOException e) { + throw new SOException("SO Service is not available!", e); + } + } + try { +// logger.info("Began to sleep for " + sleeptime); + Thread.sleep(sleeptime); + } catch (InterruptedException e) { +// logger.error(String.format("Thread Interruppted from sleep while deleting service subscription")); + } + try { +// logger.info("so begin terminate Connectivity service " + serviceId); + RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestStr); + Response<DeleteOperationRsp> response = soService.terminateService(serviceId, requestBody).execute(); +// logger.info("so terminate has finished"); + if (response.isSuccessful()) { +// logger.info("so terminated connectivity service " + serviceId + "successfully..."); - - - - - - - - - - -// public DeleteOperationRsp deleteService(String serviceId, String subscriptionType, HttpServletRequest request) -// { -// -// } - - - - + } else { +// logger.error(String.format("Can not terminate service " + serviceId + " [code=%s, message=%s]", response.code(), response.message())); + throw new SOException("SO terminate service failed!"); + } + return response.body(); + } catch (IOException e) { + throw new SOException("SO Service is not available!", e); + } + } public VpnBinding getSOTNPinterfaceByVpnId(String vpnId) throws Exception { @@ -585,16 +633,11 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic // logger.info("Fire getSOTNPinterfaceByVpnId : Failed"); } - return null; - - } public Pnf getSOTNPnf(String pnfname) throws Exception { - - // logger.info("Fire get SOTN PnF by Name : Begin"); ObjectMapper mapper = new ObjectMapper(); Response<ResponseBody> response = this.aaiService.getPnfInfo(pnfname).execute(); if (response.isSuccessful()) { @@ -605,14 +648,11 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic //System.out.println("Response received : "+response.body().bytes()); } else { // logger.info("Fire get SOTN PnF by Name : Failed" + pnfname); - } - return null; } public LogicalLink getSOTNLinkbyName(String linkName) throws Exception { - // logger.info("Fire getSOTNLinkbyName : Begin"); ObjectMapper mapper = new ObjectMapper(); Response<ResponseBody> response = this.aaiService.getSpecificLogicalLink(linkName).execute(); @@ -624,12 +664,289 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic //System.out.println("Response received : "+response.body().bytes()); } else { // logger.info("Fire getSOTNLinkbyName : Failed"); + } + return null; + } + public Uni getUNIInfo(String uniId) throws Exception { + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getUNIInfo(uniId).execute(); + if (response.isSuccessful()) { + String result = new String(response.body().bytes()); + Uni uni = mapper.readValue(result, Uni.class); + return uni; } + return null; + } + public Vnfs getVnfs(String vnfId) throws Exception { + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getVNFsDetail(vnfId).execute(); + if (response.isSuccessful()) { + String result = new String(response.body().bytes()); + Vnfs vnf = mapper.readValue(result, Vnfs.class); + return vnf; + } return null; } + public Node getNode(String id, String label, String image) { + Node node = new Node(); + node.setId(id); + node.setShape("circularImage"); + node.setImage("./assets/images/"+image); + node.setLabel(label); + node.setColor("Green"); + return node; + } + + public Edge getEdge(String fromId, String toId) { + Edge edge = new Edge(); + edge.setFrom(fromId); + edge.setTo(toId); + return edge; + } + + @Override + public String getVPNBindingInformationTopology(String subscriptionType, String instanceid, String vpnId) throws Exception { + + List<Node> nodes = new ArrayList<Node>(); + List<Edge> edges = new ArrayList<Edge>(); + List<String> vpnparams = new ArrayList<String>(Arrays.asList("cir", "eir", "cbs", "ebs", "colorAware", "couplingFlag", "ethtSvcName")); + String jsonresponse = ""; + Node connode = new Node(); + try { + //---------------------------------Query VPN : Begin------------------------------ + VpnBinding vpnBinding = getSOTNPinterfaceByVpnId(vpnId); + VpnInformation vpnInformation = vpnBinding.getVpnBinding().get(0); + Node vpn = getNode(vpnInformation.getVpnId(), "VPN Binding", "vpnbinding.png"); + ObjectMapper mapper = new ObjectMapper(); + Map<String, Object> props = mapper.convertValue(vpnInformation, Map.class); + props.remove("relationship-list"); + props.remove("resource-version"); + props.remove("vpn-region"); + props.remove("vpn-id"); + vpn.setDataNode(new ObjectMapper().writeValueAsString(props)); + nodes.add(vpn); + //Query VPN : End + + //Query P Interfaces + List<Relationship> vpnpinterfacerelation = vpnInformation.getRelationshipList().getRelationship().stream() + .filter(relate -> "p-interface".equalsIgnoreCase(relate.getRelatedTo())).collect(Collectors.toList()); + for (Relationship temprel : vpnpinterfacerelation) { + String pinterfaceid = temprel.getRelatedLink().substring(temprel.getRelatedLink().lastIndexOf("/") + 1); + String parentaccessnode = ""; + + RelationshipData[] pnfrelatedprop = temprel.getRelationshipData(); + for (RelationshipData temp : pnfrelatedprop) { + if ("pnf.pnf-name".equalsIgnoreCase(temp.getRelationshipKey())) { + parentaccessnode = temp.getRelationshipValue(); + break; + } + } + Pinterface pinterface = new Pinterface(); + pinterface = getTerminationPoint(parentaccessnode, pinterfaceid); + Node vpnpinterface = getNode(pinterface.getInterfaceName(), "P-interface", "tpoint.png"); + ObjectMapper vpnpintmapper = new ObjectMapper(); + Map<String, Object> vpnpintprops = vpnpintmapper.convertValue(pinterface, Map.class); + vpnpintprops.remove("relationship-list"); + vpnpintprops.remove("resource-version"); + vpnpintprops.remove("in-maint"); + vpnpinterface.setDataNode(new ObjectMapper().writeValueAsString(vpnpintprops)); + nodes.add(vpnpinterface); + edges.add(getEdge(vpn.getId(),vpnpinterface.getId())); + } + } catch (Exception ex) { + } + ResourceResponse resourceResponse = new ResourceResponse(); + resourceResponse.setNodes(nodes); + resourceResponse.setEdges(edges); + System.out.println(jsonresponse); + return resourceResponse.toString(); + } + + @Override + public String getServiceInformationTopology(String subscriptionType, String instanceid) throws Exception { + + List<Node> nodes = new ArrayList<Node>(); + List<Edge> edges = new ArrayList<Edge>(); + ServiceInstance serviceInstance = null; + Connectivity connectivity = new Connectivity(); + Node connode = new Node(); + + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- + try { + ModelConfig modelConfig = readFile(); + String customerId = modelConfig.getSubscriberId(); + + serviceInstance = getServiceInstancesInfo(customerId, subscriptionType, instanceid); + if (serviceInstance == null) { + return null; + } + else { + ObjectMapper serviceMapper = new ObjectMapper(); + Map<String, Object> serviceProps = serviceMapper.convertValue(serviceInstance, Map.class); + serviceProps.remove("relationship-list"); + serviceProps.remove("input-parameters"); + serviceProps.remove("resource-version"); + Node serviceNode = getNode(serviceInstance.getServiceInstanceId(), "Service", "service.png"); + serviceNode.setDataNode(new ObjectMapper().writeValueAsString(serviceProps)); + nodes.add(serviceNode); + } + } catch (Exception e) { + return null; + } + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : END --------------------------------------- + + //-------------------------------GET GENERIC VNFS : BEGIN ---------------------------------------- + + List<Relationship> relationship = serviceInstance.getRelationshipList().getRelationship().stream().filter(relation -> relation.getRelatedTo() + .equalsIgnoreCase("generic-vnf")).collect(Collectors.toList()); + if (relationship.size() > 0 && relationship != null) { + relationship = serviceInstance.getRelationshipList().getRelationship(); + Vnfs vnf = getVnfs(relationship.get(0).getRelatedTo()); + relationship = vnf.getRelationshipList().getRelationship(); + + ObjectMapper serviceMapper = new ObjectMapper(); + Map<String, Object> vnfProps = serviceMapper.convertValue(vnf, Map.class); + vnfProps.remove("relationship-list"); + vnfProps.remove("in-maint"); + vnfProps.remove("resource-version"); + Node vnfNode = getNode(vnf.getVnfInstanceId(), "Vnf", "VNF.png"); + vnfNode.setDataNode(new ObjectMapper().writeValueAsString(vnfProps)); + nodes.add(vnfNode); + edges.add(getEdge(serviceInstance.getServiceInstanceId(),vnf.getVnfInstanceId())); + + Relationship relation = relationship.stream() + .filter(relate -> "connectivity".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + try { + String connectivityinstanceid = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); + connectivity = getConnectivityInfo(connectivityinstanceid); + Map<String, Object> connectivityparams = new ObjectMapper().readValue(connectivity.toString(), HashMap.class); + connode = getNode(connectivityparams.get("connectivityId").toString(), "Connectivity", "connectivity.png"); + ObjectMapper conMapper = new ObjectMapper(); + Map<String, Object> conprops = conMapper.convertValue(connectivity, Map.class); + conprops.remove("relationship-list"); + conprops.remove("resource-version"); + connode.setDataNode(new ObjectMapper().writeValueAsString(conprops)); + nodes.add(connode); + edges.add(getEdge(vnf.getVnfInstanceId(), connectivityparams.get("connectivityId").toString())); + } catch (IOException e) { + // logger.info("IO Exception occured " + e.getMessage()); + } + + //Query Connectivity : End + List<Relationship> relationship1 = vnf.getRelationshipList().getRelationship().stream().filter(relation1 -> relation1.getRelatedTo() + .equalsIgnoreCase("uni")).collect(Collectors.toList()); + if (relationship1.size() > 0 && relationship1 != null) { + for (Relationship rel : relationship1) { + try { + String s = rel.getRelatedLink(); + String uniId = s.substring(s.lastIndexOf("/")+1); + Uni uniInfo = getUNIInfo(uniId); + Node uuinode = getNode(uniInfo.getId(), uniInfo.getId(), "edge.png"); + ObjectMapper uuiMapper = new ObjectMapper(); + Map<String, Object> uuiprops = uuiMapper.convertValue(uniInfo, Map.class); + uuiprops.remove("relationship-list"); + uuiprops.remove("resource-version"); + uuinode.setDataNode(new ObjectMapper().writeValueAsString(uuiprops)); + nodes.add(uuinode); + edges.add(getEdge(vnf.getVnfInstanceId(), uniInfo.getId())); + + List<Relationship> unipinterfaceralation = uniInfo.getRelationshipList().getRelationship().stream() + .filter(relate -> "p-interface".equalsIgnoreCase(relate.getRelatedTo())).collect(Collectors.toList()); + for (Relationship temprel : unipinterfaceralation) { + String pinterfaceid = temprel.getRelatedLink().substring(temprel.getRelatedLink().lastIndexOf("/") + 1); + String parentaccessnode = ""; + + RelationshipData[] pnfrelatedprop = temprel.getRelationshipData(); + for (RelationshipData temp : pnfrelatedprop) { + if ("pnf.pnf-name".equalsIgnoreCase(temp.getRelationshipKey())) { + parentaccessnode = temp.getRelationshipValue(); + break; + } + } + try { + + Pinterface pinterface = getTerminationPoint(parentaccessnode, pinterfaceid); + + ObjectMapper unipintmapper = new ObjectMapper(); + Map<String, Object> unipintprops = unipintmapper.convertValue(pinterface, Map.class); + unipintprops.remove("relationship-list"); + unipintprops.remove("resource-version"); + unipintprops.remove("in-maint"); + + Node unipinterface = getNode(pinterface.getInterfaceName(), "P-interface", "tpoint.png"); + unipinterface.setDataNode(new ObjectMapper().writeValueAsString(unipintprops)); + nodes.add(unipinterface); + edges.add(getEdge(uniInfo.getId(), unipinterface.getId())); + + } catch (Exception e) { + } + } + + } catch (IOException e) { + // logger.info("IO Exception occured " + e.getMessage()); + } + } + //Query UNI : End + } + + //---------------------------------Query VPN : Begin------------------------------ + Relationship vpnrelation = connectivity.getRelationshipList().getRelationship().stream() + .filter(relate -> "vpn-binding".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String vpnid = vpnrelation.getRelatedLink().substring(vpnrelation.getRelatedLink().lastIndexOf("/") + 1); + VpnBinding vpnBinding = new VpnBinding(); + VpnInformation vpnInformation = new VpnInformation(); + try { + vpnBinding = getSOTNPinterfaceByVpnId(vpnid); + vpnInformation = vpnBinding.getVpnBinding().get(0); + } catch (Exception e) { + } + + ObjectMapper mapper = new ObjectMapper(); + Map<String, Object> props = mapper.convertValue(vpnInformation, Map.class); + props.remove("relationship-list"); + props.remove("resource-version"); + props.remove("vpn-region"); + props.remove("vpn-id"); + Node vpn = getNode(vpnInformation.getVpnId(), "VPN Binding", "vpnbinding.png"); + vpn.setDataNode(new ObjectMapper().writeValueAsString(props)); + nodes.add(vpn); + edges.add(getEdge(connode.getId(), vpn.getId())); + //Query VPN : End + + //Query P Interfaces + List<Relationship> vpnpinterfacerelation = vpnInformation.getRelationshipList().getRelationship().stream() + .filter(relate -> "p-interface".equalsIgnoreCase(relate.getRelatedTo())).collect(Collectors.toList()); + for (Relationship temprel : vpnpinterfacerelation) { + String pinterfaceid = temprel.getRelatedLink().substring(temprel.getRelatedLink().lastIndexOf("/") + 1); + String parentaccessnode = ""; + + RelationshipData[] pnfrelatedprop = temprel.getRelationshipData(); + for (RelationshipData temp : pnfrelatedprop) { + if ("pnf.pnf-name".equalsIgnoreCase(temp.getRelationshipKey())) { + parentaccessnode = temp.getRelationshipValue(); + break; + } + } + try { + Pinterface pinterface = getTerminationPoint(parentaccessnode, pinterfaceid); + edges.add(getEdge(vpn.getId(), pinterface.getInterfaceName())); + } catch (Exception e) { + } + } + } + ResourceResponse resourceResponse = new ResourceResponse(); + resourceResponse.setNodes(nodes); + resourceResponse.setEdges(edges); + return resourceResponse.toString(); + } + @Override public String getSOTNResourceInformationTopology(String subscriptionType, String instanceid) throws Exception { diff --git a/server/src/main/resources/modelconfig.json b/server/src/main/resources/modelconfig.json new file mode 100644 index 00000000..d2dfafc1 --- /dev/null +++ b/server/src/main/resources/modelconfig.json @@ -0,0 +1,66 @@ +{ + "subscriberId":"ISAAC", + "subscriptionType":"SOTN", + "status":1, + "modelInformation":[ + { + "modelType":"sotnservice", + "model": { + "resourceName":"sotn", + "resourceDescription":"sotn service", + "resourceInvariantUuid":"b36a7816-d4bf-4355-a3f1-20825ee7fce7", + "resourceUuid":"68db4561-8d85-4e7e-9653-7263118cb3ef", + "resourceCustomizationUuid":"" + } + }, +{ + "modelType":"siteservice", + "model": { + "resourceName":"siteservice", + "resourceDescription":"sotn service", + "resourceInvariantUuid":"5448e42c-a22a-4bbd-bd24-387db52d3e58", + "resourceUuid":"0bf85631-6d70-471c-b97c-b5cc05056034", + "resourceCustomizationUuid":"" + } + }, + { + "modelType":"site", + "model": { + "resourceName":"SiteVF", + "resourceDescription":"site 0", + "resourceInvariantUuid":"66b96cb7-541d-4340-9bd6-8a5e37f1d5f1", + "resourceUuid":"60504c1f-8c3a-42c3-b071-1f1750688f3a", + "resourceCustomizationUuid":"c0f4205b-3101-41cf-90b3-aae6d97b3576" + } + }, + { + "modelType":"connectivity", + "model": { + "resourceName":"sotnconnectivityv2 0", + "resourceDescription":"sotnconnectivityv2 0", + "resourceInvariantUuid":"fea25ffc-f87c-418d-a33b-6ddfbf1d014d", + "resourceUuid":"d5dad832-e337-4b33-8faa-6d3dfb41c7fb", + "resourceCustomizationUuid":"67053d18-4350-48e9-9c11-2785605fb3bb" + } + }, + { + "modelType":"partner", + "model": { + "resourceName":"SPpartnerVF", + "resourceDescription":"spPartnerv2 0", + "resourceInvariantUuid":"0b0f5ceb-4235-4422-8be1-2ea48ddcd283", + "resourceUuid":"180fcfa0-4eda-4038-916b-1c69b1723395", + "resourceCustomizationUuid":"f6d84644-ce0d-4445-a52c-28361f73439f" + } + }, + { + "modelType":"attachment", + "model": { + "resourceName":"elinesotnattachmentvf0", + "resourceDescription":"spPartnerv2 0", + "resourceInvariantUuid":"4aa1e3ee-8318-4214-b2e8-29e7bc7528ce", + "resourceUuid":"2ca95a2b-b034-4e7e-97b5-636c21681652", + "resourceCustomizationUuid":"7f35f47b-3f60-41db-ab44-9ff89917d247" + } + }] +} diff --git a/server/src/main/resources/modelconfigunni.json b/server/src/main/resources/modelconfigunni.json new file mode 100644 index 00000000..7c8abe76 --- /dev/null +++ b/server/src/main/resources/modelconfigunni.json @@ -0,0 +1,41 @@ +{ + "subscriberId":"ISAAC_1", + "subscriptionType":"SOTN", + "serviceInvariantUuid":"5c13f3fb-2744-4635-9f1f-c59c92dc8f70", + "serviceUuid":"3a76b1f5-fb0d-4b6b-82d5-0e8a4ebc3838", + "globalSubscriberId":"test_custormer", + "serviceType":"example-service-type", + "status":1, + "servicemodelinformation":{ + "modelType":"service", + "model":{ + "resourceName":"sotn", + "resourceDescription":"sotn service", + "resourceInvariantUuid":"b36a7816-d4bf-4355-a3f1-20825ee7fce7", + "resourceUuid":"68db4561-8d85-4e7e-9653-7263118cb3ef", + "resourceCustomizationUuid":"" + } + }, + "resourcemodelinformation":[ + { + "modelType":"1", + "model":{ + "resourceName":"l2vppn", + "resourceDescription":"l2vpn resource", + "resourceInvariantUuid":"5448e42c-a22a-4bbd-bd24-387db52d3e58", + "resourceUuid":"0bf85631-6d70-471c-b97c-b5cc05056034", + "resourceCustomizationUuid":"" + } + }, + { + "modelType":"2", + "model":{ + "resourceName":"sotnUni", + "resourceDescription":"sotnUni Resource", + "resourceInvariantUuid":"66b96cb7-541d-4340-9bd6-8a5e37f1d5f1", + "resourceUuid":"60504c1f-8c3a-42c3-b071-1f1750688f3a", + "resourceCustomizationUuid":"c0f4205b-3101-41cf-90b3-aae6d97b3576" + } + } + ] +}
\ No newline at end of file diff --git a/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java b/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java index 7257e29c..0e683919 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java @@ -86,7 +86,7 @@ public class CcvpnCustomerServiceImplTest { @Test public void getQuerySubscriptionWithThrowsEexception(){ when(aaiService.getServiceSubscription("123")).thenReturn(failedCall("aai is not exist!")); - dsts.querySubscriptionType("123"); + dsts.querySubscriptionType(); } @Test |