diff options
-rw-r--r-- | docs/administration/administration.rst | 16 | ||||
-rw-r--r-- | docs/configuration/configuration.rst | 7 | ||||
-rw-r--r-- | docs/consumedapis/consumedapis.rst | 7 | ||||
-rw-r--r-- | docs/delivery/delivery.rst | 9 | ||||
-rw-r--r-- | docs/humaninterfaces/humaninterfaces.rst | 7 | ||||
-rw-r--r-- | docs/index.rst | 9 | ||||
-rw-r--r-- | docs/installation/installation.rst | 15 | ||||
-rw-r--r-- | docs/logging/logging.rst | 15 | ||||
-rw-r--r-- | docs/releasenotes/releasenotes.rst | 33 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/OnapComponentsUrlPaths.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java | 19 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/workflow/CheckOrderConsistenceManager.java | 42 | ||||
-rw-r--r-- | src/test/resources/mappings/so_delete_service_instance.json | 2 | ||||
-rw-r--r-- | src/test/resources/mappings/so_post_create_service_instance.json | 2 |
14 files changed, 155 insertions, 32 deletions
diff --git a/docs/administration/administration.rst b/docs/administration/administration.rst new file mode 100644 index 0000000..c5353ae --- /dev/null +++ b/docs/administration/administration.rst @@ -0,0 +1,16 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Administration +============== + + + +Processes +--------- + + +Actions +------- diff --git a/docs/configuration/configuration.rst b/docs/configuration/configuration.rst new file mode 100644 index 0000000..b6619ce --- /dev/null +++ b/docs/configuration/configuration.rst @@ -0,0 +1,7 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Configuration +============= diff --git a/docs/consumedapis/consumedapis.rst b/docs/consumedapis/consumedapis.rst new file mode 100644 index 0000000..fd5395f --- /dev/null +++ b/docs/consumedapis/consumedapis.rst @@ -0,0 +1,7 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Consumed APIs +============= diff --git a/docs/delivery/delivery.rst b/docs/delivery/delivery.rst new file mode 100644 index 0000000..7ef857a --- /dev/null +++ b/docs/delivery/delivery.rst @@ -0,0 +1,9 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Delivery +======== + + diff --git a/docs/humaninterfaces/humaninterfaces.rst b/docs/humaninterfaces/humaninterfaces.rst new file mode 100644 index 0000000..89009f1 --- /dev/null +++ b/docs/humaninterfaces/humaninterfaces.rst @@ -0,0 +1,7 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Human Interfaces +================ diff --git a/docs/index.rst b/docs/index.rst index e39fb0d..8c111be 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,4 +8,13 @@ ONAP ExternalAPI / NBI .. toctree:: :maxdepth: 1 + architecture/NBI_R1_Developer_Guide.rst offeredapis/NBI_R1_interface.rst + consumedapis/consumedapis.rst + delivery/delivery.rst + logging/logging.rst + installation/installation.rst + configuration/configuration.rst + administation/administration.rst + humaninterfaces/humaninterfaces.rst + releasenotes/releasenotes.rst diff --git a/docs/installation/installation.rst b/docs/installation/installation.rst new file mode 100644 index 0000000..a6ab912 --- /dev/null +++ b/docs/installation/installation.rst @@ -0,0 +1,15 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Installation +============ + + +Environment +----------- + + +Steps +----- diff --git a/docs/logging/logging.rst b/docs/logging/logging.rst new file mode 100644 index 0000000..5f61066 --- /dev/null +++ b/docs/logging/logging.rst @@ -0,0 +1,15 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Logging +======= + + +Where to Access Information +--------------------------- + + +Error / Warning Messages +------------------------ diff --git a/docs/releasenotes/releasenotes.rst b/docs/releasenotes/releasenotes.rst new file mode 100644 index 0000000..a4ef6fb --- /dev/null +++ b/docs/releasenotes/releasenotes.rst @@ -0,0 +1,33 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 ORANGE + + +Release Notes +============= + + +Version: +-------------- + + +:Release Date: + + +**New Features** + +**Bug Fixes** + +**Known Issues** + +**Security Issues** + +**Upgrade Notes** + +**Deprecation Notes** + +**Other** + +=========== + +End of Release Notes diff --git a/src/main/java/org/onap/nbi/OnapComponentsUrlPaths.java b/src/main/java/org/onap/nbi/OnapComponentsUrlPaths.java index 989df02..a6e943b 100644 --- a/src/main/java/org/onap/nbi/OnapComponentsUrlPaths.java +++ b/src/main/java/org/onap/nbi/OnapComponentsUrlPaths.java @@ -42,7 +42,7 @@ public final class OnapComponentsUrlPaths { "/aai/v11/business/customers/customer/$customerId/service-subscriptions/service-subscription/$serviceSpecName/service-instances/"; // MSO - public static final String MSO_CREATE_SERVICE_INSTANCE_PATH = "/ecomp/mso/infra/serviceInstance/v4"; + public static final String MSO_CREATE_SERVICE_INSTANCE_PATH = "/ecomp/mso/infra/serviceInstances/v4"; public static final String MSO_GET_REQUEST_STATUS_PATH = "/ecomp/mso/infra/orchestrationRequests/v4/"; - public static final String MSO_DELETE_REQUEST_STATUS_PATH = "/ecomp/mso/infra/serviceInstances/"; + public static final String MSO_DELETE_REQUEST_STATUS_PATH = "/ecomp/mso/infra/serviceInstances/v4/"; } diff --git a/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java b/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java index 707c9e9..a4347d4 100644 --- a/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java +++ b/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java @@ -102,16 +102,19 @@ public class ServiceInventoryService { List<LinkedHashMap> vnfs = new ArrayList<>(); LinkedHashMap relationShip = (LinkedHashMap) serviceResponse.get("relationship-list"); - List<LinkedHashMap> relationsList = (List<LinkedHashMap>) relationShip.get("relationship"); - for (LinkedHashMap relation : relationsList) { - String relatedLink = (String) relation.get("related-link"); - LinkedHashMap vnf = aaiClient.getVNF(relatedLink); - if (vnf != null) { - vnfs.add(vnf); + if(relationShip!=null) { + List<LinkedHashMap> relationsList = (List<LinkedHashMap>) relationShip.get("relationship"); + if(relationsList!=null) { + for (LinkedHashMap relation : relationsList) { + String relatedLink = (String) relation.get("related-link"); + LinkedHashMap vnf = aaiClient.getVNF(relatedLink); + if (vnf != null) { + vnfs.add(vnf); + } + } + serviceResponse.put("vnfs", vnfs); } } - serviceResponse.put("vnfs", vnfs); - } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/CheckOrderConsistenceManager.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/CheckOrderConsistenceManager.java index 1fb57ef..470b161 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/CheckOrderConsistenceManager.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/CheckOrderConsistenceManager.java @@ -1,17 +1,17 @@ /** - * Copyright (c) 2018 Orange - * - * 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. + * Copyright (c) 2018 Orange + * <p> + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.nbi.apis.serviceorder.workflow; @@ -28,6 +28,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; + import java.util.LinkedHashMap; @Service @@ -64,7 +65,7 @@ public class CheckOrderConsistenceManager { isAllItemsInAdd = false; if (isCustomerFromServiceOrderPresentInInventory(serviceOrderInfo) && existServiceInInventory(serviceOrderItem, serviceOrderItemInfo, - serviceOrderInfo.getSubscriberInfo().getGlobalSubscriberId())) { + serviceOrderInfo.getSubscriberInfo().getGlobalSubscriberId())) { serviceOrderInfo.addServiceOrderItemInfos(serviceOrderItem.getId(), serviceOrderItemInfo); } else { isServiceOrderRejected = true; @@ -108,9 +109,11 @@ public class CheckOrderConsistenceManager { private RelatedParty getCustomerFromServiceOrder(ServiceOrder serviceOrder) { - for (RelatedParty relatedParty : serviceOrder.getRelatedParty()) { - if ("ONAPcustomer".equalsIgnoreCase(relatedParty.getRole())) { - return relatedParty; + if (serviceOrder.getRelatedParty() != null) { + for (RelatedParty relatedParty : serviceOrder.getRelatedParty()) { + if ("ONAPcustomer".equalsIgnoreCase(relatedParty.getRole())) { + return relatedParty; + } } } return null; @@ -128,7 +131,7 @@ public class CheckOrderConsistenceManager { } private boolean existServiceInInventory(ServiceOrderItem serviceOrderItem, - ServiceOrderItemInfo serviceOrderItemInfo, String globalSubscriberId) { + ServiceOrderItemInfo serviceOrderItemInfo, String globalSubscriberId) { if (!StringUtils.isEmpty(serviceOrderItem.getService().getId())) { String serviceName = (String) serviceOrderItemInfo.getCatalogResponse().get("name"); boolean serviceExistInInventory = serviceOrderConsumerService.doesServiceExistInServiceInventory( @@ -145,7 +148,7 @@ public class CheckOrderConsistenceManager { } private void handleServiceFromCatalog(ServiceOrderItem serviceOrderItem, - ServiceOrderItemInfo serviceOrderItemInfo) { + ServiceOrderItemInfo serviceOrderItemInfo) { ResponseEntity<Object> response = serviceOrderConsumerService .getServiceCatalog(serviceOrderItem.getService().getServiceSpecification().getId()); if (response != null && (response.getStatusCode().equals(HttpStatus.OK) @@ -156,5 +159,4 @@ public class CheckOrderConsistenceManager { } - } diff --git a/src/test/resources/mappings/so_delete_service_instance.json b/src/test/resources/mappings/so_delete_service_instance.json index a2e854e..fae7b9e 100644 --- a/src/test/resources/mappings/so_delete_service_instance.json +++ b/src/test/resources/mappings/so_delete_service_instance.json @@ -1,7 +1,7 @@ { "request": { "method": "DELETE", - "url": "/ecomp/mso/infra/serviceInstances/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb" + "url": "/ecomp/mso/infra/serviceInstances/v4/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb" }, "response": { "status": 201, diff --git a/src/test/resources/mappings/so_post_create_service_instance.json b/src/test/resources/mappings/so_post_create_service_instance.json index 4b61b2c..239aecb 100644 --- a/src/test/resources/mappings/so_post_create_service_instance.json +++ b/src/test/resources/mappings/so_post_create_service_instance.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "url": "/ecomp/mso/infra/serviceInstance/v4" + "url": "/ecomp/mso/infra/serviceInstances/v4" }, "response": { "status": 201, |