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;
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");
--- /dev/null
+/**\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
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;
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 =