Merge "Integrate sdc-tosca parser jar"
authorMatthieu Geerebaert <matthieu.geerebaert@orange.com>
Mon, 10 Dec 2018 16:41:01 +0000 (16:41 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 10 Dec 2018 16:41:01 +0000 (16:41 +0000)
13 files changed:
docs/administration/administration.rst
docs/architecture/architecture.rst
docs/consumedapis/consumedapis.rst
docs/delivery/delivery.rst
docs/humaninterfaces/humaninterfaces.rst
docs/index.rst
docs/installation/installation.rst
docs/offeredapis/offeredapis.rst
docs/offeredapis/pdf/nbicallflow.pdf
docs/offeredapis/swaggers/healthCheck_3_0_0.json [new file with mode: 0644]
docs/releasenotes/releasenotes.rst
src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java
tox.ini [new file with mode: 0644]

index 7abffd2..babf452 100644 (file)
@@ -1,5 +1,4 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -14,4 +13,3 @@ Processes
 
 Actions
 -------
-
index 31f0235..1ded2f6 100755 (executable)
@@ -1,6 +1,4 @@
-.. This work is licensed under
-.. a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -17,9 +15,9 @@ used by external systems as BSS for example.
 These API are based on **TMF API**.
 
 
-*******************************************
+**********************************************
 Global NBI architecture for Casablanca release
-*******************************************
+**********************************************
 
 Following illustration provides a global view about NBI architecture,
 integration with other ONAP components and API resource/operation provided.
@@ -38,4 +36,3 @@ could be found here: :doc:`NBI_Developer_Guide <NBI_Developer_Guide>`
 
 API Flow illustration (with example messages) is described in this document:
 :download:`nbicallflow.pdf <../offeredapis/pdf/nbicallflow.pdf>`
-
index 38418b3..02b5782 100755 (executable)
@@ -1,6 +1,4 @@
-.. This work is licensed under
-.. a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -57,9 +55,10 @@ SO API
 ******
 
 This API is used to perform Service Order and thus instantiate a service.
-Distinct SO APIs are used for serviceInstance creation request depending on the serviceSpecification category (set in SDC).
-If service could be delivered end-to-end from one request category is set to 'E2E Service'. 
-In this case NBI uses 
+Distinct SO APIs are used for serviceInstance creation request depending on the
+serviceSpecification category (set in SDC). If service could be delivered
+end-to-end from one request category is set to 'E2E Service'.
+In this case NBI uses
 
 ::
 
@@ -69,7 +68,7 @@ In this case NBI uses
 
     MSO_DELETE_REQUEST_STATUS_PATH = "/ecomp/mso/infra/serviceInstances/v6/"
 
-       
+
 else following API are used:
 
 ::
@@ -78,4 +77,4 @@ else following API are used:
 
     MSO_GET_REQUEST_STATUS_PATH = "/ecomp/mso/infra/orchestrationRequests/v6/"
 
-    MSO_DELETE_REQUEST_STATUS_PATH = "/ecomp/mso/infra/serviceInstances/v6/"
\ No newline at end of file
+    MSO_DELETE_REQUEST_STATUS_PATH = "/ecomp/mso/infra/serviceInstances/v6/"
index 0bbc8c5..6c79228 100644 (file)
@@ -1,5 +1,4 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -10,7 +9,8 @@ Delivery
 NBI Dockers Containers Structure
 ********************************
 
-Below is a diagram of the ExternalAPI/NBI project docker containers and the connections between them.
+Below is a diagram of the ExternalAPI/NBI project docker containers and the
+connections between them.
 
 .. blockdiag::
 
@@ -32,4 +32,3 @@ Below is a diagram of the ExternalAPI/NBI project docker containers and the conn
             MongoDB; MariaDB;
         }
     }
-
index 16f1835..506f1d8 100644 (file)
@@ -1,5 +1,4 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -8,4 +7,5 @@ Human Interfaces
 
 no Human Interface (pure Rest API project)
 
-Any "Rest Client" application may be used (Postman, ...) to interact with NBI application.
+Any "Rest Client" application may be used (Postman, ...) to interact with NBI
+application.
index 5196d1f..f420998 100644 (file)
@@ -1,5 +1,4 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 Orange
 
 ONAP ExternalAPI / NBI
index 89a55fb..ebf8c7a 100644 (file)
@@ -1,6 +1,4 @@
-.. This work is licensed under
-.. a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 
@@ -41,7 +39,8 @@ Defaults
 
     Mongo, host=localhost, port=27017, database=ServiceOrderDB
 
-    Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root, password=secret
+    Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root,
+    password=secret
 
 Run
 ::
