Identify whether the Service is of A-la-carte or macro type
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / servicecatalog / ToscaInfosProcessor.java
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");