From afac3121bfacc4d81903b1d8492613b0b77d3298 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 19 Mar 2020 10:29:30 -0700 Subject: Fix the CDS calls Fix the CDS calls for generic tosca policies, the new tosca parser must be interrupted so that clamp can do json schema enrichment Issue-ID: CLAMP-786 Signed-off-by: sebdet Change-Id: Ib7e85a6cc3849f614a3025779d29e8024f7a2ef2 --- .../ToscaConverterWithDictionarySupport.java | 13 +- .../update/execution/ToscaMetadataExecutor.java | 110 +++++++ .../update/execution/ToscaMetadataProcess.java | 43 +++ .../execution/cds/ToscaMetadataCdsProcess.java | 113 +++++++ .../target/ToscaMetadataTargetProcess.java | 40 +++ .../update/parser/ToscaConverterToJsonSchema.java | 14 +- .../parser/metadata/ToscaMetadataParser.java | 3 +- .../ToscaMetadataParserWithDictionarySupport.java | 53 ++-- .../update/templates/JsonTemplateManager.java | 21 +- .../java/org/onap/clamp/loop/LoopController.java | 2 +- .../clamp/loop/template/PolicyModelsService.java | 4 +- src/main/java/org/onap/clamp/policy/Policy.java | 5 +- .../policy/microservice/MicroServicePolicy.java | 13 +- .../microservice/MicroServicePolicyService.java | 8 +- .../policy/operational/OperationalPolicy.java | 16 +- .../OperationalPolicyRepresentationBuilder.java | 36 ++- .../operational/OperationalPolicyService.java | 2 +- .../org/onap/clamp/tosca/DictionaryService.java | 6 +- src/main/resources/META-INF/resources/swagger.html | 351 +++++++++++++-------- 19 files changed, 633 insertions(+), 220 deletions(-) create mode 100644 src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java create mode 100644 src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java create mode 100644 src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java create mode 100644 src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java (limited to 'src/main') diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java index c1bf1ad80..5832986a1 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java @@ -32,6 +32,7 @@ import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; import org.onap.clamp.clds.util.JsonUtils; +import org.onap.clamp.loop.service.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -63,15 +64,18 @@ public class ToscaConverterWithDictionarySupport { * * @param toscaFile The tosca file as String * @param policyTypeToDecode The policy type to decode + * @param serviceModel The service model associated so that the clamp enrichment could be done if required by + * the tosca model * @return A json object being a json schema */ - public JsonObject convertToscaToJsonSchemaObject(String toscaFile, String policyTypeToDecode) { + public JsonObject convertToscaToJsonSchemaObject(String toscaFile, String policyTypeToDecode, + Service serviceModel) { try { return new JsonTemplateManager(toscaFile, clampProperties.getFileContent("tosca.converter.default.datatypes"), clampProperties.getFileContent("tosca.converter.json.schema.templates")) .getJsonSchemaForPolicyType(policyTypeToDecode, Boolean.parseBoolean(clampProperties.getStringValue( - "tosca.converter.dictionary.support.enabled")) ? metadataParser : null); + "tosca.converter.dictionary.support.enabled")) ? metadataParser : null, serviceModel); } catch (IOException | UnknownComponentException e) { logger.error("Unable to convert the tosca properly, exception caught during the decoding", e); @@ -85,9 +89,10 @@ public class ToscaConverterWithDictionarySupport { * * @param toscaFile The tosca file as String * @param policyTypeToDecode The policy type to decode + * @param serviceModel The service Model so that clamp enrichment could be done if required by tosca model * @return A String containing the json schema */ - public String convertToscaToJsonSchemaString(String toscaFile, String policyTypeToDecode) { - return JsonUtils.GSON.toJson(this.convertToscaToJsonSchemaObject(toscaFile, policyTypeToDecode)); + public String convertToscaToJsonSchemaString(String toscaFile, String policyTypeToDecode, Service serviceModel) { + return JsonUtils.GSON.toJson(this.convertToscaToJsonSchemaObject(toscaFile, policyTypeToDecode, serviceModel)); } } diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java new file mode 100644 index 000000000..dbd8ee1bc --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.clamp.clds.tosca.update.execution; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.gson.JsonObject; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.PostConstruct; +import org.onap.clamp.clds.tosca.update.execution.cds.ToscaMetadataCdsProcess; +import org.onap.clamp.clds.tosca.update.execution.target.ToscaMetadataTargetProcess; +import org.onap.clamp.loop.service.Service; +import org.onap.clamp.tosca.Dictionary; +import org.onap.clamp.tosca.DictionaryElement; +import org.onap.clamp.tosca.DictionaryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * This class is used to execute a code based on a key found in the metadata section. + */ +@Component +public class ToscaMetadataExecutor { + + private static final EELFLogger logger = + EELFManager.getInstance().getLogger(ToscaMetadataExecutor.class); + + @Autowired + private DictionaryService dictionaryService; + + private Map mapOfProcesses = new HashMap<>(); + + /** + * This method executes the required process specified in processInfo + * + * @param processInfo A String containing the process to execute, like "cds/param1:value1/param2:value2" + * @param childObject The jsonObject + * @param serviceModel The service model associated to do clamp enrichment + */ + public void executeTheProcess(String processInfo, JsonObject childObject, Service serviceModel) { + String[] processParameters = (processInfo + "/ ").split("/"); + logger.info("Executing the Tosca clamp process " + processParameters[0] + " with parameters " + + processParameters[1].trim()); + mapOfProcesses.get(processParameters[0]).executeProcess(processParameters[1].trim(), childObject, serviceModel); + } + + /** + * Init method. + */ + @PostConstruct + public void init() { + mapOfProcesses.put("CDS", new ToscaMetadataCdsProcess()); + mapOfProcesses.put("CSAR_RESOURCES", new ToscaMetadataTargetProcess()); + + preProvisionDictionaryTable(); + } + + private void preProvisionDictionaryTable() { + // Set up dictionary elements + Dictionary actorDictionary = new Dictionary(); + actorDictionary.setName("DefaultActor"); + actorDictionary.setSecondLevelDictionary(0); + actorDictionary.setSubDictionaryType(""); + + DictionaryElement elementSo = new DictionaryElement(); + elementSo.setName("SO"); + elementSo.setShortName("SO"); + elementSo.setType("string"); + elementSo.setDescription("SO component"); + actorDictionary.addDictionaryElements(elementSo); + + DictionaryElement elementSdnc = new DictionaryElement(); + elementSdnc.setName("SDNC"); + elementSdnc.setShortName("SDNC"); + elementSdnc.setType("string"); + elementSdnc.setDescription("SDNC component"); + actorDictionary.addDictionaryElements(elementSdnc); + + DictionaryElement elementCds = new DictionaryElement(); + elementCds.setName("CDS"); + elementCds.setShortName("CDS"); + elementCds.setType("string"); + elementCds.setDescription("CDS component"); + actorDictionary.addDictionaryElements(elementCds); + + dictionaryService.saveOrUpdateDictionary(actorDictionary); + } +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java new file mode 100644 index 000000000..214eadb03 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/ToscaMetadataProcess.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.clamp.clds.tosca.update.execution; + +import com.google.gson.JsonObject; +import org.onap.clamp.loop.service.Service; + +/** + * This code is the interface that must be implemented to have a tosca process. + */ +public abstract class ToscaMetadataProcess { + + /** + * This method add some elements to the JsonObject childObject passed in argument. + * The process can take multiple parameters in arguments. + * + * @param parameters The parameters required by the process + * @param childObject The Json Object modified by the current process + * @param serviceModel The service model associated to do clamp enrichment + */ + public abstract void executeProcess(String parameters, JsonObject childObject, Service serviceModel); +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java new file mode 100644 index 000000000..cf9e010b3 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java @@ -0,0 +1,113 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.clamp.clds.tosca.update.execution.cds; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.util.Map; +import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess; +import org.onap.clamp.loop.service.Service; +import org.onap.clamp.tosca.DictionaryService; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. + */ +public class ToscaMetadataCdsProcess extends ToscaMetadataProcess { + + @Autowired + private DictionaryService dictionaryService; + + @Override + public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) { + switch (parameters) { + case "payload": + childObject.add("anyOf", generatePayload(serviceModel)); + break; + case "operation": + childObject.add("enum", generateOperation(serviceModel)); + break; + } + } + + private static JsonArray generatePayload(Service serviceModel) { + JsonArray schemaAnyOf = new JsonArray(); + schemaAnyOf.addAll(generatePayloadPerResource("VF", serviceModel)); + schemaAnyOf.addAll(generatePayloadPerResource("PNF", serviceModel)); + return schemaAnyOf; + } + + private static JsonArray generateOperation(Service serviceModel) { + JsonArray schemaEnum = new JsonArray(); + schemaEnum.addAll(generateOperationPerResource("VF", serviceModel)); + schemaEnum.addAll(generateOperationPerResource("PNF", serviceModel)); + return schemaEnum; + } + + private static JsonArray generateOperationPerResource(String resourceName, Service serviceModel) { + JsonArray schemaEnum = new JsonArray(); + for (Map.Entry entry : serviceModel.getResourceDetails().getAsJsonObject(resourceName) + .entrySet()) { + JsonObject controllerProperties = entry.getValue().getAsJsonObject() + .getAsJsonObject("controllerProperties"); + if (controllerProperties != null) { + for (String workflowsEntry : controllerProperties.getAsJsonObject("workflows").keySet()) { + schemaEnum.add(workflowsEntry); + } + } + } + return schemaEnum; + } + + private static JsonArray generatePayloadPerResource(String resourceName, Service serviceModel) { + JsonArray schemaAnyOf = new JsonArray(); + for (Map.Entry entry : serviceModel.getResourceDetails().getAsJsonObject(resourceName) + .entrySet()) { + JsonObject controllerProperties = entry.getValue().getAsJsonObject() + .getAsJsonObject("controllerProperties"); + if (controllerProperties != null) { + for (Map.Entry workflowsEntry : controllerProperties.getAsJsonObject("workflows") + .entrySet()) { + JsonObject obj = new JsonObject(); + obj.addProperty("title", workflowsEntry.getKey()); + obj.add("properties", createPayloadProperty(workflowsEntry.getValue().getAsJsonObject(), + controllerProperties)); + schemaAnyOf.add(obj); + } + } + } + return schemaAnyOf; + } + + private static JsonObject createPayloadProperty(JsonObject workFlow, JsonObject controllerProperties) { + JsonObject payloadResult = new JsonObject(); + + payloadResult.addProperty("artifact_name", controllerProperties.get("sdnc_model_name").getAsString()); + payloadResult.addProperty("artifact_version", controllerProperties.get("sdnc_model_version").getAsString()); + payloadResult.addProperty("mode", "async"); + payloadResult.add("data", workFlow.getAsJsonObject("inputs")); + return payloadResult; + } +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java b/src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java new file mode 100644 index 000000000..8b8fa1784 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.clamp.clds.tosca.update.execution.target; + +import com.google.gson.JsonObject; +import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataProcess; +import org.onap.clamp.loop.service.Service; +import org.onap.clamp.policy.operational.OperationalPolicyRepresentationBuilder; + +/** + * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. + */ +public class ToscaMetadataTargetProcess extends ToscaMetadataProcess { + + @Override + public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) { + childObject.add("anyOf", OperationalPolicyRepresentationBuilder.createAnyOfArray(serviceModel, false)); + } +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java index cfc0e42a8..e1d493a35 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java @@ -33,6 +33,7 @@ import org.onap.clamp.clds.tosca.update.elements.ToscaElement; import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; +import org.onap.clamp.loop.service.Service; public class ToscaConverterToJsonSchema { private LinkedHashMap components; @@ -40,19 +41,23 @@ public class ToscaConverterToJsonSchema { private ToscaMetadataParser metadataParser; + private Service serviceModel; + /** * Constructor. * * @param toscaElementsMap All the tosca elements found (policy type + data types + native tosca datatypes) * @param jsonSchemaTemplates All Json schema templates to use * @param metadataParser The metadata parser to use for metadata section + * @param serviceModel The service model for clamp enrichment */ public ToscaConverterToJsonSchema(LinkedHashMap toscaElementsMap, LinkedHashMap jsonSchemaTemplates, - ToscaMetadataParser metadataParser) { + ToscaMetadataParser metadataParser, Service serviceModel) { this.components = toscaElementsMap; this.templates = jsonSchemaTemplates; this.metadataParser = metadataParser; + this.serviceModel = serviceModel; } /** @@ -220,7 +225,7 @@ public class ToscaConverterToJsonSchema { break; case "metadata": if (metadataParser != null) { - metadataParser.processAllMetadataElement(toscaElementProperty).entrySet() + metadataParser.processAllMetadataElement(toscaElementProperty, serviceModel).entrySet() .forEach((jsonEntry) -> { propertiesInJson.add(jsonEntry.getKey(), jsonEntry.getValue()); @@ -238,9 +243,8 @@ public class ToscaConverterToJsonSchema { if (getToscaElement(this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema")) != null) { String nameComponent = this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema"); - ToscaConverterToJsonSchema - child = new ToscaConverterToJsonSchema(components, templates, - metadataParser); + ToscaConverterToJsonSchema child = new ToscaConverterToJsonSchema(components, templates, + metadataParser, serviceModel); JsonObject propertiesContainer = new JsonObject(); switch ((String) toscaElementProperty.getItems().get("type")) { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java index a51818e2e..f4a48139e 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java @@ -25,7 +25,8 @@ package org.onap.clamp.clds.tosca.update.parser.metadata; import com.google.gson.JsonObject; import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.clamp.loop.service.Service; public interface ToscaMetadataParser { - JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty); + JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty, Service serviceModel); } diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java index 349ccee9e..8aff9668f 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java @@ -29,10 +29,11 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Optional; -import org.json.JSONArray; import org.onap.clamp.clds.tosca.JsonEditorSchemaConstants; import org.onap.clamp.clds.tosca.ToscaSchemaConstants; import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; +import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; +import org.onap.clamp.loop.service.Service; import org.onap.clamp.tosca.DictionaryElement; import org.onap.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; @@ -41,6 +42,9 @@ import org.springframework.stereotype.Component; @Component public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataParser { + @Autowired + private ToscaMetadataExecutor toscaMetadataExecutor; + @Autowired private DictionaryService dictionaryService; @@ -50,9 +54,10 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa * @param toscaElementProperty The property metadata as Json Object * @return The jsonObject structure that must be added to the json schema */ - public JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty) { + public JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty, Service serviceModel) { if (dictionaryService != null) { - return parseMetadataPossibleValues(toscaElementProperty.getItems(), dictionaryService); + return parseMetadataPossibleValues(toscaElementProperty.getItems(), dictionaryService, serviceModel, + toscaMetadataExecutor); } else { return null; @@ -60,38 +65,32 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa } private static JsonObject parseMetadataPossibleValues(LinkedHashMap childNodeMap, - DictionaryService dictionaryService) { + DictionaryService dictionaryService, Service serviceModel, + ToscaMetadataExecutor toscaMetadataExecutor) { JsonObject childObject = new JsonObject(); if (childNodeMap.containsKey(ToscaSchemaConstants.METADATA) && childNodeMap.get(ToscaSchemaConstants.METADATA) != null) { - LinkedHashMap metadataMap = - (LinkedHashMap) childNodeMap.get(ToscaSchemaConstants.METADATA); - if (metadataMap != null) { - metadataMap.entrySet().stream().forEach(constraint -> { - if (constraint.getKey() - .equalsIgnoreCase(ToscaSchemaConstants.METADATA_CLAMP_POSSIBLE_VALUES)) { - JSONArray validValuesArray = new JSONArray(); - if (constraint.getValue() instanceof ArrayList) { - boolean processDictionary = ((ArrayList) constraint.getValue()) - .stream().anyMatch(value -> (value instanceof String - && ((String) value).contains(ToscaSchemaConstants.DICTIONARY))); - if (processDictionary) { - ((ArrayList) constraint.getValue()).stream().forEach(value -> { - if ((value instanceof String && ((String) value) - .contains(ToscaSchemaConstants.DICTIONARY))) { - processDictionaryElements((String) value, childObject, dictionaryService); - } - - }); - } - } + ((LinkedHashMap) childNodeMap.get(ToscaSchemaConstants.METADATA)).forEach((key, + value) -> { + if (key.equalsIgnoreCase(ToscaSchemaConstants.METADATA_CLAMP_POSSIBLE_VALUES)) { + if (((String) value).contains(ToscaSchemaConstants.DICTIONARY)) { + processDictionaryElements((String) value, childObject, dictionaryService); } - }); - } + if (((String) value).contains("ClampExecution:")) { + executeClampProcess(((String) value).replaceAll("ClampExecution:", ""), childObject, + serviceModel, toscaMetadataExecutor); + } + } + }); } return childObject; } + private static void executeClampProcess(String processInfo, JsonObject childObject, Service serviceModel, + ToscaMetadataExecutor toscaMetadataExecutor) { + toscaMetadataExecutor.executeTheProcess(processInfo, childObject, serviceModel); + } + private static void processDictionaryElements(String dictionaryReference, JsonObject childObject, DictionaryService dictionaryService) { String[] dictionaryKeyArray = diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java index 5e4b66009..0b399ba0b 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java @@ -35,6 +35,7 @@ import org.onap.clamp.clds.tosca.update.parser.ToscaConverterToJsonSchema; import org.onap.clamp.clds.tosca.update.parser.ToscaElementParser; import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParser; import org.onap.clamp.clds.util.JsonUtils; +import org.onap.clamp.loop.service.Service; public class JsonTemplateManager { private LinkedHashMap jsonSchemaTemplates; @@ -45,7 +46,7 @@ public class JsonTemplateManager { * * @param toscaYamlContent Policy Tosca Yaml content as string * @param nativeToscaDatatypes The tosca yaml with tosca native datatypes - * @param jsonSchemaTemplates template properties as string + * @param jsonSchemaTemplates template properties as string */ public JsonTemplateManager(String toscaYamlContent, String nativeToscaDatatypes, String jsonSchemaTemplates) { if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) { @@ -107,11 +108,13 @@ public class JsonTemplateManager { */ public void updateTemplate(String nameTemplate, JsonTemplateField jsonTemplateField, Boolean operation) { // Operation = true && field is not present => add Field - if (operation && !this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { + if (operation + && !this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { this.jsonSchemaTemplates.get(nameTemplate).addField(jsonTemplateField); } // Operation = false && field is present => remove Field - else if (!operation && this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { + else if (!operation + && this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { this.jsonSchemaTemplates.get(nameTemplate).removeField(jsonTemplateField); } } @@ -135,16 +138,17 @@ public class JsonTemplateManager { /** * For a given policy type, get a corresponding JsonObject from the tosca model. * - * @param policyType The policy type in the tosca + * @param policyType The policy type in the tosca * @param toscaMetadataParser The MetadataParser class that must be used if metadata section are encountered, if null - * they will be skipped + * they will be skipped * @return an json object defining the equivalent json schema from the tosca for a given policy type */ - public JsonObject getJsonSchemaForPolicyType(String policyType, ToscaMetadataParser toscaMetadataParser) + public JsonObject getJsonSchemaForPolicyType(String policyType, ToscaMetadataParser toscaMetadataParser, + Service serviceModel) throws UnknownComponentException { ToscaConverterToJsonSchema toscaConverterToJsonSchema = new ToscaConverterToJsonSchema(toscaElements, jsonSchemaTemplates, - toscaMetadataParser); + toscaMetadataParser, serviceModel); if (toscaConverterToJsonSchema.getToscaElement(policyType) == null) { throw new UnknownComponentException(policyType); } @@ -180,5 +184,4 @@ public class JsonTemplateManager { } return generatedTemplates; } - -} +} \ No newline at end of file diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java index 9c2c71f5f..a2a44631b 100644 --- a/src/main/java/org/onap/clamp/loop/LoopController.java +++ b/src/main/java/org/onap/clamp/loop/LoopController.java @@ -207,7 +207,7 @@ public class LoopController { for (MicroServicePolicy microServicePolicy : loop.getMicroServicePolicies()) { if (microServicePolicy.getName().equals(microServicePolicyName)) { this.microServicePolicyService - .refreshMicroServicePolicyJsonRepresentation(microServicePolicy, toscaConverter); + .refreshMicroServicePolicyJsonRepresentation(microServicePolicy, toscaConverter, loop); } } return loop; diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java b/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java index ae66c54b8..98b928916 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java +++ b/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java @@ -148,7 +148,7 @@ public class PolicyModelsService { public void createPolicyInDbIfNeeded(PolicyModel policyModel) { if (!policyModelsRepository.existsById( new PolicyModelId(policyModel.getPolicyModelType(), policyModel.getVersion()))) { - policyModelsRepository.save(policyModel); + policyModelsRepository.saveAndFlush(policyModel); } } @@ -173,7 +173,7 @@ public class PolicyModelsService { JsonObject supportedPdpJson = new JsonObject(); supportedPdpJson.add("supportedPdpGroups", supportedPdpGroups); policyModel.setPolicyPdpGroup(supportedPdpJson); - policyModelsRepository.save(policyModel); + policyModelsRepository.saveAndFlush(policyModel); } } } diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java index abb16d73f..d84f2c8a0 100644 --- a/src/main/java/org/onap/clamp/policy/Policy.java +++ b/src/main/java/org/onap/clamp/policy/Policy.java @@ -46,6 +46,7 @@ import org.json.JSONObject; import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.common.AuditEntity; +import org.onap.clamp.loop.service.Service; import org.onap.clamp.loop.template.LoopElementModel; import org.onap.clamp.loop.template.PolicyModel; import org.yaml.snakeyaml.Yaml; @@ -171,8 +172,10 @@ public abstract class Policy extends AuditEntity { * Regenerate the Policy Json Representation. * * @param toscaConverter The tosca converter required to regenerate the json schema + * @param serviceModel The service model associated */ - public abstract void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter); + public abstract void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter, + Service serviceModel); /** * policyModel getter. diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java index b3bd7e88a..e997b4309 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java @@ -129,10 +129,8 @@ public class MicroServicePolicy extends Policy implements Serializable { ToscaConverterWithDictionarySupport toscaConverter) { this(Policy.generatePolicyName("MICROSERVICE", service.getName(), service.getVersion(), RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), - loopElementModel.getPolicyModels().first(), false, - new JsonObject(), - loopElementModel, null, null); - this.updateJsonRepresentation(toscaConverter); + loopElementModel.getPolicyModels().first(), false, new JsonObject(), loopElementModel, null, null); + this.updateJsonRepresentation(toscaConverter, service); } @Override @@ -151,9 +149,10 @@ public class MicroServicePolicy extends Policy implements Serializable { } @Override - public void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter) { - this.setJsonRepresentation(toscaConverter.convertToscaToJsonSchemaObject(this.getPolicyModel().getPolicyModelTosca(), - this.getPolicyModel().getPolicyModelType())); + public void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter, Service serviceModel) { + this.setJsonRepresentation( + toscaConverter.convertToscaToJsonSchemaObject(this.getPolicyModel().getPolicyModelTosca(), + this.getPolicyModel().getPolicyModelType(), serviceModel)); } public Boolean getShared() { diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java index 0631380f5..37533c1f6 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java @@ -99,11 +99,13 @@ public class MicroServicePolicyService implements PolicyServiceh2{page-b
  • 2. Paths
  • 3. Definitions @@ -736,7 +743,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

    1.2. URI scheme

    -

    Host : localhost:46291
    +

    Host : localhost:42393
    BasePath : /restservices/clds/
    Schemes : HTTP

    @@ -747,7 +754,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

    2. Paths

    -

    2.1. GET /v1/healthcheck

    +

    2.1. GET /v1/healthcheck

    2.1.1. Responses

    @@ -784,7 +791,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -818,7 +825,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -855,7 +862,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -892,7 +899,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1141,7 +1148,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1265,7 +1272,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1339,7 +1346,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1411,7 +1418,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1460,7 +1467,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1522,7 +1529,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1559,7 +1566,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1621,7 +1628,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1644,6 +1651,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b required

    + + + + +

    string

    Path

    microServicePolicyName
    +required

    string

    @@ -1683,7 +1696,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}

    +

    2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}

    2.18.1. Parameters

    @@ -1708,13 +1721,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b - - - - - - @@ -1757,7 +1764,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

    Path

    policyType
    -required

    string

    Path

    policyVersion
    +

    operationalPolicyName
    required

    string

    @@ -1780,6 +1787,18 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b required

    + + + + + + + + + +

    string

    Path

    policyType
    +required

    string

    Path

    policyVersion
    +required

    string

    @@ -1819,7 +1838,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.20. PUT /v2/loop/stop/{loopName}

    +

    2.20. PUT /v2/loop/restart/{loopName}

    2.20.1. Parameters

    @@ -1881,7 +1900,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1943,7 +1962,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    @@ -1988,7 +2007,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b - +

    200

    Output type

    string

    Loop

    @@ -1998,14 +2017,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    • -

      application/xml

      +

      application/json

    -

    2.23. PUT /v2/loop/undeploy/{loopName}

    +

    2.23. GET /v2/loop/svgRepresentation/{loopName}

    2.23.1. Parameters

    @@ -2050,7 +2069,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b - +

    200

    Output type

    Loop

    string

    @@ -2060,14 +2079,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    • -

      application/json

      +

      application/xml

    -

    2.24. POST /v2/loop/updateGlobalProperties/{loopName}

    +

    2.24. PUT /v2/loop/undeploy/{loopName}

    2.24.1. Parameters

    @@ -2090,6 +2109,68 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b required

    + +

    string

    +
    +
    +

    2.24.2. Responses

    + +++++ + + + + + + + + + + + + + + +
    HTTP CodeDescriptionSchema

    200

    Output type

    Loop

    +
    +
    +

    2.24.3. Produces

    +
    +
      +
    • +

      application/json

      +
    • +
    +
    +
    +
    +
    +

    2.25. POST /v2/loop/updateGlobalProperties/{loopName}

    +
    +

    2.25.1. Parameters

    + +++++ + + + + + + + + + + + + +
    TypeNameSchema

    Path

    loopName
    +required

    string

    Body

    body
    @@ -2100,7 +2181,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

    -

    2.24.2. Responses

    +

    2.25.2. Responses

    @@ -2124,7 +2205,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.24.3. Consumes

    +

    2.25.3. Consumes

    • @@ -2134,7 +2215,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.24.4. Produces

    +

    2.25.4. Produces

    • @@ -2145,9 +2226,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}

    +

    2.26. POST /v2/loop/updateMicroservicePolicy/{loopName}

    -

    2.25.1. Parameters

    +

    2.26.1. Parameters

    @@ -2178,7 +2259,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.25.2. Responses

    +

    2.26.2. Responses

    @@ -2202,7 +2283,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.25.3. Consumes

    +

    2.26.3. Consumes

    • @@ -2212,7 +2293,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.25.4. Produces

    +

    2.26.4. Produces

    • @@ -2223,9 +2304,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.26. POST /v2/loop/updateOperationalPolicies/{loopName}

    +

    2.27. POST /v2/loop/updateOperationalPolicies/{loopName}

    -

    2.26.1. Parameters

    +

    2.27.1. Parameters

    @@ -2256,7 +2337,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.26.2. Responses

    +

    2.27.2. Responses

    @@ -2280,7 +2361,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.26.3. Consumes

    +

    2.27.3. Consumes

    • @@ -2290,7 +2371,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.26.4. Produces

    +

    2.27.4. Produces

    • @@ -2301,9 +2382,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.27. GET /v2/loop/{loopName}

    +

    2.28. GET /v2/loop/{loopName}

    -

    2.27.1. Parameters

    +

    2.28.1. Parameters

    @@ -2328,7 +2409,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.27.2. Responses

    +

    2.28.2. Responses

    @@ -2352,7 +2433,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.27.3. Produces

    +

    2.28.3. Produces

    • @@ -2363,9 +2444,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.28. POST /v2/policyToscaModels

    +

    2.29. POST /v2/policyToscaModels

    -

    2.28.1. Parameters

    +

    2.29.1. Parameters

    @@ -2390,7 +2471,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.28.2. Responses

    +

    2.29.2. Responses

    @@ -2414,7 +2495,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.28.3. Consumes

    +

    2.29.3. Consumes

    • @@ -2424,7 +2505,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.28.4. Produces

    +

    2.29.4. Produces

    • @@ -2435,9 +2516,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.29. GET /v2/policyToscaModels

    +

    2.30. GET /v2/policyToscaModels

    -

    2.29.1. Responses

    +

    2.30.1. Responses

    @@ -2461,7 +2542,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.29.2. Produces

    +

    2.30.2. Produces

    • @@ -2472,9 +2553,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}

    +

    2.31. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}

    -

    2.30.1. Parameters

    +

    2.31.1. Parameters

    @@ -2505,7 +2586,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.30.2. Responses

    +

    2.31.2. Responses

    @@ -2529,7 +2610,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.30.3. Produces

    +

    2.31.3. Produces

    • @@ -2540,9 +2621,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}

    +

    2.32. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}

    -

    2.31.1. Parameters

    +

    2.32.1. Parameters

    @@ -2573,7 +2654,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.31.2. Responses

    +

    2.32.2. Responses

    @@ -2597,7 +2678,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.31.3. Produces

    +

    2.32.3. Produces

    • @@ -2608,9 +2689,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}

    +

    2.33. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}

    -

    2.32.1. Parameters

    +

    2.33.1. Parameters

    @@ -2647,7 +2728,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.32.2. Responses

    +

    2.33.2. Responses

    @@ -2671,7 +2752,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.32.3. Consumes

    +

    2.33.3. Consumes

    • @@ -2681,7 +2762,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.32.4. Produces

    +

    2.33.4. Produces

    • @@ -2692,9 +2773,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.33. GET /v2/templates

    +

    2.34. GET /v2/templates

    -

    2.33.1. Responses

    +

    2.34.1. Responses

    @@ -2718,7 +2799,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.33.2. Produces

    +

    2.34.2. Produces

    • @@ -2729,9 +2810,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.34. GET /v2/templates/names

    +

    2.35. GET /v2/templates/names

    -

    2.34.1. Responses

    +

    2.35.1. Responses

    @@ -2755,7 +2836,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.34.2. Produces

    +

    2.35.2. Produces

    • @@ -2766,9 +2847,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.35. GET /v2/templates/{templateName}

    +

    2.36. GET /v2/templates/{templateName}

    -

    2.35.1. Parameters

    +

    2.36.1. Parameters

    @@ -2793,7 +2874,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.35.2. Responses

    +

    2.36.2. Responses

    @@ -2817,7 +2898,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.35.3. Produces

    +

    2.36.3. Produces

    • @@ -2828,9 +2909,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.36. GET /v2/templates/{templateName}/svgRepresentation

    +

    2.37. GET /v2/templates/{templateName}/svgRepresentation

    -

    2.36.1. Parameters

    +

    2.37.1. Parameters

    @@ -2855,7 +2936,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.36.2. Responses

    +

    2.37.2. Responses

    @@ -2879,7 +2960,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
    -

    2.36.3. Produces

    +

    2.37.3. Produces

    • -- cgit 1.2.3-korg