@@ -99,4 +98,3 @@ configuration file and */json/* package with samples requests that can be run.
 **Play with Postman**
 
 A collection is available here *docs/offeredapis/postman*
-
index ce87e03..5b3c4ae 100644 (file)
@@ -87,7 +87,8 @@ API Table
    "serviceCatalog", ":download:`link <swaggers/serviceCatalog_3_0_0.json>`", ":download:`link <serviceCatalog/documentation.html>`", ":download:`link <serviceCatalog/apiServiceCatalog.plantuml>`", "coming", "coming", "coming"
    "serviceInventory", ":download:`link <swaggers/serviceInventory_3_0_0.json>`", ":download:`link <serviceInventory/documentation.html>`", ":download:`link <serviceInventory/apiServiceInventory.plantuml>`", "coming", "coming", "coming"
    "serviceOrder", ":download:`link <swaggers/serviceOrder_3_0_0.json>`", ":download:`link <serviceOrder/documentation.html>`", ":download:`link <serviceOrder/apiServiceOrder.plantuml>`", "coming", ":download:`link <postman/ONAPBeijingServiceOrderDoc.postman_collection.json>`", "coming"
-
+   "listener", ":download:`link <swaggers/listener-1_0_0.json>`", ":download:`link <listener/documentation.html>`", ":download:`link <listener/apiListener.plantuml>`", "coming", "coming", "coming"
+   "healthCheck", ":download:`link <swaggers/healthCheck_3_0_0.json>`", "coming", "coming", "coming", "coming", "coming"
 
 ***************
 API Description
index c84f0dc..8fc564b 100644 (file)
Binary files a/docs/offeredapis/pdf/nbicallflow.pdf and b/docs/offeredapis/pdf/nbicallflow.pdf differ
diff --git a/docs/offeredapis/swaggers/healthCheck_3_0_0.json b/docs/offeredapis/swaggers/healthCheck_3_0_0.json
new file mode 100644 (file)
index 0000000..8092cb0
--- /dev/null
@@ -0,0 +1,61 @@
+{
+  "swagger" : "2.0",
+  "info" : {
+    "description" : "This is the ONAP NBI HealthCheck API",
+    "version" : "3.0.0",
+    "title" : "NBI HealthCheck API",
+    "contact" : {
+      "email" : "romain.gimbert@orange.com"
+    },
+    "license" : {
+      "name" : "Apache 2.0",
+      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
+    }
+  },
+  "host" : "serverRoot",
+  "basePath" : "/nbi/api/v3",
+  "schemes" : [ "http" ],
+  "produces": [
+    "application/json;charset=utf-8"
+  ],
+  "paths" : {
+    "/status" : {
+      "get" : {
+        "summary" : "Displays health status for the NBI component",
+        "operationId" : "commitInfo",
+        "description" : "Displays health status for the NBI component",
+        "responses": {
+          "200": {
+            "description": "Service OK",
+            "schema": {
+              "$ref": "#/definitions/Status"
+            }
+          },
+          "503" : {
+            "description" : "Service Unavailable"
+          }
+        }
+      }
+    }
+  },
+  "definitions": {
+    "Status": {
+      "description": "NBI Status",
+      "type": "object",
+      "properties": {
+        "name": {
+          "description": "name of NBI component",
+              "type": "string"
+        },
+        "status": {
+          "description": "status of NBI component",
+              "type": "string"
+        },
+        "version": {
+          "description": "version of NBI component",
+              "type": "string"
+        }      
+      }
+    }
+  }
+}
index 1551e3a..cdf3090 100755 (executable)
@@ -1,15 +1,13 @@
-.. This work is licensed under a
-.. Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
+.. SPDX-License-Identifier: CC-BY-4.0
 .. Copyright 2018 ORANGE
 
 Release Notes
 =============
 
-Version: 3.0.0
+Version: 3.0.1
 --------------
 
-:Release Date: 2018-11-15
+:Release Date: 2018-11-30
 
 **New Features**
 
@@ -21,36 +19,29 @@ Main features are:
 - `EXTAPI-101 <https://jira.onap.org/browse/EXTAPI-101>`_ - Integrate ExtAPI/NBI to MSB
 - `EXTAPI-102 <https://jira.onap.org/browse/EXTAPI-102>`_ - Integrate ExtAPI/NBI to an E2E ONAP UC
 - `EXTAPI-116 <https://jira.onap.org/browse/EXTAPI-116>`_ - Help NBI user to get information when Service order fails
-- `EXTAPI-125 <https://jira.onap.org/browse/EXTAPI-125>`_ - Hadd support for progress percentage on ServiceOrder tracking
+- `EXTAPI-125 <https://jira.onap.org/browse/EXTAPI-125>`_ - Add support for progress percentage on ServiceOrder tracking
 
 Detail of features described in the readTheDoc documentation.
 
-**Bug Fixes**
-
-- `EXTAPI-70 <https://jira.onap.org/browse/EXTAPI-70>`_ - NBI should add relationship to tenant when creating service-subscription in AAI
-
-
 **Known Issues**
 
 No new issue (see Beijing ones)
 
 **Security Notes**
 
-To be completed
+- `Vulnerability Report <https://wiki.onap.org/pages/viewpage.action?pageId=45301150>`_
+
 Quick Links:
 
 - `External API project page <https://wiki.onap.org/display/DW/External+API+Framework+Project>`_
-- `Passing Badge information for External API <to be completed>`_
-- `Project Vulnerability Review Table for External API <to be completed>`_
 
 **Upgrade Notes**
 
-To be completed
+No upgrade available from Beijing
 
 **Deprecation Notes**
 
-No deprecated feature from Beijing.
+NA
 
 **Other**
 
index eb95792..be8bdc0 100644 (file)
-/**
- * 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.
- */
-package org.onap.nbi.apis.serviceorder.workflow;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.onap.nbi.apis.serviceorder.model.OrderItemRelationship;
-import org.onap.nbi.apis.serviceorder.model.ServiceOrder;
-import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem;
-import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask;
-import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderInfo;
-import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository;
-import org.onap.nbi.apis.serviceorder.utils.JsonEntityConverter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Service;
-
-@Service
-@EnableScheduling
-public class SOTaskManager {
-
-    @Autowired
-    private ExecutionTaskRepository executionTaskRepository;
-
-    @Autowired
-    private SOTaskProcessor soTaskProcessor;
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(SOTaskManager.class);
-
-    /**
-     * @param orderItems
-     * @param serviceOrderInfoJson
-     */
-    private void registerOrderItemExecutionPlan(List<ServiceOrderItem> orderItems,
-        String serviceOrderInfoJson) {
-        List<ExecutionTask> executionTasksSaved = new ArrayList<>();
-        Map<String, Long> internalIdOrderItemsMap = new HashMap<>();
-        if (orderItems != null) {
-            // first we save create all the execution tasks with order item id in relied tasks
-            for (ServiceOrderItem orderItem : orderItems) {
-                ExecutionTask task = new ExecutionTask();
-                task.setOrderItemId(orderItem.getId());
-                task.setCreateDate(new Date());
-                StringBuilder sb = new StringBuilder();
-                for (OrderItemRelationship orderItemRelationship : orderItem.getOrderItemRelationship()) {
-                    sb.append(orderItemRelationship.getId()).append(" ");
-                }
-                task.setReliedTasks(sb.toString());
-                task.setServiceOrderInfoJson(serviceOrderInfoJson);
-                ExecutionTask savedTask = executionTaskRepository.save(task);
-                executionTasksSaved.add(savedTask);
-
-                internalIdOrderItemsMap.put(savedTask.getOrderItemId(), savedTask.getInternalId());
-            }
-            // then we replace all orderitem ids in reliedtasks field with internalid of the tasks
-            for (ExecutionTask executionTask : executionTasksSaved) {
-                for (Entry<String, Long> entry : internalIdOrderItemsMap.entrySet()) {
-                    String replace = executionTask.getReliedTasks().replace(entry.getKey(),
-                        String.valueOf(entry.getValue()));
-                    executionTask.setReliedTasks(replace);
-                }
-                if(LOGGER.isDebugEnabled()) {
-                    LOGGER.debug("saving task with id {} , orderItemId {} , reliedtasks {}", executionTask.getInternalId(),
-                        executionTask.getOrderItemId(), executionTask.getReliedTasks());
-                }
-                executionTaskRepository.save(executionTask);
-            }
-        }
-    }
-
-    /**
-     *
-     * @param serviceOrder
-     * @param serviceOrderInfo
-     */
-    public void registerServiceOrder(ServiceOrder serviceOrder, ServiceOrderInfo serviceOrderInfo) {
-        String serviceOrderInfoJson = JsonEntityConverter.convertServiceOrderInfoToJson(serviceOrderInfo);
-        registerOrderItemExecutionPlan(serviceOrder.getOrderItem(), serviceOrderInfoJson);
-    }
-
-    // Using fixedDelay to mitigate against Scheduler queue backlog with fixedRate 
-    @Scheduled(fixedDelay = 2000)
-    private void processExecutionPlan() throws InterruptedException {
-        List<ExecutionTask> taskToExecute = executionTaskRepository.findByReliedTasksIsEmpty();
-        for (ExecutionTask executionTask : taskToExecute) {
-            soTaskProcessor.processOrderItem(executionTask);
-        }
-    }
-}
+/**\r
+ * Copyright (c) 2018 Orange\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with\r
+ * the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on\r
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations under the License.\r
+ */\r
+package org.onap.nbi.apis.serviceorder.workflow;\r
+\r
+import java.util.*;\r
+import java.util.Map.Entry;\r
+import org.onap.nbi.apis.serviceorder.model.OrderItemRelationship;\r
+import org.onap.nbi.apis.serviceorder.model.ServiceOrder;\r
+import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem;\r
+import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask;\r
+import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderInfo;\r
+import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository;\r
+import org.onap.nbi.apis.serviceorder.utils.JsonEntityConverter;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.scheduling.annotation.EnableScheduling;\r
+import org.springframework.scheduling.annotation.Scheduled;\r
+import org.springframework.stereotype.Service;\r
+\r
+@Service\r
+@EnableScheduling\r
+public class SOTaskManager {\r
+\r
+    @Autowired\r
+    private ExecutionTaskRepository executionTaskRepository;\r
+\r
+    @Autowired\r
+    private SOTaskProcessor soTaskProcessor;\r
+\r
+    private static final Logger LOGGER = LoggerFactory.getLogger(SOTaskManager.class);\r
+\r
+    /**\r
+     * @param orderItems\r
+     * @param serviceOrderInfoJson\r
+     */\r
+    private void registerOrderItemExecutionPlan(List<ServiceOrderItem> orderItems,\r
+        String serviceOrderInfoJson) {\r
+        List<ExecutionTask> executionTasksSaved = new ArrayList<>();\r
+        Map<String, Long> internalIdOrderItemsMap = new HashMap<>();\r
+        if (orderItems != null) {\r
+            // first we save create all the execution tasks with order item id in relied tasks\r
+            for (ServiceOrderItem orderItem : orderItems) {\r
+                ExecutionTask task = new ExecutionTask();\r
+                task.setOrderItemId(orderItem.getId());\r
+                task.setCreateDate(new Date());\r
+                StringBuilder sb = new StringBuilder();\r
+                for (OrderItemRelationship orderItemRelationship : orderItem.getOrderItemRelationship()) {\r
+                    sb.append(orderItemRelationship.getId()).append(" ");\r
+                }\r
+                task.setReliedTasks(sb.toString());\r
+                task.setServiceOrderInfoJson(serviceOrderInfoJson);\r
+                ExecutionTask savedTask = executionTaskRepository.save(task);\r
+                executionTasksSaved.add(savedTask);\r
+\r
+                internalIdOrderItemsMap.put(savedTask.getOrderItemId(), savedTask.getInternalId());\r
+            }\r
+            // then we replace all orderitem ids in reliedtasks field with internalid of the tasks\r
+            for (ExecutionTask executionTask : executionTasksSaved) {\r
+                List<String> reliedOrderItemsIds = new ArrayList<String>(Arrays.asList(executionTask.getReliedTasks().split(" ")));\r
+                List<String> reliedTasksInternalIds = new ArrayList<String>();\r
+                for (Entry<String, Long> entry : internalIdOrderItemsMap.entrySet()){\r
+                   if(reliedOrderItemsIds.contains(entry.getKey())) {\r
+                       reliedTasksInternalIds.add(entry.getValue().toString());\r
+                    }\r
+                }\r
+            String reliedTasksString = String.join(" ", reliedTasksInternalIds);\r
+            executionTask.setReliedTasks(reliedTasksString);\r
+                if(LOGGER.isDebugEnabled()) {\r
+                    LOGGER.debug("saving task with id {} , orderItemId {} , reliedtasks {}", executionTask.getInternalId(), executionTask.getOrderItemId(), executionTask.getReliedTasks());\r
+                }\r
+                executionTaskRepository.save(executionTask);\r
+            }\r
+        }\r
+    }\r
+\r
+    /**\r
+     *\r
+     * @param serviceOrder\r
+     * @param serviceOrderInfo\r
+     */\r
+    public void registerServiceOrder(ServiceOrder serviceOrder, ServiceOrderInfo serviceOrderInfo) {\r
+        String serviceOrderInfoJson = JsonEntityConverter.convertServiceOrderInfoToJson(serviceOrderInfo);\r
+        registerOrderItemExecutionPlan(serviceOrder.getOrderItem(), serviceOrderInfoJson);\r
+    }\r
+\r
+    // Using fixedDelay to mitigate against Scheduler queue backlog with fixedRate \r
+    @Scheduled(fixedDelay = 2000)\r
+    private void processExecutionPlan() throws InterruptedException {\r
+        List<ExecutionTask> taskToExecute = executionTaskRepository.findByReliedTasksIsEmpty();\r
+        for (ExecutionTask executionTask : taskToExecute) {\r
+            soTaskProcessor.processOrderItem(executionTask);\r
+        }\r
+    }\r
+}\r
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..1e81466
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,7 @@
+[tox]
+envlist = docs
+skipsdist = True
+
+[testenv]
+deps = doc8
+commands = doc8 docs