diff options
author | sebdet <sebastien.determe@intl.att.com> | 2020-03-19 10:29:30 -0700 |
---|---|---|
committer | Sébastien Determe <sebastien.determe@intl.att.com> | 2020-03-23 22:34:41 +0000 |
commit | afac3121bfacc4d81903b1d8492613b0b77d3298 (patch) | |
tree | b5f7bee2b2cc4ff1668c87a980e89b52d300ce53 /src | |
parent | 3c327c1fe313cb31dcc914dcaee7f38255240099 (diff) |
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 <sebastien.determe@intl.att.com>
Change-Id: Ib7e85a6cc3849f614a3025779d29e8024f7a2ef2
Diffstat (limited to 'src')
26 files changed, 1342 insertions, 243 deletions
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<String, ToscaMetadataProcess> 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<String, JsonElement> 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<String, JsonElement> entry : serviceModel.getResourceDetails().getAsJsonObject(resourceName) + .entrySet()) { + JsonObject controllerProperties = entry.getValue().getAsJsonObject() + .getAsJsonObject("controllerProperties"); + if (controllerProperties != null) { + for (Map.Entry<String, JsonElement> 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<String, ToscaElement> 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<String, ToscaElement> toscaElementsMap, LinkedHashMap<String, JsonTemplate> 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; @@ -42,6 +43,9 @@ import org.springframework.stereotype.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<String, Object> childNodeMap, - DictionaryService dictionaryService) { + DictionaryService dictionaryService, Service serviceModel, + ToscaMetadataExecutor toscaMetadataExecutor) { JsonObject childObject = new JsonObject(); if (childNodeMap.containsKey(ToscaSchemaConstants.METADATA) && childNodeMap.get(ToscaSchemaConstants.METADATA) != null) { - LinkedHashMap<String, Object> metadataMap = - (LinkedHashMap<String, Object>) 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<String, Object>) 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<String, JsonTemplate> 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 PolicyService<MicroServicePoli * Api to refresh the MicroService Policy UI window. * * @param microServicePolicy The micro Service policy object - * @param toscaConverter the tosca converter required to convert the tosca model to json schema + * @param toscaConverter The tosca converter required to convert the tosca model to json schema + * @param loop As a microservice object can belong to multiple loops, we need it here */ public void refreshMicroServicePolicyJsonRepresentation(MicroServicePolicy microServicePolicy, - ToscaConverterWithDictionarySupport toscaConverter) { - microServicePolicy.updateJsonRepresentation(toscaConverter); + ToscaConverterWithDictionarySupport toscaConverter, + Loop loop) { + microServicePolicy.updateJsonRepresentation(toscaConverter, loop.getModelService()); this.microServiceRepository.saveAndFlush(microServicePolicy); } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index 492c9b9ef..b5a88b39d 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -126,16 +126,16 @@ public class OperationalPolicy extends Policy implements Serializable { RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), new JsonObject(), new JsonObject(), loopElementModel.getPolicyModels().first(), loopElementModel, null, null); this.setLoop(loop); - this.updateJsonRepresentation(toscaConverter); + this.updateJsonRepresentation(toscaConverter, service); } /** * Create an operational policy from a policy model. * - * @param loop The parent loop - * @param service The loop service - * @param policyModel The policy model - * @param toscaConverter The tosca converter that must be used to create the Json representation + * @param loop The parent loop + * @param service The loop service + * @param policyModel The policy model + * @param toscaConverter The tosca converter that must be used to create the Json representation * @throws IOException In case of issues with the legacy files (generated from resource files */ public OperationalPolicy(Loop loop, Service service, PolicyModel policyModel, @@ -144,7 +144,7 @@ public class OperationalPolicy extends Policy implements Serializable { RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), new JsonObject(), new JsonObject(), policyModel, null, null, null); this.setLoop(loop); - this.updateJsonRepresentation(toscaConverter); + this.updateJsonRepresentation(toscaConverter, service); } public void setLoop(Loop loopName) { @@ -171,7 +171,7 @@ public class OperationalPolicy extends Policy implements Serializable { } @Override - public void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter) { + public void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter, Service serviceModel) { { this.setJsonRepresentation(new JsonObject()); if (this.getPolicyModel() == null) { @@ -187,7 +187,7 @@ public class OperationalPolicy extends Policy implements Serializable { // Generic Case this.setJsonRepresentation(toscaConverter.convertToscaToJsonSchemaObject( this.getPolicyModel().getPolicyModelTosca(), - this.getPolicyModel().getPolicyModelType())); + this.getPolicyModel().getPolicyModelType(), serviceModel)); } } } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java index 755985191..6577069ec 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java @@ -60,7 +60,7 @@ public class OperationalPolicyRepresentationBuilder { jsonSchema.get("properties").getAsJsonObject() .get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies") .getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("target") - .getAsJsonObject().get("anyOf").getAsJsonArray().addAll(createAnyOfArray(modelJson)); + .getAsJsonObject().get("anyOf").getAsJsonArray().addAll(createAnyOfArray(modelJson, true)); // update CDS recipe and payload information to schema JsonArray actors = jsonSchema.get("properties").getAsJsonObject() @@ -72,12 +72,12 @@ public class OperationalPolicyRepresentationBuilder { if ("CDS".equalsIgnoreCase(actor.getAsJsonObject().get("title").getAsString())) { actor.getAsJsonObject().get("properties").getAsJsonObject().get("type").getAsJsonObject() .get("anyOf").getAsJsonArray() - .addAll(createAnyOfArrayForCdsRecipe(modelJson.getResourceDetails())); + .addAll(createAnyOfArrayForCdsRecipe(modelJson)); } } return jsonSchema; } catch (IOException e) { - logger.error("Unable to generate the json schema because of an exception",e); + logger.error("Unable to generate the json schema because of an exception", e); return new JsonObject(); } } @@ -100,7 +100,7 @@ public class OperationalPolicyRepresentationBuilder { return property; } - private static JsonArray createVnfSchema(Service modelService) { + private static JsonArray createVnfSchema(Service modelService, boolean generateType) { JsonArray vnfSchemaArray = new JsonArray(); JsonObject modelVnfs = modelService.getResourceByType("VF"); @@ -108,7 +108,9 @@ public class OperationalPolicyRepresentationBuilder { JsonObject vnfOneOfSchema = new JsonObject(); vnfOneOfSchema.addProperty("title", "VNF" + "-" + entry.getKey()); JsonObject properties = new JsonObject(); - properties.add("type", createSchemaProperty("Type", "string", "VNF", "True", null)); + if (generateType) { + properties.add("type", createSchemaProperty("Type", "string", "VNF", "True", null)); + } properties.add("resourceID", createSchemaProperty("Resource ID", "string", modelVnfs.get(entry.getKey()).getAsJsonObject().get("name").getAsString(), "True", null)); @@ -118,7 +120,7 @@ public class OperationalPolicyRepresentationBuilder { return vnfSchemaArray; } - private static JsonArray createVfModuleSchema(Service modelService) { + private static JsonArray createVfModuleSchema(Service modelService, boolean generateType) { JsonArray vfModuleOneOfSchemaArray = new JsonArray(); JsonObject modelVfModules = modelService.getResourceByType("VFModule"); @@ -126,7 +128,9 @@ public class OperationalPolicyRepresentationBuilder { JsonObject vfModuleOneOfSchema = new JsonObject(); vfModuleOneOfSchema.addProperty("title", "VFMODULE" + "-" + entry.getKey()); JsonObject properties = new JsonObject(); - properties.add("type", createSchemaProperty("Type", "string", "VFMODULE", "True", null)); + if (generateType) { + properties.add("type", createSchemaProperty("Type", "string", "VFMODULE", "True", null)); + } properties.add("resourceID", createSchemaProperty("Resource ID", "string", modelVfModules.get(entry.getKey()).getAsJsonObject().get("vfModuleModelName").getAsString(), @@ -160,17 +164,23 @@ public class OperationalPolicyRepresentationBuilder { return vfModuleOneOfSchemaArray; } - private static JsonArray createAnyOfArray(Service modelJson) { + /** + * Create an anyOf array of possible structure we may have for Target + * + * @param modelJson The service object + * @return A JsonArray with everything inside + */ + public static JsonArray createAnyOfArray(Service modelJson, boolean generateType) { JsonArray targetOneOfStructure = new JsonArray(); - targetOneOfStructure.addAll(createVnfSchema(modelJson)); - targetOneOfStructure.addAll(createVfModuleSchema(modelJson)); + targetOneOfStructure.addAll(createVnfSchema(modelJson, generateType)); + targetOneOfStructure.addAll(createVfModuleSchema(modelJson, generateType)); return targetOneOfStructure; } - private static JsonArray createAnyOfArrayForCdsRecipe(JsonObject resourceDetails) { + public static JsonArray createAnyOfArrayForCdsRecipe(Service modelJson) { JsonArray anyOfStructure = new JsonArray(); - anyOfStructure.addAll(createAnyOfCdsRecipe(resourceDetails.getAsJsonObject("VF"))); - anyOfStructure.addAll(createAnyOfCdsRecipe(resourceDetails.getAsJsonObject("PNF"))); + anyOfStructure.addAll(createAnyOfCdsRecipe(modelJson.getResourceDetails().getAsJsonObject("VF"))); + anyOfStructure.addAll(createAnyOfCdsRecipe(modelJson.getResourceDetails().getAsJsonObject("PNF"))); return anyOfStructure; } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java index 9c0cbe99c..d5442e145 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyService.java @@ -88,7 +88,7 @@ public class OperationalPolicyService implements PolicyService<OperationalPolicy */ public void refreshOperationalPolicyJsonRepresentation(OperationalPolicy operationalPolicy, ToscaConverterWithDictionarySupport toscaConverter) { - operationalPolicy.updateJsonRepresentation(toscaConverter); + operationalPolicy.updateJsonRepresentation(toscaConverter, operationalPolicy.getLoop().getModelService()); this.operationalPolicyRepository.saveAndFlush(operationalPolicy); } } diff --git a/src/main/java/org/onap/clamp/tosca/DictionaryService.java b/src/main/java/org/onap/clamp/tosca/DictionaryService.java index 98e3516fa..6172641a7 100644 --- a/src/main/java/org/onap/clamp/tosca/DictionaryService.java +++ b/src/main/java/org/onap/clamp/tosca/DictionaryService.java @@ -49,7 +49,7 @@ public class DictionaryService { } public Dictionary saveOrUpdateDictionary(Dictionary dictionary) { - return dictionaryRepository.save(dictionary); + return dictionaryRepository.saveAndFlush(dictionary); } /** @@ -76,7 +76,7 @@ public class DictionaryService { }); dict.setDictionaryElements(updatedDictionaryElements); } - return dictionaryRepository.save(dict); + return dictionaryRepository.saveAndFlush(dict); } @@ -124,7 +124,7 @@ public class DictionaryService { if (element != null) { Dictionary dict = getDictionary(dictionaryName); dict.removeDictionaryElement(element); - dictionaryRepository.save(dict); + dictionaryRepository.saveAndFlush(dict); } } } diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index 61b9d26c0..f1bb1ca5e 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -444,31 +444,31 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </li> <li><a href="#_paths">2. Paths</a> <ul class="sectlevel2"> -<li><a href="#_route110">2.1. GET /v1/healthcheck</a> +<li><a href="#_route113">2.1. GET /v1/healthcheck</a> <ul class="sectlevel3"> <li><a href="#_responses">2.1.1. Responses</a></li> <li><a href="#_produces">2.1.2. Produces</a></li> </ul> </li> -<li><a href="#_route111">2.2. GET /v1/user/getUser</a> +<li><a href="#_route114">2.2. GET /v1/user/getUser</a> <ul class="sectlevel3"> <li><a href="#_responses_2">2.2.1. Responses</a></li> <li><a href="#_produces_2">2.2.2. Produces</a></li> </ul> </li> -<li><a href="#_route109">2.3. GET /v2/clampInformation</a> +<li><a href="#_route112">2.3. GET /v2/clampInformation</a> <ul class="sectlevel3"> <li><a href="#_responses_3">2.3.1. Responses</a></li> <li><a href="#_produces_3">2.3.2. Produces</a></li> </ul> </li> -<li><a href="#_route95">2.4. GET /v2/dictionary</a> +<li><a href="#_route98">2.4. GET /v2/dictionary</a> <ul class="sectlevel3"> <li><a href="#_responses_4">2.4.1. Responses</a></li> <li><a href="#_produces_4">2.4.2. Produces</a></li> </ul> </li> -<li><a href="#_route97">2.5. PUT /v2/dictionary</a> +<li><a href="#_route100">2.5. PUT /v2/dictionary</a> <ul class="sectlevel3"> <li><a href="#_parameters">2.5.1. Parameters</a></li> <li><a href="#_responses_5">2.5.2. Responses</a></li> @@ -497,7 +497,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_8">2.8.4. Produces</a></li> </ul> </li> -<li><a href="#_route99">2.9. DELETE /v2/dictionary/{name}</a> +<li><a href="#_route102">2.9. DELETE /v2/dictionary/{name}</a> <ul class="sectlevel3"> <li><a href="#_parameters_4">2.9.1. Parameters</a></li> <li><a href="#_responses_9">2.9.2. Responses</a></li> @@ -511,14 +511,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_10">2.10.3. Produces</a></li> </ul> </li> -<li><a href="#_route90">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> +<li><a href="#_route93">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_6">2.11.1. Parameters</a></li> <li><a href="#_responses_11">2.11.2. Responses</a></li> <li><a href="#_produces_11">2.11.3. Produces</a></li> </ul> </li> -<li><a href="#_route92">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a> +<li><a href="#_route95">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_7">2.12.1. Parameters</a></li> <li><a href="#_responses_12">2.12.2. Responses</a></li> @@ -526,174 +526,181 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <li><a href="#_produces_12">2.12.4. Produces</a></li> </ul> </li> -<li><a href="#_route88">2.13. PUT /v2/loop/delete/{loopName}</a> +<li><a href="#_route91">2.13. PUT /v2/loop/delete/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_8">2.13.1. Parameters</a></li> <li><a href="#_responses_13">2.13.2. Responses</a></li> </ul> </li> -<li><a href="#_route82">2.14. PUT /v2/loop/deploy/{loopName}</a> +<li><a href="#_route84">2.14. PUT /v2/loop/deploy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_9">2.14.1. Parameters</a></li> <li><a href="#_responses_14">2.14.2. Responses</a></li> <li><a href="#_produces_13">2.14.3. Produces</a></li> </ul> </li> -<li><a href="#_route76">2.15. GET /v2/loop/getAllNames</a> +<li><a href="#_route78">2.15. GET /v2/loop/getAllNames</a> <ul class="sectlevel3"> <li><a href="#_responses_15">2.15.1. Responses</a></li> <li><a href="#_produces_14">2.15.2. Produces</a></li> </ul> </li> -<li><a href="#_route89">2.16. GET /v2/loop/getstatus/{loopName}</a> +<li><a href="#_route92">2.16. GET /v2/loop/getstatus/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_10">2.16.1. Parameters</a></li> <li><a href="#_responses_16">2.16.2. Responses</a></li> <li><a href="#_produces_15">2.16.3. Produces</a></li> </ul> </li> -<li><a href="#_route83">2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}</a> +<li><a href="#_route85">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_11">2.17.1. Parameters</a></li> <li><a href="#_responses_17">2.17.2. Responses</a></li> <li><a href="#_produces_16">2.17.3. Produces</a></li> </ul> </li> -<li><a href="#_route91">2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> +<li><a href="#_route86">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_12">2.18.1. Parameters</a></li> <li><a href="#_responses_18">2.18.2. Responses</a></li> <li><a href="#_produces_17">2.18.3. Produces</a></li> </ul> </li> -<li><a href="#_route86">2.19. PUT /v2/loop/restart/{loopName}</a> +<li><a href="#_route94">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_13">2.19.1. Parameters</a></li> <li><a href="#_responses_19">2.19.2. Responses</a></li> <li><a href="#_produces_18">2.19.3. Produces</a></li> </ul> </li> -<li><a href="#_route85">2.20. PUT /v2/loop/stop/{loopName}</a> +<li><a href="#_route89">2.20. PUT /v2/loop/restart/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_14">2.20.1. Parameters</a></li> <li><a href="#_responses_20">2.20.2. Responses</a></li> <li><a href="#_produces_19">2.20.3. Produces</a></li> </ul> </li> -<li><a href="#_route87">2.21. PUT /v2/loop/submit/{loopName}</a> +<li><a href="#_route88">2.21. PUT /v2/loop/stop/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_15">2.21.1. Parameters</a></li> <li><a href="#_responses_21">2.21.2. Responses</a></li> <li><a href="#_produces_20">2.21.3. Produces</a></li> </ul> </li> -<li><a href="#_route78">2.22. GET /v2/loop/svgRepresentation/{loopName}</a> +<li><a href="#_route90">2.22. PUT /v2/loop/submit/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_16">2.22.1. Parameters</a></li> <li><a href="#_responses_22">2.22.2. Responses</a></li> <li><a href="#_produces_21">2.22.3. Produces</a></li> </ul> </li> -<li><a href="#_route84">2.23. PUT /v2/loop/undeploy/{loopName}</a> +<li><a href="#_route80">2.23. GET /v2/loop/svgRepresentation/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_17">2.23.1. Parameters</a></li> <li><a href="#_responses_23">2.23.2. Responses</a></li> <li><a href="#_produces_22">2.23.3. Produces</a></li> </ul> </li> -<li><a href="#_route79">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a> +<li><a href="#_route87">2.24. PUT /v2/loop/undeploy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_18">2.24.1. Parameters</a></li> <li><a href="#_responses_24">2.24.2. Responses</a></li> -<li><a href="#_consumes_4">2.24.3. Consumes</a></li> -<li><a href="#_produces_23">2.24.4. Produces</a></li> +<li><a href="#_produces_23">2.24.3. Produces</a></li> </ul> </li> -<li><a href="#_route81">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a> +<li><a href="#_route81">2.25. POST /v2/loop/updateGlobalProperties/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_19">2.25.1. Parameters</a></li> <li><a href="#_responses_25">2.25.2. Responses</a></li> -<li><a href="#_consumes_5">2.25.3. Consumes</a></li> +<li><a href="#_consumes_4">2.25.3. Consumes</a></li> <li><a href="#_produces_24">2.25.4. Produces</a></li> </ul> </li> -<li><a href="#_route80">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a> +<li><a href="#_route83">2.26. POST /v2/loop/updateMicroservicePolicy/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_20">2.26.1. Parameters</a></li> <li><a href="#_responses_26">2.26.2. Responses</a></li> -<li><a href="#_consumes_6">2.26.3. Consumes</a></li> +<li><a href="#_consumes_5">2.26.3. Consumes</a></li> <li><a href="#_produces_25">2.26.4. Produces</a></li> </ul> </li> -<li><a href="#_route77">2.27. GET /v2/loop/{loopName}</a> +<li><a href="#_route82">2.27. POST /v2/loop/updateOperationalPolicies/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_21">2.27.1. Parameters</a></li> <li><a href="#_responses_27">2.27.2. Responses</a></li> -<li><a href="#_produces_26">2.27.3. Produces</a></li> +<li><a href="#_consumes_6">2.27.3. Consumes</a></li> +<li><a href="#_produces_26">2.27.4. Produces</a></li> </ul> </li> -<li><a href="#_route103">2.28. POST /v2/policyToscaModels</a> +<li><a href="#_route79">2.28. GET /v2/loop/{loopName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_22">2.28.1. Parameters</a></li> <li><a href="#_responses_28">2.28.2. Responses</a></li> -<li><a href="#_consumes_7">2.28.3. Consumes</a></li> -<li><a href="#_produces_27">2.28.4. Produces</a></li> +<li><a href="#_produces_27">2.28.3. Produces</a></li> </ul> </li> -<li><a href="#_route102">2.29. GET /v2/policyToscaModels</a> +<li><a href="#_route106">2.29. POST /v2/policyToscaModels</a> <ul class="sectlevel3"> -<li><a href="#_responses_29">2.29.1. Responses</a></li> -<li><a href="#_produces_28">2.29.2. Produces</a></li> +<li><a href="#_parameters_23">2.29.1. Parameters</a></li> +<li><a href="#_responses_29">2.29.2. Responses</a></li> +<li><a href="#_consumes_7">2.29.3. Consumes</a></li> +<li><a href="#_produces_28">2.29.4. Produces</a></li> </ul> </li> -<li><a href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_route105">2.30. GET /v2/policyToscaModels</a> <ul class="sectlevel3"> -<li><a href="#_parameters_23">2.30.1. Parameters</a></li> -<li><a href="#_responses_30">2.30.2. Responses</a></li> -<li><a href="#_produces_29">2.30.3. Produces</a></li> +<li><a href="#_responses_30">2.30.1. Responses</a></li> +<li><a href="#_produces_29">2.30.2. Produces</a></li> </ul> </li> -<li><a href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get">2.31. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_24">2.31.1. Parameters</a></li> <li><a href="#_responses_31">2.31.2. Responses</a></li> <li><a href="#_produces_30">2.31.3. Produces</a></li> </ul> </li> -<li><a href="#_route104">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> +<li><a href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get">2.32. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> <li><a href="#_parameters_25">2.32.1. Parameters</a></li> <li><a href="#_responses_32">2.32.2. Responses</a></li> -<li><a href="#_consumes_8">2.32.3. Consumes</a></li> -<li><a href="#_produces_31">2.32.4. Produces</a></li> +<li><a href="#_produces_31">2.32.3. Produces</a></li> </ul> </li> -<li><a href="#_route108">2.33. GET /v2/templates</a> +<li><a href="#_route107">2.33. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> -<li><a href="#_responses_33">2.33.1. Responses</a></li> -<li><a href="#_produces_32">2.33.2. Produces</a></li> +<li><a href="#_parameters_26">2.33.1. Parameters</a></li> +<li><a href="#_responses_33">2.33.2. Responses</a></li> +<li><a href="#_consumes_8">2.33.3. Consumes</a></li> +<li><a href="#_produces_32">2.33.4. Produces</a></li> </ul> </li> -<li><a href="#_v2_templates_names_get">2.34. GET /v2/templates/names</a> +<li><a href="#_route111">2.34. GET /v2/templates</a> <ul class="sectlevel3"> <li><a href="#_responses_34">2.34.1. Responses</a></li> <li><a href="#_produces_33">2.34.2. Produces</a></li> </ul> </li> -<li><a href="#_v2_templates_templatename_get">2.35. GET /v2/templates/{templateName}</a> +<li><a href="#_v2_templates_names_get">2.35. GET /v2/templates/names</a> <ul class="sectlevel3"> -<li><a href="#_parameters_26">2.35.1. Parameters</a></li> -<li><a href="#_responses_35">2.35.2. Responses</a></li> -<li><a href="#_produces_34">2.35.3. Produces</a></li> +<li><a href="#_responses_35">2.35.1. Responses</a></li> +<li><a href="#_produces_34">2.35.2. Produces</a></li> </ul> </li> -<li><a href="#_v2_templates_templatename_svgrepresentation_get">2.36. GET /v2/templates/{templateName}/svgRepresentation</a> +<li><a href="#_v2_templates_templatename_get">2.36. GET /v2/templates/{templateName}</a> <ul class="sectlevel3"> <li><a href="#_parameters_27">2.36.1. Parameters</a></li> <li><a href="#_responses_36">2.36.2. Responses</a></li> <li><a href="#_produces_35">2.36.3. Produces</a></li> </ul> </li> +<li><a href="#_v2_templates_templatename_svgrepresentation_get">2.37. GET /v2/templates/{templateName}/svgRepresentation</a> +<ul class="sectlevel3"> +<li><a href="#_parameters_28">2.37.1. Parameters</a></li> +<li><a href="#_responses_37">2.37.2. Responses</a></li> +<li><a href="#_produces_36">2.37.3. Produces</a></li> +</ul> +</li> </ul> </li> <li><a href="#_definitions">3. Definitions</a> @@ -736,7 +743,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <div class="sect2"> <h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3> <div class="paragraph"> -<p><em>Host</em> : localhost:46291<br> +<p><em>Host</em> : localhost:42393<br> <em>BasePath</em> : /restservices/clds/<br> <em>Schemes</em> : HTTP</p> </div> @@ -747,7 +754,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <h2 id="_paths"><a class="anchor" href="#_paths"></a><a class="link" href="#_paths">2. Paths</a></h2> <div class="sectionbody"> <div class="sect2"> -<h3 id="_route110"><a class="anchor" href="#_route110"></a><a class="link" href="#_route110">2.1. GET /v1/healthcheck</a></h3> +<h3 id="_route113"><a class="anchor" href="#_route113"></a><a class="link" href="#_route113">2.1. GET /v1/healthcheck</a></h3> <div class="sect3"> <h4 id="_responses"><a class="anchor" href="#_responses"></a><a class="link" href="#_responses">2.1.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -784,7 +791,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route111"><a class="anchor" href="#_route111"></a><a class="link" href="#_route111">2.2. GET /v1/user/getUser</a></h3> +<h3 id="_route114"><a class="anchor" href="#_route114"></a><a class="link" href="#_route114">2.2. GET /v1/user/getUser</a></h3> <div class="sect3"> <h4 id="_responses_2"><a class="anchor" href="#_responses_2"></a><a class="link" href="#_responses_2">2.2.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -818,7 +825,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route109"><a class="anchor" href="#_route109"></a><a class="link" href="#_route109">2.3. GET /v2/clampInformation</a></h3> +<h3 id="_route112"><a class="anchor" href="#_route112"></a><a class="link" href="#_route112">2.3. GET /v2/clampInformation</a></h3> <div class="sect3"> <h4 id="_responses_3"><a class="anchor" href="#_responses_3"></a><a class="link" href="#_responses_3">2.3.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -855,7 +862,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route95"><a class="anchor" href="#_route95"></a><a class="link" href="#_route95">2.4. GET /v2/dictionary</a></h3> +<h3 id="_route98"><a class="anchor" href="#_route98"></a><a class="link" href="#_route98">2.4. GET /v2/dictionary</a></h3> <div class="sect3"> <h4 id="_responses_4"><a class="anchor" href="#_responses_4"></a><a class="link" href="#_responses_4">2.4.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -892,7 +899,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route97"><a class="anchor" href="#_route97"></a><a class="link" href="#_route97">2.5. PUT /v2/dictionary</a></h3> +<h3 id="_route100"><a class="anchor" href="#_route100"></a><a class="link" href="#_route100">2.5. PUT /v2/dictionary</a></h3> <div class="sect3"> <h4 id="_parameters"><a class="anchor" href="#_parameters"></a><a class="link" href="#_parameters">2.5.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1141,7 +1148,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route99"><a class="anchor" href="#_route99"></a><a class="link" href="#_route99">2.9. DELETE /v2/dictionary/{name}</a></h3> +<h3 id="_route102"><a class="anchor" href="#_route102"></a><a class="link" href="#_route102">2.9. DELETE /v2/dictionary/{name}</a></h3> <div class="sect3"> <h4 id="_parameters_4"><a class="anchor" href="#_parameters_4"></a><a class="link" href="#_parameters_4">2.9.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1265,7 +1272,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route90"><a class="anchor" href="#_route90"></a><a class="link" href="#_route90">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> +<h3 id="_route93"><a class="anchor" href="#_route93"></a><a class="link" href="#_route93">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_6"><a class="anchor" href="#_parameters_6"></a><a class="link" href="#_parameters_6">2.11.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1339,7 +1346,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route92"><a class="anchor" href="#_route92"></a><a class="link" href="#_route92">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a></h3> +<h3 id="_route95"><a class="anchor" href="#_route95"></a><a class="link" href="#_route95">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a></h3> <div class="sect3"> <h4 id="_parameters_7"><a class="anchor" href="#_parameters_7"></a><a class="link" href="#_parameters_7">2.12.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1411,7 +1418,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route88"><a class="anchor" href="#_route88"></a><a class="link" href="#_route88">2.13. PUT /v2/loop/delete/{loopName}</a></h3> +<h3 id="_route91"><a class="anchor" href="#_route91"></a><a class="link" href="#_route91">2.13. PUT /v2/loop/delete/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_8"><a class="anchor" href="#_parameters_8"></a><a class="link" href="#_parameters_8">2.13.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1460,7 +1467,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route82"><a class="anchor" href="#_route82"></a><a class="link" href="#_route82">2.14. PUT /v2/loop/deploy/{loopName}</a></h3> +<h3 id="_route84"><a class="anchor" href="#_route84"></a><a class="link" href="#_route84">2.14. PUT /v2/loop/deploy/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_9"><a class="anchor" href="#_parameters_9"></a><a class="link" href="#_parameters_9">2.14.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1522,7 +1529,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route76"><a class="anchor" href="#_route76"></a><a class="link" href="#_route76">2.15. GET /v2/loop/getAllNames</a></h3> +<h3 id="_route78"><a class="anchor" href="#_route78"></a><a class="link" href="#_route78">2.15. GET /v2/loop/getAllNames</a></h3> <div class="sect3"> <h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1559,7 +1566,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route89"><a class="anchor" href="#_route89"></a><a class="link" href="#_route89">2.16. GET /v2/loop/getstatus/{loopName}</a></h3> +<h3 id="_route92"><a class="anchor" href="#_route92"></a><a class="link" href="#_route92">2.16. GET /v2/loop/getstatus/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.16.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1621,7 +1628,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route83"><a class="anchor" href="#_route83"></a><a class="link" href="#_route83">2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}</a></h3> +<h3 id="_route85"><a class="anchor" href="#_route85"></a><a class="link" href="#_route85">2.17. PUT /v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}</a></h3> <div class="sect3"> <h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.17.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1644,6 +1651,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <em>required</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>microServicePolicyName</strong><br> +<em>required</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> </tbody> </table> </div> @@ -1683,7 +1696,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route91"><a class="anchor" href="#_route91"></a><a class="link" href="#_route91">2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> +<h3 id="_route86"><a class="anchor" href="#_route86"></a><a class="link" href="#_route86">2.18. PUT /v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}</a></h3> <div class="sect3"> <h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.18.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1708,13 +1721,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </tr> <tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyType</strong><br> -<em>required</em></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> -</tr> -<tr> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyVersion</strong><br> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>operationalPolicyName</strong><br> <em>required</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> @@ -1757,7 +1764,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route86"><a class="anchor" href="#_route86"></a><a class="link" href="#_route86">2.19. PUT /v2/loop/restart/{loopName}</a></h3> +<h3 id="_route94"><a class="anchor" href="#_route94"></a><a class="link" href="#_route94">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> <div class="sect3"> <h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1780,6 +1787,18 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <em>required</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyType</strong><br> +<em>required</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyVersion</strong><br> +<em>required</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> </tbody> </table> </div> @@ -1819,7 +1838,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route85"><a class="anchor" href="#_route85"></a><a class="link" href="#_route85">2.20. PUT /v2/loop/stop/{loopName}</a></h3> +<h3 id="_route89"><a class="anchor" href="#_route89"></a><a class="link" href="#_route89">2.20. PUT /v2/loop/restart/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.20.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1881,7 +1900,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route87"><a class="anchor" href="#_route87"></a><a class="link" href="#_route87">2.21. PUT /v2/loop/submit/{loopName}</a></h3> +<h3 id="_route88"><a class="anchor" href="#_route88"></a><a class="link" href="#_route88">2.21. PUT /v2/loop/stop/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.21.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1943,7 +1962,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route78"><a class="anchor" href="#_route78"></a><a class="link" href="#_route78">2.22. GET /v2/loop/svgRepresentation/{loopName}</a></h3> +<h3 id="_route90"><a class="anchor" href="#_route90"></a><a class="link" href="#_route90">2.22. PUT /v2/loop/submit/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.22.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -1988,7 +2007,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td> </tr> </tbody> </table> @@ -1998,14 +2017,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <div class="ulist"> <ul> <li> -<p><code>application/xml</code></p> +<p><code>application/json</code></p> </li> </ul> </div> </div> </div> <div class="sect2"> -<h3 id="_route84"><a class="anchor" href="#_route84"></a><a class="link" href="#_route84">2.23. PUT /v2/loop/undeploy/{loopName}</a></h3> +<h3 id="_route80"><a class="anchor" href="#_route80"></a><a class="link" href="#_route80">2.23. GET /v2/loop/svgRepresentation/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.23.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2050,7 +2069,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td> -<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> </tbody> </table> @@ -2060,14 +2079,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <div class="ulist"> <ul> <li> -<p><code>application/json</code></p> +<p><code>application/xml</code></p> </li> </ul> </div> </div> </div> <div class="sect2"> -<h3 id="_route79"><a class="anchor" href="#_route79"></a><a class="link" href="#_route79">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> +<h3 id="_route87"><a class="anchor" href="#_route87"></a><a class="link" href="#_route87">2.24. PUT /v2/loop/undeploy/{loopName}</a></h3> <div class="sect3"> <h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.24.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> @@ -2090,6 +2109,68 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <em>required</em></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> </tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.2. Responses</a></h4> +<table class="tableblock frame-all grid-all stretch"> +<colgroup> +<col style="width: 10%;"> +<col style="width: 70%;"> +<col style="width: 20%;"> +</colgroup> +<thead> +<tr> +<th class="tableblock halign-left valign-middle">HTTP Code</th> +<th class="tableblock halign-left valign-middle">Description</th> +<th class="tableblock halign-left valign-middle">Schema</th> +</tr> +</thead> +<tbody> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>200</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">Output type</p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loop">Loop</a></p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.24.3. Produces</a></h4> +<div class="ulist"> +<ul> +<li> +<p><code>application/json</code></p> +</li> +</ul> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_route81"><a class="anchor" href="#_route81"></a><a class="link" href="#_route81">2.25. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> +<div class="sect3"> +<h4 id="_parameters_19"><a class="anchor" href="#_parameters_19"></a><a class="link" href="#_parameters_19">2.25.1. Parameters</a></h4> +<table class="tableblock frame-all grid-all stretch"> +<colgroup> +<col style="width: 22.2222%;"> +<col style="width: 33.3333%;"> +<col style="width: 44.4445%;"> +</colgroup> +<thead> +<tr> +<th class="tableblock halign-left valign-middle">Type</th> +<th class="tableblock halign-left valign-middle">Name</th> +<th class="tableblock halign-left valign-middle">Schema</th> +</tr> +</thead> +<tbody> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopName</strong><br> +<em>required</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> <tr> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Body</strong></p></td> <td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>body</strong><br> @@ -2100,7 +2181,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.2. Responses</a></h4> +<h4 id="_responses_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2124,7 +2205,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_4"><a class="anchor" href="#_consumes_4"></a><a class="link" href="#_consumes_4">2.24.3. Consumes</a></h4> +<h4 id="_consumes_4"><a class="anchor" href="#_consumes_4"></a><a class="link" href="#_consumes_4">2.25.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2134,7 +2215,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.24.4. Produces</a></h4> +<h4 id="_produces_24"><a class="anchor" href="#_produces_24"></a><a class="link" href="#_produces_24">2.25.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2145,9 +2226,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route81"><a class="anchor" href="#_route81"></a><a class="link" href="#_route81">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> +<h3 id="_route83"><a class="anchor" href="#_route83"></a><a class="link" href="#_route83">2.26. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_19"><a class="anchor" href="#_parameters_19"></a><a class="link" href="#_parameters_19">2.25.1. Parameters</a></h4> +<h4 id="_parameters_20"><a class="anchor" href="#_parameters_20"></a><a class="link" href="#_parameters_20">2.26.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2178,7 +2259,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.2. Responses</a></h4> +<h4 id="_responses_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2202,7 +2283,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_5"><a class="anchor" href="#_consumes_5"></a><a class="link" href="#_consumes_5">2.25.3. Consumes</a></h4> +<h4 id="_consumes_5"><a class="anchor" href="#_consumes_5"></a><a class="link" href="#_consumes_5">2.26.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2212,7 +2293,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_24"><a class="anchor" href="#_produces_24"></a><a class="link" href="#_produces_24">2.25.4. Produces</a></h4> +<h4 id="_produces_25"><a class="anchor" href="#_produces_25"></a><a class="link" href="#_produces_25">2.26.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2223,9 +2304,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route80"><a class="anchor" href="#_route80"></a><a class="link" href="#_route80">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> +<h3 id="_route82"><a class="anchor" href="#_route82"></a><a class="link" href="#_route82">2.27. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_20"><a class="anchor" href="#_parameters_20"></a><a class="link" href="#_parameters_20">2.26.1. Parameters</a></h4> +<h4 id="_parameters_21"><a class="anchor" href="#_parameters_21"></a><a class="link" href="#_parameters_21">2.27.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2256,7 +2337,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.2. Responses</a></h4> +<h4 id="_responses_27"><a class="anchor" href="#_responses_27"></a><a class="link" href="#_responses_27">2.27.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2280,7 +2361,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_6"><a class="anchor" href="#_consumes_6"></a><a class="link" href="#_consumes_6">2.26.3. Consumes</a></h4> +<h4 id="_consumes_6"><a class="anchor" href="#_consumes_6"></a><a class="link" href="#_consumes_6">2.27.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2290,7 +2371,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_25"><a class="anchor" href="#_produces_25"></a><a class="link" href="#_produces_25">2.26.4. Produces</a></h4> +<h4 id="_produces_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.27.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2301,9 +2382,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route77"><a class="anchor" href="#_route77"></a><a class="link" href="#_route77">2.27. GET /v2/loop/{loopName}</a></h3> +<h3 id="_route79"><a class="anchor" href="#_route79"></a><a class="link" href="#_route79">2.28. GET /v2/loop/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_21"><a class="anchor" href="#_parameters_21"></a><a class="link" href="#_parameters_21">2.27.1. Parameters</a></h4> +<h4 id="_parameters_22"><a class="anchor" href="#_parameters_22"></a><a class="link" href="#_parameters_22">2.28.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2328,7 +2409,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_27"><a class="anchor" href="#_responses_27"></a><a class="link" href="#_responses_27">2.27.2. Responses</a></h4> +<h4 id="_responses_28"><a class="anchor" href="#_responses_28"></a><a class="link" href="#_responses_28">2.28.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2352,7 +2433,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.27.3. Produces</a></h4> +<h4 id="_produces_27"><a class="anchor" href="#_produces_27"></a><a class="link" href="#_produces_27">2.28.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2363,9 +2444,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route103"><a class="anchor" href="#_route103"></a><a class="link" href="#_route103">2.28. POST /v2/policyToscaModels</a></h3> +<h3 id="_route106"><a class="anchor" href="#_route106"></a><a class="link" href="#_route106">2.29. POST /v2/policyToscaModels</a></h3> <div class="sect3"> -<h4 id="_parameters_22"><a class="anchor" href="#_parameters_22"></a><a class="link" href="#_parameters_22">2.28.1. Parameters</a></h4> +<h4 id="_parameters_23"><a class="anchor" href="#_parameters_23"></a><a class="link" href="#_parameters_23">2.29.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2390,7 +2471,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_28"><a class="anchor" href="#_responses_28"></a><a class="link" href="#_responses_28">2.28.2. Responses</a></h4> +<h4 id="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2414,7 +2495,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_7"><a class="anchor" href="#_consumes_7"></a><a class="link" href="#_consumes_7">2.28.3. Consumes</a></h4> +<h4 id="_consumes_7"><a class="anchor" href="#_consumes_7"></a><a class="link" href="#_consumes_7">2.29.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2424,7 +2505,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_27"><a class="anchor" href="#_produces_27"></a><a class="link" href="#_produces_27">2.28.4. Produces</a></h4> +<h4 id="_produces_28"><a class="anchor" href="#_produces_28"></a><a class="link" href="#_produces_28">2.29.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2435,9 +2516,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route102"><a class="anchor" href="#_route102"></a><a class="link" href="#_route102">2.29. GET /v2/policyToscaModels</a></h3> +<h3 id="_route105"><a class="anchor" href="#_route105"></a><a class="link" href="#_route105">2.30. GET /v2/policyToscaModels</a></h3> <div class="sect3"> -<h4 id="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.1. Responses</a></h4> +<h4 id="_responses_30"><a class="anchor" href="#_responses_30"></a><a class="link" href="#_responses_30">2.30.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2461,7 +2542,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_28"><a class="anchor" href="#_produces_28"></a><a class="link" href="#_produces_28">2.29.2. Produces</a></h4> +<h4 id="_produces_29"><a class="anchor" href="#_produces_29"></a><a class="link" href="#_produces_29">2.30.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2472,9 +2553,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get"><a class="anchor" href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get"></a><a class="link" href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get"><a class="anchor" href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get"></a><a class="link" href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get">2.31. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> -<h4 id="_parameters_23"><a class="anchor" href="#_parameters_23"></a><a class="link" href="#_parameters_23">2.30.1. Parameters</a></h4> +<h4 id="_parameters_24"><a class="anchor" href="#_parameters_24"></a><a class="link" href="#_parameters_24">2.31.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2505,7 +2586,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_30"><a class="anchor" href="#_responses_30"></a><a class="link" href="#_responses_30">2.30.2. Responses</a></h4> +<h4 id="_responses_31"><a class="anchor" href="#_responses_31"></a><a class="link" href="#_responses_31">2.31.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2529,7 +2610,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_29"><a class="anchor" href="#_produces_29"></a><a class="link" href="#_produces_29">2.30.3. Produces</a></h4> +<h4 id="_produces_30"><a class="anchor" href="#_produces_30"></a><a class="link" href="#_produces_30">2.31.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2540,9 +2621,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_v2_policytoscamodels_policymodeltype_policymodelversion_get"><a class="anchor" href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get"></a><a class="link" href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get">2.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_v2_policytoscamodels_policymodeltype_policymodelversion_get"><a class="anchor" href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get"></a><a class="link" href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get">2.32. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> -<h4 id="_parameters_24"><a class="anchor" href="#_parameters_24"></a><a class="link" href="#_parameters_24">2.31.1. Parameters</a></h4> +<h4 id="_parameters_25"><a class="anchor" href="#_parameters_25"></a><a class="link" href="#_parameters_25">2.32.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2573,7 +2654,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_31"><a class="anchor" href="#_responses_31"></a><a class="link" href="#_responses_31">2.31.2. Responses</a></h4> +<h4 id="_responses_32"><a class="anchor" href="#_responses_32"></a><a class="link" href="#_responses_32">2.32.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2597,7 +2678,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_30"><a class="anchor" href="#_produces_30"></a><a class="link" href="#_produces_30">2.31.3. Produces</a></h4> +<h4 id="_produces_31"><a class="anchor" href="#_produces_31"></a><a class="link" href="#_produces_31">2.32.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2608,9 +2689,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route104"><a class="anchor" href="#_route104"></a><a class="link" href="#_route104">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> +<h3 id="_route107"><a class="anchor" href="#_route107"></a><a class="link" href="#_route107">2.33. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</a></h3> <div class="sect3"> -<h4 id="_parameters_25"><a class="anchor" href="#_parameters_25"></a><a class="link" href="#_parameters_25">2.32.1. Parameters</a></h4> +<h4 id="_parameters_26"><a class="anchor" href="#_parameters_26"></a><a class="link" href="#_parameters_26">2.33.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2647,7 +2728,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_32"><a class="anchor" href="#_responses_32"></a><a class="link" href="#_responses_32">2.32.2. Responses</a></h4> +<h4 id="_responses_33"><a class="anchor" href="#_responses_33"></a><a class="link" href="#_responses_33">2.33.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2671,7 +2752,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_consumes_8"><a class="anchor" href="#_consumes_8"></a><a class="link" href="#_consumes_8">2.32.3. Consumes</a></h4> +<h4 id="_consumes_8"><a class="anchor" href="#_consumes_8"></a><a class="link" href="#_consumes_8">2.33.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2681,7 +2762,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect3"> -<h4 id="_produces_31"><a class="anchor" href="#_produces_31"></a><a class="link" href="#_produces_31">2.32.4. Produces</a></h4> +<h4 id="_produces_32"><a class="anchor" href="#_produces_32"></a><a class="link" href="#_produces_32">2.33.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2692,9 +2773,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route108"><a class="anchor" href="#_route108"></a><a class="link" href="#_route108">2.33. GET /v2/templates</a></h3> +<h3 id="_route111"><a class="anchor" href="#_route111"></a><a class="link" href="#_route111">2.34. GET /v2/templates</a></h3> <div class="sect3"> -<h4 id="_responses_33"><a class="anchor" href="#_responses_33"></a><a class="link" href="#_responses_33">2.33.1. Responses</a></h4> +<h4 id="_responses_34"><a class="anchor" href="#_responses_34"></a><a class="link" href="#_responses_34">2.34.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2718,7 +2799,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_32"><a class="anchor" href="#_produces_32"></a><a class="link" href="#_produces_32">2.33.2. Produces</a></h4> +<h4 id="_produces_33"><a class="anchor" href="#_produces_33"></a><a class="link" href="#_produces_33">2.34.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2729,9 +2810,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_v2_templates_names_get"><a class="anchor" href="#_v2_templates_names_get"></a><a class="link" href="#_v2_templates_names_get">2.34. GET /v2/templates/names</a></h3> +<h3 id="_v2_templates_names_get"><a class="anchor" href="#_v2_templates_names_get"></a><a class="link" href="#_v2_templates_names_get">2.35. GET /v2/templates/names</a></h3> <div class="sect3"> -<h4 id="_responses_34"><a class="anchor" href="#_responses_34"></a><a class="link" href="#_responses_34">2.34.1. Responses</a></h4> +<h4 id="_responses_35"><a class="anchor" href="#_responses_35"></a><a class="link" href="#_responses_35">2.35.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2755,7 +2836,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_33"><a class="anchor" href="#_produces_33"></a><a class="link" href="#_produces_33">2.34.2. Produces</a></h4> +<h4 id="_produces_34"><a class="anchor" href="#_produces_34"></a><a class="link" href="#_produces_34">2.35.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2766,9 +2847,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_v2_templates_templatename_get"><a class="anchor" href="#_v2_templates_templatename_get"></a><a class="link" href="#_v2_templates_templatename_get">2.35. GET /v2/templates/{templateName}</a></h3> +<h3 id="_v2_templates_templatename_get"><a class="anchor" href="#_v2_templates_templatename_get"></a><a class="link" href="#_v2_templates_templatename_get">2.36. GET /v2/templates/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_26"><a class="anchor" href="#_parameters_26"></a><a class="link" href="#_parameters_26">2.35.1. Parameters</a></h4> +<h4 id="_parameters_27"><a class="anchor" href="#_parameters_27"></a><a class="link" href="#_parameters_27">2.36.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2793,7 +2874,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_35"><a class="anchor" href="#_responses_35"></a><a class="link" href="#_responses_35">2.35.2. Responses</a></h4> +<h4 id="_responses_36"><a class="anchor" href="#_responses_36"></a><a class="link" href="#_responses_36">2.36.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2817,7 +2898,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_34"><a class="anchor" href="#_produces_34"></a><a class="link" href="#_produces_34">2.35.3. Produces</a></h4> +<h4 id="_produces_35"><a class="anchor" href="#_produces_35"></a><a class="link" href="#_produces_35">2.36.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2828,9 +2909,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_v2_templates_templatename_svgrepresentation_get"><a class="anchor" href="#_v2_templates_templatename_svgrepresentation_get"></a><a class="link" href="#_v2_templates_templatename_svgrepresentation_get">2.36. GET /v2/templates/{templateName}/svgRepresentation</a></h3> +<h3 id="_v2_templates_templatename_svgrepresentation_get"><a class="anchor" href="#_v2_templates_templatename_svgrepresentation_get"></a><a class="link" href="#_v2_templates_templatename_svgrepresentation_get">2.37. GET /v2/templates/{templateName}/svgRepresentation</a></h3> <div class="sect3"> -<h4 id="_parameters_27"><a class="anchor" href="#_parameters_27"></a><a class="link" href="#_parameters_27">2.36.1. Parameters</a></h4> +<h4 id="_parameters_28"><a class="anchor" href="#_parameters_28"></a><a class="link" href="#_parameters_28">2.37.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2855,7 +2936,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_responses_36"><a class="anchor" href="#_responses_36"></a><a class="link" href="#_responses_36">2.36.2. Responses</a></h4> +<h4 id="_responses_37"><a class="anchor" href="#_responses_37"></a><a class="link" href="#_responses_37">2.37.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2879,7 +2960,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_35"><a class="anchor" href="#_produces_35"></a><a class="link" href="#_produces_35">2.36.3. Produces</a></h4> +<h4 id="_produces_36"><a class="anchor" href="#_produces_36"></a><a class="link" href="#_produces_36">2.37.3. Produces</a></h4> <div class="ulist"> <ul> <li> diff --git a/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java b/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java index 5208f7ffd..2faf38f0a 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java +++ b/src/test/java/org/onap/clamp/clds/tosca/DictionaryRepositoriesTestItCase.java @@ -76,13 +76,13 @@ public class DictionaryRepositoriesTestItCase { dictionaryRepository.save(dictionaryTest1); List<String> res1 = dictionaryRepository.getAllDictionaryNames(); - assertThat(res1.size()).isEqualTo(1); - assertThat(res1.get(0)).isEqualTo("testDictionary1"); + assertThat(res1.size()).isGreaterThan(1); + assertThat(res1).contains("testDictionary1"); dictionaryRepository.save(dictionaryTest2); List<String> res2 = dictionaryRepository.getAllDictionaryNames(); - assertThat(res2.size()).isEqualTo(2); - assertThat(res2.get(0)).isEqualTo("testDictionary1"); - assertThat(res2.get(1)).isEqualTo("testDictionary2"); + assertThat(res2.size()).isGreaterThan(2); + assertThat(res2).contains("testDictionary1"); + assertThat(res2).contains("testDictionary2"); } } diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java index 693377ee0..0a0710c65 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateManagerTest.java @@ -50,7 +50,7 @@ public class JsonTemplateManagerTest extends TestCase { "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.monitoring.cdap.tca.hi.lo.app"; - jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null); + jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); } /** @@ -68,7 +68,7 @@ public class JsonTemplateManagerTest extends TestCase { "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.guard.common.FrequencyLimiter"; - jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null); + jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); } /** @@ -86,7 +86,7 @@ public class JsonTemplateManagerTest extends TestCase { "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.operational.common.Apex"; - jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null); + jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); } /** @@ -104,7 +104,7 @@ public class JsonTemplateManagerTest extends TestCase { "clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.operational.common.Drools"; - jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null); + jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); } @@ -121,7 +121,7 @@ public class JsonTemplateManagerTest extends TestCase { ResourceFileUtil.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); String componentName = "onap.policies.controlloop.operational.common.Drools"; - jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null); + jsonTemplateManager.getJsonSchemaForPolicyType(componentName, null, null); } /** diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java index b4f8b1245..3ff6ffb33 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java @@ -4,7 +4,7 @@ * ================================================================================ * 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 @@ -29,10 +29,12 @@ import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.clamp.clds.Application; +import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; 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.clds.util.ResourceFileUtil; +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; @@ -51,6 +53,9 @@ public class ToscaConverterWithDictionarySupportItCase { @Autowired private ToscaMetadataParserWithDictionarySupport toscaMetadataParserWithDictionarySupport; + @Autowired + private ToscaMetadataExecutor toscaMetadataExecutor; + /** * This Test validates Tosca yaml with metadata tag that contains policy_model_type and acronym * parameters which defines the Tosca Policy name and its short name. @@ -103,16 +108,38 @@ public class ToscaConverterWithDictionarySupportItCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( - ResourceFileUtil.getResourceAsString("tosca/tosca_metadata_clamp_possible_values.yaml"), + ResourceFileUtil.getResourceAsString("tosca/new-converter/tosca_metadata_clamp_possible_values.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); JsonObject jsonSchema = jsonTemplateManager.getJsonSchemaForPolicyType( - "onap.policies.monitoring.cdap.tca.hi.lo.app", toscaMetadataParserWithDictionarySupport); + "onap.policies.monitoring.cdap.tca.hi.lo.app", toscaMetadataParserWithDictionarySupport, null); JSONAssert.assertEquals( ResourceFileUtil .getResourceAsString("tosca/new-converter/tca-with-metadata.json"), JsonUtils.GSON.toJson(jsonSchema), true); } + + @Test + @Transactional + public final void testMetadataClampPossibleValueWithExecutor() throws IOException, UnknownComponentException { + Service service = new Service(ResourceFileUtil.getResourceAsString("tosca/service-details.json"), + ResourceFileUtil.getResourceAsString("tosca/resource-details.json")); + JsonTemplateManager jsonTemplateManager = + new JsonTemplateManager( + ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" + + ".policies.controlloop.operational.common.Apex/versions/1.0" + + ".0?connectionTimeToLive=5000/.file"), + ResourceFileUtil.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), + ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); + + JsonObject jsonSchema = jsonTemplateManager.getJsonSchemaForPolicyType( + "onap.policies.controlloop.operational.common.Apex", toscaMetadataParserWithDictionarySupport, service); + + JSONAssert.assertEquals( + ResourceFileUtil + .getResourceAsString("tosca/new-converter/tosca_apex_with_metadata.json"), + JsonUtils.GSON.toJson(jsonSchema), true); + } } diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file index 7d694eb8b..ae0dfbfc3 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file @@ -72,7 +72,7 @@ data_types: entity that generated the ONSET event will be the target. required: false metadata: - clamp_possible_values: test + clamp_possible_values: ClampExecution:CSAR_RESOURCES entry_schema: type: string @@ -85,23 +85,23 @@ data_types: description: The actor performing the operation. required: true metadata: - clamp_possible_values: test + clamp_possible_values: Dictionary:DefaultActor operation: type: string description: The operation the actor is performing. required: true metadata: - clamp_possible_values: test + clamp_possible_values: ClampExecution:CDS/operation target: type: onap.datatype.controlloop.Target description: The resource the operation should be performed on. required: true - metadata: - clamp_possible_values: test payload: type: map description: Name/value pairs of payload information passed by Policy to the actor required: false + metadata: + clamp_possible_values: ClampExecution:CDS/payload entry_schema: type: string diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file index 240009932..1f8723c3d 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file @@ -60,7 +60,7 @@ data_types: entity that generated the ONSET event will be the target. required: false metadata: - clamp_possible_values: test + clamp_possible_values: ClampExecution:CSAR_RESOURCES entry_schema: type: string @@ -73,23 +73,23 @@ data_types: description: The actor performing the operation. required: true metadata: - clamp_possible_values: test + clamp_possible_values: Dictionary:DefaultActor operation: type: string description: The operation the actor is performing. required: true metadata: - clamp_possible_values: test + clamp_possible_values: ClampExecution:CDS/operation target: type: onap.datatype.controlloop.Target description: The resource the operation should be performed on. required: true - metadata: - clamp_possible_values: test payload: type: map description: Name/value pairs of payload information passed by Policy to the actor required: false + metadata: + clamp_possible_values: ClampExecution:CDS/payload entry_schema: type: string diff --git a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json new file mode 100644 index 000000000..a44b94e07 --- /dev/null +++ b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json @@ -0,0 +1,475 @@ +{ + "title": "onap.policies.controlloop.operational.common.Apex", + "type": "object", + "description": "Operational policies for Apex PDP", + "required": [ + "id", + "timeout", + "abatement", + "trigger", + "operations", + "engineServiceParameters", + "eventInputParameters", + "eventOutputParameters" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique control loop id." + }, + "timeout": { + "type": "integer", + "description": "Overall timeout for executing all the operations. This timeout should equal or exceed the total\ntimeout for each operation listed.\n" + }, + "abatement": { + "type": "boolean", + "description": "Whether an abatement event message will be expected for the control loop from DCAE.", + "default": false + }, + "trigger": { + "type": "string", + "description": "Initial operation to execute upon receiving an Onset event message for the Control Loop." + }, + "operations": { + "type": "array", + "description": "List of operations to be performed when Control Loop is triggered.", + "items": { + "title": "onap.datatype.controlloop.Operation", + "type": "object", + "description": "An operation supported by an actor", + "required": [ + "id", + "operation", + "timeout", + "retries" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the operation" + }, + "description": { + "type": "string", + "description": "A user-friendly description of the intent for the operation" + }, + "operation": { + "title": "onap.datatype.controlloop.Actor", + "type": "object", + "description": "An actor/operation/target definition", + "required": [ + "actor", + "operation", + "target" + ], + "properties": { + "actor": { + "type": "string", + "description": "The actor performing the operation.", + "enum": [ + "CDS", + "SDNC", + "SO" + ], + "options": { + "enum_titles": [ + "CDS", + "SDNC", + "SO" + ] + } + }, + "operation": { + "type": "string", + "description": "The operation the actor is performing.", + "enum": [ + "resource-assignment", + "activate", + "activate-restconf", + "activate-cli", + "assign-activate", + "imperative-test-wf" + ] + }, + "target": { + "title": "onap.datatype.controlloop.Target", + "type": "object", + "description": "Definition for a entity in A&AI to perform a control loop operation on", + "required": [ + "targetType" + ], + "properties": { + "targetType": { + "type": "string", + "description": "Category for the target type", + "enum": [ + "VNF", + "VM", + "VFMODULE", + "PNF" + ] + }, + "entityIds": { + "type": "object", + "description": "Map of values that identify the resource. If none are provided, it is assumed that the\nentity that generated the ONSET event will be the target.\n", + "anyOf": [ + { + "title": "VNF-vLoadBalancerMS 0", + "properties": { + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "vLoadBalancerMS", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vpkg..module-1", + "properties": { + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vpkg..module-1", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "ca052563-eb92-4b5b-ad41-9111768ce043", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vpkg..module-1", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vdns..module-3", + "properties": { + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vdns..module-3", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "4fa73b49-8a6c-493e-816b-eb401567b720", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vdns..module-3", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "bafcdab0-801d-4d81-9ead-f464640a38b1", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..base_template..module-0", + "properties": { + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..base_template..module-0", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "63734409-f745-4e4d-a38b-131638a0edce", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..base_template..module-0", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vlb..module-2", + "properties": { + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vlb..module-2", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "a772a1f4-0064-412c-833d-4749b15828dd", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vlb..module-2", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806", + "readOnly": "True" + } + } + } + ] + } + } + }, + "payload": { + "type": "object", + "description": "Name/value pairs of payload information passed by Policy to the actor", + "anyOf": [ + { + "title": "resource-assignment", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + }, + { + "title": "activate", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + }, + { + "title": "activate-restconf", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + }, + { + "title": "activate-cli", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + }, + { + "title": "assign-activate", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + }, + { + "title": "imperative-test-wf", + "properties": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": { + "resource-assignment-properties": { + "request-id": "", + "service-instance-id": "", + "vnf-id": "", + "action-name": "", + "scope-type": "", + "hostname": "", + "vnf_name": "" + } + } + } + } + ] + } + } + }, + "timeout": { + "type": "integer", + "description": "The amount of time for the actor to perform the operation." + }, + "retries": { + "type": "integer", + "description": "The number of retries the actor should attempt to perform the operation.", + "default": 0 + }, + "success": { + "type": "string", + "description": "Points to the operation to invoke on success. A value of \"final_success\" indicates and end to the operation.", + "default": "final_success" + }, + "failure": { + "type": "string", + "description": "Points to the operation to invoke on Actor operation failure.", + "default": "final_failure" + }, + "failure_timeout": { + "type": "string", + "description": "Points to the operation to invoke when the time out for the operation occurs.", + "default": "final_failure_timeout" + }, + "failure_retries": { + "type": "string", + "description": "Points to the operation to invoke when the current operation has exceeded its max retries.", + "default": "final_failure_retries" + }, + "failure_exception": { + "type": "string", + "description": "Points to the operation to invoke when the current operation causes an exception.", + "default": "final_failure_exception" + }, + "failure_guard": { + "type": "string", + "description": "Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.", + "default": "final_failure_guard" + } + } + } + }, + "engineServiceParameters": { + "type": "string", + "description": "The engine parameters like name, instanceCount, policy implementation, parameters etc." + }, + "eventInputParameters": { + "type": "string", + "description": "The event input parameters." + }, + "eventOutputParameters": { + "type": "string", + "description": "The event output parameters." + }, + "javaProperties": { + "type": "string", + "description": "Name/value pairs of properties to be set for APEX if needed." + } + } +}
\ No newline at end of file diff --git a/src/test/resources/tosca/new-converter/tosca_metadata_clamp_possible_values.yaml b/src/test/resources/tosca/new-converter/tosca_metadata_clamp_possible_values.yaml new file mode 100644 index 000000000..7fe9d5398 --- /dev/null +++ b/src/test/resources/tosca/new-converter/tosca_metadata_clamp_possible_values.yaml @@ -0,0 +1,184 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +policy_types: + onap.policies.Monitoring: + derived_from: tosca.policies.Root + description: a base policy type for all policies that governs monitoring provisioning + onap.policies.monitoring.cdap.tca.hi.lo.app: + derived_from: onap.policies.Monitoring + version: 1.0.0 + properties: + tca_policy: + type: map + description: TCA Policy JSON + entry_schema: + type: onap.datatypes.monitoring.tca_policy + metadata: + policy_model_type: onap.policies.monitoring.cdap.tca.hi.lo.app + acronym: tca + +data_types: + onap.datatypes.monitoring.metricsPerEventName: + derived_from: tosca.datatypes.Root + properties: + controlLoopSchemaType: + type: string + required: true + description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM + constraints: + - valid_values: + - VM + - VNF + eventName: + type: string + required: true + description: Event name to which thresholds need to be applied + policyName: + type: string + required: true + description: TCA Policy Scope Name + policyScope: + type: string + required: true + description: TCA Policy Scope + policyVersion: + type: string + required: true + description: TCA Policy Scope Version + thresholds: + type: list + required: true + description: Thresholds associated with eventName + entry_schema: + type: onap.datatypes.monitoring.thresholds + context: + type: string + required: true + description: TCA Policy Dummy Context + metadata: + clamp_possible_values: Dictionary:Context + + signature: + type: onap.datatypes.monitoring.Dummy_Signature + description: Signature + required: true + + onap.datatypes.monitoring.Dummy_Signature: + derived_from: tosca.datatypes.Root + properties: + filter_clause: + type: string + description: Filter Clause + required: true + metadata: + clamp_possible_values: Dictionary:EventDictionary#Operators + + onap.datatypes.monitoring.tca_policy: + derived_from: tosca.datatypes.Root + properties: + domain: + type: string + required: true + description: Domain name to which TCA needs to be applied + default: measurementsForVfScaling + constraints: + - equal: measurementsForVfScaling + metricsPerEventName: + type: list + required: true + description: Contains eventName and threshold details that need to be applied to given eventName + entry_schema: + type: onap.datatypes.monitoring.metricsPerEventName + onap.datatypes.monitoring.thresholds: + derived_from: tosca.datatypes.Root + properties: + closedLoopControlName: + type: string + required: true + description: Closed Loop Control Name associated with the threshold + closedLoopEventStatus: + type: string + required: true + description: Closed Loop Event Status of the threshold + constraints: + - valid_values: + - ONSET + - ABATED + direction: + type: string + required: true + description: Direction of the threshold + constraints: + - valid_values: + - LESS + - LESS_OR_EQUAL + - GREATER + - GREATER_OR_EQUAL + - EQUAL + fieldPath: + type: string + required: true + description: Json field Path as per CEF message which needs to be analyzed for TCA + constraints: + - valid_values: + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage + - $.event.measurementsForVfScalingFields.meanRequestLatency + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed + - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value + severity: + type: string + required: true + description: Threshold Event Severity + constraints: + - valid_values: + - CRITICAL + - MAJOR + - MINOR + - WARNING + - NORMAL + thresholdValue: + type: integer + required: true + description: Threshold value for the field Path inside CEF message + version: + type: string + required: true + description: Version number associated with the threshold |