Merge "Add support for HTTPS with self signed certificates"
authorAdrian OSullivan <adrian.osullivan@huawei.com>
Mon, 13 Jan 2020 09:54:59 +0000 (09:54 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 13 Jan 2020 09:54:59 +0000 (09:54 +0000)
docs/offeredapis/api_hub/swagger.json
docs/offeredapis/api_hub/swagger.yaml
docs/offeredapis/api_serviceInventory/swagger.json
docs/offeredapis/api_serviceInventory/swagger.yaml
docs/offeredapis/api_serviceOrder/swagger.json
docs/offeredapis/api_serviceOrder/swagger.yaml
docs/offeredapis/api_status/swagger.json
docs/offeredapis/api_status/swagger.yaml
src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java
src/main/java/org/onap/nbi/apis/serviceorder/utils/MacroServiceUtils.java [new file with mode: 0644]
src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java

index 2b5e61c..66d18a4 100644 (file)
@@ -4,15 +4,26 @@
     "info": {
     "description": "Provides the ability to subscribe to and unsubscribe from External API notifications.\n\n**Main operation**\n\n```\nPOST /hub\n```\n\nrequest sample 1\n\n```\n{\n  \"callback\": \"http://mydomain/notification\",\n  \"query\": \"eventType = ServiceOrderCreationNotification\"\n}\n```\n\nrequest sample 2\n\n```\n{\n  \"callback\": \"http://mydomain/notification\",\n  \"query\": \"eventType=ServiceOrderCreationNotification,ServiceOrderStateChangeNotification\"\n}\n```\n\n**EventType for serviceOrdering**\n\n- ServiceOrderCreationNotification\n- ServiceOrderStateChangeNotification\n- ServiceOrderItemStateChangeNotification\n\n**EventType for serviceInventory**\n\n- ServiceCreationNotification\n- ServiceAttributeValueChangeNotification\n- ServiceRemoveNotification\n\n",
     "version": "4.0.1",
-    "title": "API Hub",
+    "title": "Hub API",
+    "contact": {
+      "name": "ONAP",
+      "url": "https://onap.readthedocs.io",
+      "email": "onap-discuss@lists.onap.org"
+    },
+    "license": {
+      "name": "Apache 2.0",
+      "url": "http://www.apache.org/licenses/LICENSE-2.0"
+    },
+    "x-planned-retirement-date": "205001",
+    "x-component": "NBI",
     "x-logo": {
     "url": "/redoc/logo.png",
     "backgroundColor": "#FFFFFF"
     }
     },
     
-      "host": "api.orange.com",
-      "basePath":      "/",
+      "host": "serverRoot:30274",
+      "basePath": "/nbi/api/v4",
       "schemes": [
       "http"
       ],
@@ -38,7 +49,7 @@
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "hubCreate",
+    "operationId": "hub_Create",
     "summary": "create hub",
     "description": "",
     "deprecated": false,
@@ -72,7 +83,7 @@
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "hubFind",
+    "operationId": "hub_Find",
     "summary": "find hub",
     "description": "",
     "deprecated": false,
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "hubGet",
+    "operationId": "hub_Get",
     "summary": "get hub",
     "description": "",
     "deprecated": false,
     "tags": [
     "Hub"
     ],
-    "operationId": "hubDelete",
+    "operationId": "hub_Delete",
     "summary": "delete hub",
     "description": "",
     "deprecated": false,
index dc8e16b..5ddb5d8 100644 (file)
@@ -23,12 +23,21 @@ info:
     \n**EventType for serviceInventory**\n\n- ServiceCreationNotification\n- ServiceAttributeValueChangeNotification\n\
     - ServiceRemoveNotification\n\n"
   version: "4.0.1"
-  title: "API Hub"
+  title: "Hub API"
+  contact:
+    name: "ONAP"
+    url: "https://onap.readthedocs.io"
+    email: "onap-discuss@lists.onap.org"
+  license:
+    name: "Apache 2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0"
+  x-planned-retirement-date: "205001"
+  x-component: "NBI"
   x-logo:
     url: "/redoc/logo.png"
     backgroundColor: "#FFFFFF"
-host: "api.orange.com"
-basePath: "/"
+host: "serverRoot:30274"
+basePath: "/nbi/api/v4"
 schemes:
 - "http"
 produces:
@@ -45,7 +54,7 @@ paths:
       - "application/json;charset=utf-8"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "hubCreate"
+      operationId: "hub_Create"
       summary: "create hub"
       description: ""
       deprecated: false
@@ -66,7 +75,7 @@ paths:
       - "Hub"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "hubFind"
+      operationId: "hub_Find"
       summary: "find hub"
       description: ""
       deprecated: false
@@ -83,7 +92,7 @@ paths:
       - "Hub"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "hubGet"
+      operationId: "hub_Get"
       summary: "get hub"
       description: ""
       deprecated: false
@@ -100,7 +109,7 @@ paths:
     delete:
       tags:
       - "Hub"
-      operationId: "hubDelete"
+      operationId: "hub_Delete"
       summary: "delete hub"
       description: ""
       deprecated: false
index f67e1b6..47e7610 100644 (file)
@@ -4,14 +4,25 @@
     "info": {
     "description": "Query information about instantiated services\n\nList of available subscription for serviceInventory notifications, see /hub resources for more information:\n\n- ServiceCreationNotification\n- ServiceAttributeValueChangeNotification\n- ServiceRemoveNotification\n\n",
     "version": "4.0.1",
-    "title": "API ServiceInventory",
+    "title": "ServiceInventory API",
+    "contact": {
+      "name": "ONAP",
+      "url": "https://onap.readthedocs.io",
+      "email": "onap-discuss@lists.onap.org"
+    },
+    "license": {
+      "name": "Apache 2.0",
+      "url": "http://www.apache.org/licenses/LICENSE-2.0"
+    },
+    "x-planned-retirement-date": "205001",
+    "x-component": "NBI",
     "x-logo": {
     "url": "/redoc/logo.png",
     "backgroundColor": "#FFFFFF"
     }
     },
     
-      "host": "localhost:8080",
+      "host": "serverRoot:30274",
       "basePath":      "/nbi/api/v4",
       "schemes": [
       "http"
@@ -39,7 +50,7 @@
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "serviceFind",
+    "operationId": "service_Find",
     "summary": "List services",
     "description": "This operation list service entities. \nAttribute selection is restricted. \nfields attribute may be used to filter retrieved attribute(s) for each service",
     "deprecated": false,
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "serviceGet",
+    "operationId": "service_Get",
     "summary": "Retrieve a service",
     "description": "This operation retrieves a service entity. \nAttribute selection is enabled for all first level attributes.",
     "deprecated": false,
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "notificationCreate",
+    "operationId": "notification_Create",
     "summary": "NBI will send notification to this operation provided by subscribers",
     "description": "",
     "deprecated": false,
index 8f2ebee..f783679 100644 (file)
@@ -18,11 +18,20 @@ info:
     \ information:\n\n- ServiceCreationNotification\n- ServiceAttributeValueChangeNotification\n\
     - ServiceRemoveNotification\n\n"
   version: "4.0.1"
-  title: "API ServiceInventory"
+  title: "ServiceInventory API"
+  contact:
+    name: "ONAP"
+    url: "https://onap.readthedocs.io"
+    email: "onap-discuss@lists.onap.org"
+  license:
+    name: "Apache 2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0"
+  x-planned-retirement-date: "205001"
+  x-component: "NBI"
   x-logo:
     url: "/redoc/logo.png"
     backgroundColor: "#FFFFFF"
-host: "localhost:8080"
+host: "serverRoot:30274"
 basePath: "/nbi/api/v4"
 schemes:
 - "http"
@@ -41,7 +50,7 @@ paths:
       - "Service"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "serviceFind"
+      operationId: "service_Find"
       summary: "List services"
       description: "This operation list service entities. \nAttribute selection is\
         \ restricted. \nfields attribute may be used to filter retrieved attribute(s)\
@@ -86,7 +95,7 @@ paths:
       - "Service"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "serviceGet"
+      operationId: "service_Get"
       summary: "Retrieve a service"
       description: "This operation retrieves a service entity. \nAttribute selection\
         \ is enabled for all first level attributes."
@@ -109,7 +118,7 @@ paths:
       - "application/json;charset=utf-8"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "notificationCreate"
+      operationId: "notification_Create"
       summary: "NBI will send notification to this operation provided by subscribers"
       description: ""
       deprecated: false
index 947cfe0..6c01155 100644 (file)
@@ -1,15 +1,26 @@
 {
   "swagger": "2.0",
   "info": {
-    "description": "Request the instantiation of a service\n\nA Service Order is a type of order which can be used to describe a group of operations on service – one service order item per service. An action at the level of the service order item describe the operation to be done on a service (add, terminate for example). The service order is triggered from the BSS system in charge of the product order management to ONAP that will manage the service fulfillment.\n\nList of available subscription for serviceOrdering notifications, see /hub resources for more information:\n\n- ServiceOrderCreationNotification\n- ServiceOrderStateChangeNotification\n- ServiceOrderItemStateChangeNotification\n\n",
+    "description": "Request the instantiation, deletion or modification of a service\n\nA Service Order is a type of order which can be used to describe a group of operations on service – one service order item per service. An action at the level of the service order item describes the operation to be completed on a service (add, delete for example). The service order is triggered from external system such as the BSS system in charge of the product order management to ONAP that will manage the service fulfillment.\n\nList of available subscription for serviceOrdering notifications, see /hub resources for more information:\n\n- ServiceOrderCreationNotification\n- ServiceOrderStateChangeNotification\n- ServiceOrderItemStateChangeNotification\n\n",
     "version": "4.0.1",
-    "title": "API ServiceOrder",
+    "title": "ServiceOrder API",
+    "contact": {
+      "name": "ONAP",
+      "url": "https://onap.readthedocs.io",
+      "email": "onap-discuss@lists.onap.org"
+    },
+    "license": {
+      "name": "Apache 2.0",
+      "url": "http://www.apache.org/licenses/LICENSE-2.0"
+    },
+    "x-planned-retirement-date": "205001",
+    "x-component": "NBI",
     "x-logo": {
       "url": "/redoc/logo.png",
       "backgroundColor": "#FFFFFF"
     }
   },
-  "host": "localhost:8080",
+  "host": "serverRoot:30274",
   "basePath": "/nbi/api/v4",
   "schemes": [
     "http"
@@ -39,7 +50,7 @@
         "produces": [
           "application/json;charset=utf-8"
         ],
-        "operationId": "serviceOrderCreate",
+        "operationId": "serviceOrder_Create",
         "summary": "Create a service order",
         "description": "This operation creates a service order entity.\nThe TMF Open API specification document provides the list of mandatory and non mandatory attributes when creating a ServiceOrder, including any possible rule conditions and applicable default values.\nPOST should be used without specifying the id and the href, the Service Order Management system is in charge of generating the id + href for the ServiceOrder.\n\nIn Beijing Release, NBI will use only POST {{url}}/ecomp/mso/infra/serviceInstances/v4 SO API. This mean that only the 'service-instance' level will be created in AAI. Additional resource like VNF and/OR VF are not created.\n\nIn Casablanca release, NBI has been improved to also be able to use POST {{url}}/e2eServiceInstances/v3 SO API. This API is able to instantiate in ONAP E2E service; This is useful for CCVPN and VoLTE UC.\nDepending on the service category defined in SDC, NBI will use one or the other SO API. If category starts with e2e, NBI will use  {url}}/e2eServiceInstances/v3 SO API - else it will use {{url}}/ecomp/mso/infra/serviceInstances/v4 SO API.",
         "deprecated": false,
@@ -77,7 +88,7 @@
         "produces": [
           "application/json;charset=utf-8"
         ],
-        "operationId": "serviceOrderFind",
+        "operationId": "serviceOrder_Find",
         "summary": "List service orders",
         "description": "Retrieve and list service order entities according to given criteria.\nOnly a predefined set of attribute is proposed.\nAttribute selection could be described in the fields attribute.",
         "deprecated": false,
         "produces": [
           "application/json;charset=utf-8"
         ],
-        "operationId": "serviceOrderGet",
+        "operationId": "serviceOrder_Get",
         "summary": "Retrieve a service order",
         "description": "This operation retrieves a service order entity. \nAttribute selection is enabled for all first level attributes.",
         "deprecated": false,
         "produces": [
           "application/json;charset=utf-8"
         ],
-        "operationId": "notificationCreate",
+        "operationId": "notification_Create",
         "summary": "NBI will send notification to this operation provided by subscribers",
         "description": "Notification structure depends of the eventType:\n\n- ServiceOrderCreationNotification\n- ServiceOrderStateChangeNotification\n\n```\n{\n  \"eventId\": \"string\",\n  \"eventDate\": \"2019-03-12T16:21:27.530Z\",\n  \"eventType\": \"string\",\n  \"event\": {\n    \"id\": \"string\",\n    \"href\": \"string\",\n    \"externalId\": \"string\",\n    \"state\": \"acknowledged\",\n    \"orderDate\": \"2019-03-12T16:21:27.530Z\",\n    \"completionDateTime\": \"2019-03-12T16:21:27.530Z\"\n  }\n}\n```\n\n- ServiceOrderItemStateChangeNotification\n\n```\n{\n  \"eventId\": \"string\",\n  \"eventDate\": \"2019-03-12T16:21:44.066Z\",\n  \"eventType\": \"string\",\n  \"event\": {\n    \"id\": \"string\",\n    \"href\": \"string\",\n    \"externalId\": \"string\",\n    \"state\": \"acknowledged\",\n    \"orderDate\": \"2019-03-12T16:21:44.066Z\",\n    \"completionDateTime\": \"2019-03-12T16:21:44.066Z\",\n    \"orderItem\": [\n      {\n        \"id\": \"string\",\n        \"action\": \"add\",\n        \"state\": \"acknowledged\",\n        \"service\": {\n          \"id\": \"string\",\n          \"href\": \"string\",\n          \"name\": \"string\",\n          \"serviceState\": \"string\",\n          \"serviceCharacteristic\": [\n            {\n              \"name\": \"string\",\n              \"valueType\": \"string\",\n              \"value\": {\n                \"serviceCharacteristicValue\": \"string\"\n              }\n            }\n          ],\n          \"serviceRelationship\": [\n            {\n              \"type\": \"reliesOn\"\n            }\n          ],\n          \"relatedParty\": [\n            {\n              \"id\": \"string\",\n              \"href\": \"string\",\n              \"role\": \"string\",\n              \"name\": \"string\",\n              \"@referredType\": \"string\"\n            }\n          ],\n          \"serviceSpecification\": {\n            \"id\": \"string\",\n            \"href\": \"string\",\n            \"name\": \"string\",\n            \"version\": \"string\",\n          }\n        }\n      }\n    ]\n  }\n}\n```",
         "deprecated": false,
index 2108fc3..0ab06bc 100644 (file)
 #    limitations under the License.swagger: "2.0"
 swagger: "2.0"
 info:
-  description: "Request the instantiation of a service\n\nA Service Order is a type\
+  description: "Request the instantiation, deletion or modification of a service\n\nA Service Order is a type\
     \ of order which can be used to describe a group of operations on service – one\
     \ service order item per service. An action at the level of the service order\
-    \ item describe the operation to be done on a service (add, terminate for example).\
-    \ The service order is triggered from the BSS system in charge of the product\
+    \ item describe the operation to be done on a service (add, delete for example).\
+    \ The service order is triggered from external system such as the BSS system in charge of the product\
     \ order management to ONAP that will manage the service fulfillment.\n\nList of\
     \ available subscription for serviceOrdering notifications, see /hub resources\
     \ for more information:\n\n- ServiceOrderCreationNotification\n- ServiceOrderStateChangeNotification\n\
     - ServiceOrderItemStateChangeNotification\n\n"
   version: "4.0.1"
-  title: "API ServiceOrder"
+  title: "ServiceOrder API"
+  contact:
+    name: "ONAP"
+    url: "https://onap.readthedocs.io"
+    email: "onap-discuss@lists.onap.org"
+  license:
+    name: "Apache 2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0"
+  x-planned-retirement-date: "205001"
+  x-component: "NBI"
   x-logo:
     url: "/redoc/logo.png"
     backgroundColor: "#FFFFFF"
-host: "localhost:8080"
+host: "serverRoot:30274"
 basePath: "/nbi/api/v4"
 schemes:
 - "http"
@@ -47,7 +56,7 @@ paths:
       - "application/json;charset=utf-8"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "serviceOrderCreate"
+      operationId: "serviceOrder_Create"
       summary: "Create a service order"
       description: "This operation creates a service order entity.\nThe TMF Open API\
         \ specification document provides the list of mandatory and non mandatory\
@@ -87,7 +96,7 @@ paths:
       - "ServiceOrder"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "serviceOrderFind"
+      operationId: "serviceOrder_Find"
       summary: "List service orders"
       description: "Retrieve and list service order entities according to given criteria.\n\
         Only a predefined set of attribute is proposed.\nAttribute selection could\
@@ -161,7 +170,7 @@ paths:
       - "ServiceOrder"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "serviceOrderGet"
+      operationId: "serviceOrder_Get"
       summary: "Retrieve a service order"
       description: "This operation retrieves a service order entity. \nAttribute selection\
         \ is enabled for all first level attributes."
@@ -195,7 +204,7 @@ paths:
       - "application/json;charset=utf-8"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "notificationCreate"
+      operationId: "notification_Create"
       summary: "NBI will send notification to this operation provided by subscribers"
       description: "Notification structure depends of the eventType:\n\n- ServiceOrderCreationNotification\n\
         - ServiceOrderStateChangeNotification\n\n```\n{\n  \"eventId\": \"string\"\
index aaeeeb5..344b684 100644 (file)
@@ -4,15 +4,26 @@
     "info": {
     "description": "Provides a healthcheck to verify that the NBI component is running fine as a standalone application or can also communicate with other onap modules.\n\n",
     "version": "4.0.1",
-    "title": "API Status",
+    "title": "Status API",
+    "contact": {
+      "name": "ONAP",
+      "url": "https://onap.readthedocs.io",
+      "email": "onap-discuss@lists.onap.org"
+    },
+    "license": {
+      "name": "Apache 2.0",
+      "url": "http://www.apache.org/licenses/LICENSE-2.0"
+    },
+    "x-planned-retirement-date": "205001",
+    "x-component": "NBI",
     "x-logo": {
     "url": "/redoc/logo.png",
     "backgroundColor": "#FFFFFF"
     }
     },
     
-      "host": "localhost:8080",
-      "basePath":      "/nbi/api/v4",
+      "host": "serverRoot:30274",
+      "basePath":"/nbi/api/v4",
       "schemes": [
       "http"
       ],
@@ -35,7 +46,7 @@
         "produces": [
            "application/json;charset=utf-8"
       ],
-    "operationId": "statusFind",
+    "operationId": "status_Find",
     "summary": "retrieve application status",
     "description": "* Default\n\n```\n{\n    \"name\": \"nbi\",\n    \"status\": \"ok\",\n    \"version\": \"v3\"\n}\n```\n\n* Optional\n\n```\n?fullStatus=true\n```\n\n```\n{\n    \"name\": \"nbi\",\n    \"status\": \"ok\",\n    \"version\": \"v3\",\n    \"components\": [\n        {\n            \"name\": \"sdc connectivity\",\n            \"status\": \"ko\"\n        },\n        {\n            \"name\": \"so connectivity\",\n            \"status\": \"ok\"\n        },\n        {\n            \"name\": \"aai connectivity\",\n            \"status\": \"ok\"\n        },\n        {\n            \"name\": \"dmaap connectivity\",\n            \"status\": \"ok\"\n        }\n    ]\n}\n```",
     "deprecated": false,
index 7f74c26..6d21240 100644 (file)
@@ -17,11 +17,20 @@ info:
     \ fine as a standalone application or can also communicate with other onap modules.\n\
     \n"
   version: "4.0.1"
-  title: "API Status"
+  title: "Status API"
+  contact:
+    name: "ONAP"
+    url: "https://onap.readthedocs.io"
+    email: "onap-discuss@lists.onap.org"
+  license:
+    name: "Apache 2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0"
+  x-planned-retirement-date: "205001"
+  x-component: "NBI"
   x-logo:
     url: "/redoc/logo.png"
     backgroundColor: "#FFFFFF"
-host: "localhost:8080"
+host: "serverRoot:30274"
 basePath: "/nbi/api/v4"
 schemes:
 - "http"
@@ -37,7 +46,7 @@ paths:
       - "Status"
       produces:
       - "application/json;charset=utf-8"
-      operationId: "statusFind"
+      operationId: "status_Find"
       summary: "retrieve application status"
       description: "* Default\n\n```\n{\n    \"name\": \"nbi\",\n    \"status\": \"\
         ok\",\n    \"version\": \"v3\"\n}\n```\n\n* Optional\n\n```\n?fullStatus=true\n\
index 14b2541..2153b84 100644 (file)
@@ -24,6 +24,7 @@ import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
 import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
 import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
 import org.onap.sdc.toscaparser.api.parameters.Input;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -145,6 +146,10 @@ public class ToscaInfosProcessor {
         String svcCharacteristicsJson = Json.pretty(definitions);
         serviceSpecificationDBManager.saveSpecificationInputSchema(svcCharacteristicsJson, serviceCatalogResponse);
 
+        Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata();
+        String instantationType = serviceMetadata.getValue("instantiationType");
+        serviceCatalogResponse.put("instantiationType", instantationType);
+
         LinkedHashMap inputSchemaRef = new LinkedHashMap();
         // use object to match examples in Specifications
         inputSchemaRef.put("valueType", "object");
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/utils/MacroServiceUtils.java b/src/main/java/org/onap/nbi/apis/serviceorder/utils/MacroServiceUtils.java
new file mode 100644 (file)
index 0000000..427ba3b
--- /dev/null
@@ -0,0 +1,33 @@
+/**\r
+ * Copyright (c) 2020 TechMahindra\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
+\r
+package org.onap.nbi.apis.serviceorder.utils;\r
+\r
+import java.util.Map;\r
+\r
+import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderItemInfo;\r
+\r
+public class MacroServiceUtils {\r
+  public static boolean isMacroService(ServiceOrderItemInfo serviceOrderItemInfo) {\r
+    Map<String, Object> sdcInfos = serviceOrderItemInfo.getCatalogResponse();\r
+    boolean macroService = false;\r
+    if (sdcInfos.get("instantiationType") != null) {\r
+      String instantiationType = ((String) sdcInfos.get("instantiationType")).toLowerCase();\r
+      if (instantiationType.equals("macro")) {\r
+        macroService = true;\r
+      }\r
+    }\r
+    return macroService;\r
+}\r
+\r
+}\r
index 843f599..d63d122 100644 (file)
@@ -31,6 +31,7 @@ import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository;
 import org.onap.nbi.apis.serviceorder.service.ServiceOrderService;
 import org.onap.nbi.apis.serviceorder.utils.E2EServiceUtils;
 import org.onap.nbi.apis.serviceorder.utils.JsonEntityConverter;
+import org.onap.nbi.apis.serviceorder.utils.MacroServiceUtils;
 import org.onap.nbi.exceptions.TechnicalException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -81,12 +82,18 @@ public class SOTaskProcessor {
         ServiceOrderItem serviceOrderItem = getServiceOrderItem(executionTask, serviceOrder);
         boolean e2eService =
                 E2EServiceUtils.isE2EService(serviceOrderInfo.getServiceOrderItemInfos().get(serviceOrderItem.getId()));
+        boolean macroService = MacroServiceUtils
+                .isMacroService(serviceOrderInfo.getServiceOrderItemInfos().get(serviceOrderItem.getId()));
 
         if (shouldPostSo(serviceOrderItem)) {
             if (e2eService) {
                 ResponseEntity<CreateE2EServiceInstanceResponse> response =
                         postSoProcessor.postE2EServiceOrderItem(serviceOrderInfo, serviceOrderItem, serviceOrder);
                 updateE2EServiceOrderItem(response, serviceOrderItem, serviceOrder);
+            } else if (macroService) {
+              LOGGER.info("Mode type macro");
+              //TODO: Add logic to construct SO macro request body and call SO macro flow.(EXTAPI-368)
+
             } else {
 
                 ResponseEntity<CreateServiceInstanceResponse> response =