diff options
author | sebdet <sebastien.determe@intl.att.com> | 2020-03-12 14:38:07 -0700 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2020-03-13 11:03:29 -0700 |
commit | 723de7f63f0951d0cfe7a23956cf9d00128809b1 (patch) | |
tree | 751562c9a0c9a885f6be143c12a6c85472519afb /src/main | |
parent | 774b4ba65f0d23ae34d3bddb63058796121c1ae3 (diff) |
Fix the new tosca converter
Fix the metadata section analysis and make the tosca parser more configurable (in applications.properties)
Issue-ID: CLAMP-580
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I9068bd9dc89861c640660a7f78fae2cb70bdc178
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main')
30 files changed, 1553 insertions, 744 deletions
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java deleted file mode 100644 index b3224b045..000000000 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterManager.java +++ /dev/null @@ -1,192 +0,0 @@ -/*- - * ============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; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import org.onap.clamp.clds.util.JsonUtils; - -public class ToscaConverterManager { - - private LinkedHashMap<String, Template> templates; - private LinkedHashMap<String, ToscaElement> components; - private ToscaConverterToJson toscaConverterToJson; - private ToscaItemsParser toscaItemsParser; - - /** - * Constructor. - * - * @param toscaYamlContent Policy Tosca Yaml content as string - * @param nativeToscaDatatypes The tosca yaml with tosca native datatypes - * @param templateProperties template properties as string - * @throws IOException in case of failure - */ - public ToscaConverterManager(String toscaYamlContent, String nativeToscaDatatypes, String templateProperties) - throws IOException { - if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) { - this.toscaItemsParser = new ToscaItemsParser(toscaYamlContent, nativeToscaDatatypes); - this.components = toscaItemsParser.getAllItemsFound(); - this.templates = initializeTemplates(templateProperties); - } - else { - components = null; - } - } - - //GETTERS & SETTERS - public LinkedHashMap<String, ToscaElement> getComponents() { - return components; - } - - public void setComponents(LinkedHashMap<String, ToscaElement> components) { - this.components = components; - } - - public ToscaConverterToJson getParseToJson() { - return toscaConverterToJson; - } - - public void setParseToJson(ToscaConverterToJson toscaConverterToJson) { - this.toscaConverterToJson = toscaConverterToJson; - } - - public LinkedHashMap<String, Template> getTemplates() { - return templates; - } - - public void setTemplates(LinkedHashMap<String, Template> templates) { - this.templates = templates; - } - - public ToscaItemsParser getToscaItemsParser() { - return toscaItemsParser; - } - - /** - * Add a template. - * - * @param name name - * @param templateFields fields - */ - public void addTemplate(String name, List<TemplateField> templateFields) { - Template template = new Template(name, templateFields); - //If it is true, the operation does not have any interest : - // replace OR put two different object with the same body - if (!templates.containsKey(template.getName()) || !this.hasTemplate(template)) { - this.templates.put(template.getName(), template); - } - } - - /** - * By name, find and remove a given template. - * - * @param nameTemplate name template - */ - public void removeTemplate(String nameTemplate) { - this.templates.remove(nameTemplate); - } - - /** - * Update Template : adding with true flag, removing with false. - * - * @param nameTemplate name template - * @param templateField field name - * @param operation operation - */ - public void updateTemplate(String nameTemplate, TemplateField templateField, Boolean operation) { - // Operation = true && field is not present => add Field - if (operation && !this.templates.get(nameTemplate).getTemplateFields().contains(templateField)) { - this.templates.get(nameTemplate).addField(templateField); - } - // Operation = false && field is present => remove Field - else if (!operation && this.templates.get(nameTemplate).getTemplateFields().contains(templateField)) { - this.templates.get(nameTemplate).removeField(templateField); - } - } - - /** - * Check if the JSONTemplates have the same bodies. - * - * @param template template - * @return a boolean - */ - public boolean hasTemplate(Template template) { - boolean duplicateTemplate = false; - Collection<String> templatesName = templates.keySet(); - if (templatesName.contains(template.getName())) { - Template existingTemplate = templates.get(template.getName()); - duplicateTemplate = existingTemplate.checkFields(template); - } - return duplicateTemplate; - } - - /** - * For a given Component, get a corresponding JsonObject, through parseToJSON. - * - * @param componentName name - * @return an json object - */ - public JsonObject startConversionToJson(String componentName) throws UnknownComponentException { - this.toscaConverterToJson = new ToscaConverterToJson(components, templates); - if (toscaConverterToJson.matchComponent(componentName) == null) { - throw new UnknownComponentException(componentName); - } - return toscaConverterToJson.getJsonProcess(componentName, "object"); - } - - /** - * Create and complete several Templates from file.properties. - * - * @param jsonTemplates The template properties as String - * @return a map - */ - @SuppressWarnings("unused") - private LinkedHashMap<String, Template> initializeTemplates(String jsonTemplates) { - - LinkedHashMap<String, Template> generatedTemplates = new LinkedHashMap<>(); - JsonObject templates = JsonUtils.GSON.fromJson(jsonTemplates, JsonObject.class); - - for (Map.Entry<String, JsonElement> templateAsJson : templates.entrySet()) { - Template template = new Template(templateAsJson.getKey()); - JsonObject templateBody = (JsonObject) templateAsJson.getValue(); - for (Map.Entry<String, JsonElement> field : templateBody.entrySet()) { - String fieldName = field.getKey(); - JsonObject bodyFieldAsJson = (JsonObject) field.getValue(); - Object fieldValue = bodyFieldAsJson.get("defaultValue").getAsString(); - Boolean fieldVisible = bodyFieldAsJson.get("visible").getAsBoolean(); - Boolean fieldStatic = bodyFieldAsJson.get("static").getAsBoolean(); - TemplateField bodyTemplateField = new TemplateField(fieldName, fieldValue, fieldVisible, fieldStatic); - template.getTemplateFields().add(bodyTemplateField); - } - generatedTemplates.put(template.getName(), template); - } - return generatedTemplates; - } - -} 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 new file mode 100644 index 000000000..c1bf1ad80 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupport.java @@ -0,0 +1,93 @@ +/*- + * ============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; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.gson.JsonObject; +import java.io.IOException; +import org.onap.clamp.clds.config.ClampProperties; +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.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class ToscaConverterWithDictionarySupport { + + private static final EELFLogger logger = + EELFManager.getInstance().getLogger(ToscaConverterWithDictionarySupport.class); + + private ClampProperties clampProperties; + private ToscaMetadataParser metadataParser; + + /** + * Constructor with Spring support. + * + * @param clampProperties Clamp Spring properties + * @param metadataParser Metadata parser + */ + @Autowired + public ToscaConverterWithDictionarySupport(ClampProperties clampProperties, + ToscaMetadataParserWithDictionarySupport metadataParser) { + this.clampProperties = clampProperties; + this.metadataParser = metadataParser; + } + + /** + * This method converts a tosca file to a json schema. + * It uses some parameters specified in the application.properties. + * + * @param toscaFile The tosca file as String + * @param policyTypeToDecode The policy type to decode + * @return A json object being a json schema + */ + public JsonObject convertToscaToJsonSchemaObject(String toscaFile, String policyTypeToDecode) { + 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); + } catch (IOException | UnknownComponentException e) { + logger.error("Unable to convert the tosca properly, exception caught during the decoding", + e); + return new JsonObject(); + } + } + + /** + * This method converts a tosca file to a json schema. + * It uses some parameters specified in the application.properties. + * + * @param toscaFile The tosca file as String + * @param policyTypeToDecode The policy type to decode + * @return A String containing the json schema + */ + public String convertToscaToJsonSchemaString(String toscaFile, String policyTypeToDecode) { + return JsonUtils.GSON.toJson(this.convertToscaToJsonSchemaObject(toscaFile, policyTypeToDecode)); + } +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ArrayField.java b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ArrayField.java index 61e40a1e6..83f792f3f 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ArrayField.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ArrayField.java @@ -21,7 +21,7 @@ *
*/
-package org.onap.clamp.clds.tosca.update;
+package org.onap.clamp.clds.tosca.update.elements;
import com.google.gson.JsonArray;
import java.util.ArrayList;
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Constraint.java b/src/main/java/org/onap/clamp/clds/tosca/update/elements/Constraint.java index 4f6b27a6a..d6bd355e3 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/Constraint.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/elements/Constraint.java @@ -21,21 +21,22 @@ *
*/
-package org.onap.clamp.clds.tosca.update;
+package org.onap.clamp.clds.tosca.update.elements;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
+import org.onap.clamp.clds.tosca.update.templates.JsonTemplate;
public class Constraint {
private LinkedHashMap<String, Object> constraints;
- private Template template;
+ private JsonTemplate jsonTemplate;
- public Constraint(LinkedHashMap<String, Object> constraints, Template template) {
- this.template = template;
+ public Constraint(LinkedHashMap<String, Object> constraints, JsonTemplate jsonTemplate) {
+ this.jsonTemplate = jsonTemplate;
this.constraints = constraints;
}
@@ -120,7 +121,7 @@ public class Constraint { checkTemplateField("maxLength", jsonSchema, fieldValue);
break;
case "array":
- if (fieldValue.equals(1) && template.hasFields("uniqueItems")) {
+ if (fieldValue.equals(1) && jsonTemplate.hasFields("uniqueItems")) {
jsonSchema.addProperty("uniqueItems", true);
} else {
checkTemplateField("minItems", jsonSchema, fieldValue);
@@ -171,7 +172,7 @@ public class Constraint { * @param typeProperty Get as Enum the valid values for the property
*/
public void getValueArray(JsonObject jsonSchema, Object fieldValue, String typeProperty) {
- if (template.hasFields("enum")) {
+ if (jsonTemplate.hasFields("enum")) {
JsonArray enumeration = new JsonArray();
if (typeProperty.equals("string") || typeProperty.equals("String")) {
ArrayList<String> arrayValues = (ArrayList<String>) fieldValue;
@@ -197,7 +198,7 @@ public class Constraint { * @param fieldValue Simple way to avoid code duplication
*/
public void checkTemplateField(String field, JsonObject jsonSchema, Object fieldValue) {
- if (template.hasFields(field)) {
+ if (jsonTemplate.hasFields(field)) {
String typeField = fieldValue.getClass().getSimpleName();
switch (typeField) {
case "String":
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaElement.java b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElement.java index d702cda55..9035a5806 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaElement.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElement.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.elements; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -36,7 +36,7 @@ public class ToscaElement { private String version; private String typeVersion; private String description; - private LinkedHashMap<String, Property> properties; + private LinkedHashMap<String, ToscaElementProperty> properties; public ToscaElement() { } @@ -97,16 +97,16 @@ public class ToscaElement { this.description = description; } - public LinkedHashMap<String, Property> getProperties() { + public LinkedHashMap<String, ToscaElementProperty> getProperties() { return properties; } - public void setProperties(LinkedHashMap<String, Property> properties) { + public void setProperties(LinkedHashMap<String, ToscaElementProperty> properties) { this.properties = properties; } - public void addProperties(Property property) { - this.properties.put(property.getName(), property); + public void addProperties(ToscaElementProperty toscaElementProperty) { + this.properties.put(toscaElementProperty.getName(), toscaElementProperty); } public ArrayList<String> propertiesNames() { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Property.java b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElementProperty.java index 0b6e38166..c5ab5a18e 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/Property.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/elements/ToscaElementProperty.java @@ -21,14 +21,15 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.elements; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.LinkedHashMap; +import org.onap.clamp.clds.tosca.update.templates.JsonTemplate; -public class Property { +public class ToscaElementProperty { /** * name parameter is used as "key", in the LinkedHashMap of Components. @@ -42,7 +43,7 @@ public class Property { * @param name the name * @param items the items */ - public Property(String name, LinkedHashMap<String, Object> items) { + public ToscaElementProperty(String name, LinkedHashMap<String, Object> items) { super(); this.name = name; this.items = items; @@ -117,14 +118,14 @@ public class Property { * * @param json a json * @param constraints constraints - * @param template template + * @param jsonTemplate template */ @SuppressWarnings("unchecked") - public void addConstraintsAsJson(JsonObject json, ArrayList<Object> constraints, Template template) { + public void addConstraintsAsJson(JsonObject json, ArrayList<Object> constraints, JsonTemplate jsonTemplate) { for (Object constraint : constraints) { if (constraint instanceof LinkedHashMap) { LinkedHashMap<String, Object> valueConstraint = (LinkedHashMap<String, Object>) constraint; - Constraint constraintParser = new Constraint(valueConstraint, template); + Constraint constraintParser = new Constraint(valueConstraint, jsonTemplate); constraintParser.deployConstraints(json, (String) getItems().get("type")); } } diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterToJson.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java index 297d568be..cfc0e42a8 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaConverterToJson.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java @@ -21,7 +21,7 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.parser; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -29,41 +29,40 @@ import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map.Entry; -import org.onap.clamp.tosca.DictionaryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; +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; -@Component -public class ToscaConverterToJson { +public class ToscaConverterToJsonSchema { private LinkedHashMap<String, ToscaElement> components; - private LinkedHashMap<String, Template> templates; + private LinkedHashMap<String, JsonTemplate> templates; - // if this one is set, the dictionary mechanism is enabled - @Autowired - private DictionaryService dictionaryService; + private ToscaMetadataParser metadataParser; - public ToscaConverterToJson(LinkedHashMap<String, ToscaElement> components, LinkedHashMap<String, Template> templates) { - this.components = components; - this.templates = templates; + /** + * 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 + */ + public ToscaConverterToJsonSchema(LinkedHashMap<String, ToscaElement> toscaElementsMap, + LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates, + ToscaMetadataParser metadataParser) { + this.components = toscaElementsMap; + this.templates = jsonSchemaTemplates; + this.metadataParser = metadataParser; } /** * For a given component, launch process to parse it in Json. * - * @param nameComponent name components + * @param toscaElementKey name components * @return return */ - public JsonObject getJsonProcess(String nameComponent, String typeComponent) { - JsonObject glob = new JsonObject(); - - if (typeComponent.equals("object")) { - glob = this.getFieldAsObject(matchComponent(nameComponent)); - } - else { - /*glob = this.getFieldAsArray(matchComponent(nameComponent));*/ - } - - return glob; + public JsonObject getJsonSchemaOfToscaElement(String toscaElementKey) { + return this.getFieldAsObject(getToscaElement(toscaElementKey)); } /** @@ -110,11 +109,11 @@ public class ToscaConverterToJson { requirements.addAll(getRequirements(toParse.getDerivedFrom())); } //Each property is checked, and add to the requirement array if it's required - Collection<Property> properties = toParse.getProperties().values(); - for (Property property : properties) { - if (property.getItems().containsKey("required") - && property.getItems().get("required").equals(true)) { - requirements.add(property.getName()); + Collection<ToscaElementProperty> properties = toParse.getProperties().values(); + for (ToscaElementProperty toscaElementProperty : properties) { + if (toscaElementProperty.getItems().containsKey("required") + && toscaElementProperty.getItems().get("required").equals(true)) { + requirements.add(toscaElementProperty.getName()); } } return requirements; @@ -137,10 +136,10 @@ public class ToscaConverterToJson { } //For each component property, check if its a complex properties (a component) or not. In that case, //launch the analyse of the property. - for (Entry<String, Property> property : toParse.getProperties().entrySet()) { - if (matchComponent((String) property.getValue().getItems().get("type")) != null) { + for (Entry<String, ToscaElementProperty> property : toParse.getProperties().entrySet()) { + if (getToscaElement((String) property.getValue().getItems().get("type")) != null) { jsonSchema.add(property.getValue().getName(), - this.getJsonProcess((String) property.getValue().getItems().get("type"), "object")); + this.getJsonSchemaOfToscaElement((String) property.getValue().getItems().get("type"))); } else { jsonSchema.add(property.getValue().getName(), this.complexParse(property.getValue())); @@ -162,27 +161,27 @@ public class ToscaConverterToJson { /** * to be done. * - * @param property property + * @param toscaElementProperty property * @return a json object */ @SuppressWarnings("unchecked") - public JsonObject complexParse(Property property) { + public JsonObject complexParse(ToscaElementProperty toscaElementProperty) { JsonObject propertiesInJson = new JsonObject(); - Template currentPropertyTemplate; - String typeProperty = (String) property.getItems().get("type"); + JsonTemplate currentPropertyJsonTemplate; + String typeProperty = (String) toscaElementProperty.getItems().get("type"); if (typeProperty.toLowerCase().equals("list") || typeProperty.toLowerCase().equals("map")) { - currentPropertyTemplate = templates.get("object"); + currentPropertyJsonTemplate = templates.get("object"); } else { - String propertyType = (String) property.getItems().get("type"); - currentPropertyTemplate = templates.get(propertyType.toLowerCase()); + String propertyType = (String) toscaElementProperty.getItems().get("type"); + currentPropertyJsonTemplate = templates.get(propertyType.toLowerCase()); } //Each "special" field is analysed, and has a specific treatment - for (String propertyField : property.getItems().keySet()) { + for (String propertyField : toscaElementProperty.getItems().keySet()) { switch (propertyField) { case "type": - if (currentPropertyTemplate.hasFields(propertyField)) { - String fieldtype = (String) property.getItems().get(propertyField); + if (currentPropertyJsonTemplate.hasFields(propertyField)) { + String fieldtype = (String) toscaElementProperty.getItems().get(propertyField); switch (fieldtype.toLowerCase()) { case "list": propertiesInJson.addProperty("type", "array"); @@ -204,48 +203,57 @@ public class ToscaConverterToJson { break; case "range": propertiesInJson.addProperty("type", "integer"); - if (!checkConstraintPresence(property, "greater_than") - && currentPropertyTemplate.hasFields("exclusiveMinimum")) { + if (!checkConstraintPresence(toscaElementProperty, "greater_than") + && currentPropertyJsonTemplate.hasFields("exclusiveMinimum")) { propertiesInJson.addProperty("exclusiveMinimum", false); } - if (!checkConstraintPresence(property, "less_than") - && currentPropertyTemplate.hasFields("exclusiveMaximum")) { + if (!checkConstraintPresence(toscaElementProperty, "less_than") + && currentPropertyJsonTemplate.hasFields("exclusiveMaximum")) { propertiesInJson.addProperty("exclusiveMaximum", false); } break; default: - propertiesInJson.addProperty("type", currentPropertyTemplate.getName()); + propertiesInJson.addProperty("type", currentPropertyJsonTemplate.getName()); break; } } break; case "metadata": - propertiesInJson.add("enum", MetadataParser.processAllMetadataElement(property, - dictionaryService)); + if (metadataParser != null) { + metadataParser.processAllMetadataElement(toscaElementProperty).entrySet() + .forEach((jsonEntry) -> { + propertiesInJson.add(jsonEntry.getKey(), + jsonEntry.getValue()); + + }); + } break; case "constraints": - property.addConstraintsAsJson(propertiesInJson, - (ArrayList<Object>) property.getItems().get("constraints"), - currentPropertyTemplate); + toscaElementProperty.addConstraintsAsJson(propertiesInJson, + (ArrayList<Object>) toscaElementProperty.getItems().get("constraints"), + currentPropertyJsonTemplate); break; case "entry_schema": //Here, a way to check if entry is a component (datatype) or a simple string - if (matchComponent(this.extractSpecificFieldFromMap(property, "entry_schema")) != null) { - String nameComponent = this.extractSpecificFieldFromMap(property, "entry_schema"); - ToscaConverterToJson child = new ToscaConverterToJson(components, templates); + if (getToscaElement(this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema")) + != null) { + String nameComponent = this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema"); + ToscaConverterToJsonSchema + child = new ToscaConverterToJsonSchema(components, templates, + metadataParser); JsonObject propertiesContainer = new JsonObject(); - switch ((String) property.getItems().get("type")) { + switch ((String) toscaElementProperty.getItems().get("type")) { case "map": // Get it as an object - JsonObject componentAsProperty = child.getJsonProcess(nameComponent, "object"); + JsonObject componentAsProperty = child.getJsonSchemaOfToscaElement(nameComponent); propertiesContainer.add(nameComponent, componentAsProperty); - if (currentPropertyTemplate.hasFields("properties")) { + if (currentPropertyJsonTemplate.hasFields("properties")) { propertiesInJson.add("properties", propertiesContainer); } break; default://list : get it as an Array - JsonObject componentAsItem = child.getJsonProcess(nameComponent, "object"); - if (currentPropertyTemplate.hasFields("properties")) { + JsonObject componentAsItem = child.getJsonSchemaOfToscaElement(nameComponent); + if (currentPropertyJsonTemplate.hasFields("properties")) { propertiesInJson.add("items", componentAsItem); } break; @@ -253,9 +261,10 @@ public class ToscaConverterToJson { } // Native cases - else if (property.getItems().get("type").equals("list")) { + else if (toscaElementProperty.getItems().get("type").equals("list")) { JsonObject itemContainer = new JsonObject(); - String valueInEntrySchema = this.extractSpecificFieldFromMap(property, "entry_schema"); + String valueInEntrySchema = + this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema"); itemContainer.addProperty("type", valueInEntrySchema); propertiesInJson.add("items", itemContainer); } @@ -264,9 +273,9 @@ public class ToscaConverterToJson { break; default: //Each classical field : type, description, default.. - if (currentPropertyTemplate.hasFields(propertyField) && !propertyField.equals("required")) { - property.addFieldToJson(propertiesInJson, propertyField, - property.getItems().get(propertyField)); + if (currentPropertyJsonTemplate.hasFields(propertyField) && !propertyField.equals("required")) { + toscaElementProperty.addFieldToJson(propertiesInJson, propertyField, + toscaElementProperty.getItems().get(propertyField)); } break; } @@ -275,12 +284,12 @@ public class ToscaConverterToJson { } /** - * Look for a matching Component for the name paramater, in the components list. + * Look for a matching Component for the name parameter, in the components list. * - * @param name the name - * @return a component + * @param name the tosca element name to search for + * @return a tosca element */ - public ToscaElement matchComponent(String name) { + public ToscaElement getToscaElement(String name) { ToscaElement correspondingToscaElement = null; if (components == null) { return null; @@ -296,28 +305,28 @@ public class ToscaConverterToJson { /** * Simple method to extract quickly a type field from particular property item. * - * @param property the property - * @param fieldName the fieldname + * @param toscaElementProperty the property + * @param fieldName the fieldname * @return a string */ @SuppressWarnings("unchecked") - public String extractSpecificFieldFromMap(Property property, String fieldName) { + public String extractSpecificFieldFromMap(ToscaElementProperty toscaElementProperty, String fieldName) { LinkedHashMap<String, String> entrySchemaFields = - (LinkedHashMap<String, String>) property.getItems().get(fieldName); + (LinkedHashMap<String, String>) toscaElementProperty.getItems().get(fieldName); return entrySchemaFields.get("type"); } /** * Check if a constraint, for a specific property, is there. * - * @param property property - * @param nameConstraint name constraint + * @param toscaElementProperty property + * @param nameConstraint name constraint * @return a flag boolean */ - public boolean checkConstraintPresence(Property property, String nameConstraint) { + public boolean checkConstraintPresence(ToscaElementProperty toscaElementProperty, String nameConstraint) { boolean presentConstraint = false; - if (property.getItems().containsKey("constraints")) { - ArrayList<Object> constraints = (ArrayList) property.getItems().get("constraints"); + if (toscaElementProperty.getItems().containsKey("constraints")) { + ArrayList<Object> constraints = (ArrayList) toscaElementProperty.getItems().get("constraints"); for (Object constraint : constraints) { if (constraint instanceof LinkedHashMap) { if (((LinkedHashMap) constraint).containsKey(nameConstraint)) { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaItemsParser.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaElementParser.java index 443a4b0cd..090fcfcfa 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ToscaItemsParser.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaElementParser.java @@ -21,38 +21,30 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.parser; -import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map.Entry; +import org.onap.clamp.clds.tosca.update.elements.ToscaElement; +import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; import org.yaml.snakeyaml.Yaml; -public class ToscaItemsParser { - private LinkedHashMap<String, ToscaElement> allItemsFound; - +public class ToscaElementParser { /** * Constructor. - * - * @param toscaYaml The tosca to parse - * @param toscaNativeDataTypeYaml THe name of the policy type to search */ - public ToscaItemsParser(String toscaYaml, String toscaNativeDataTypeYaml) { - this.allItemsFound = searchAllToscaElements(toscaYaml, toscaNativeDataTypeYaml); - } - - public LinkedHashMap<String, ToscaElement> getAllItemsFound() { - return allItemsFound; + private ToscaElementParser() { } private static LinkedHashMap<String, Object> searchAllDataTypesAndPolicyTypes(String toscaYaml) { LinkedHashMap<String, LinkedHashMap<String, Object>> file = (LinkedHashMap<String, LinkedHashMap<String, Object>>) new Yaml().load(toscaYaml); - // Get DataTypes - LinkedHashMap<String, Object> allItemsFound = file.get("data_types"); - allItemsFound = (allItemsFound == null) ? (new LinkedHashMap<>()) : allItemsFound; + LinkedHashMap<String, Object> allDataTypesFound = file.get("data_types"); + LinkedHashMap<String, Object> allPolicyTypesFound = file.get("policy_types"); + LinkedHashMap<String, Object> allItemsFound = new LinkedHashMap<>(); // Put the policies and datatypes in the same collection - allItemsFound.putAll(file.get("policy_types")); + allItemsFound = (allDataTypesFound == null) ? (new LinkedHashMap<>()) : allDataTypesFound; + allItemsFound.putAll(allPolicyTypesFound == null ? new LinkedHashMap<>() : allPolicyTypesFound); return allItemsFound; } @@ -65,10 +57,12 @@ public class ToscaItemsParser { * Yaml Parse gets raw policies and datatypes, in different sections : necessary to extract * all entities and put them at the same level. * - * @return a map + * @param toscaYaml the tosca model content + * @param nativeToscaYaml the tosca native datatype content + * @return a map of Tosca Element containing all tosca elements found (policy types and datatypes) */ - private static LinkedHashMap<String, ToscaElement> searchAllToscaElements(String toscaYaml, - String nativeToscaYaml) { + public static LinkedHashMap<String, ToscaElement> searchAllToscaElements(String toscaYaml, + String nativeToscaYaml) { LinkedHashMap<String, Object> allItemsFound = searchAllDataTypesAndPolicyTypes(toscaYaml); allItemsFound.putAll(searchAllNativeToscaDataTypes(nativeToscaYaml)); return parseAllItemsFound(allItemsFound); @@ -97,9 +91,9 @@ public class ToscaItemsParser { LinkedHashMap<String, Object> properties = (LinkedHashMap<String, Object>) componentBody.get("properties"); for (Entry<String, Object> itemToProperty : properties.entrySet()) { - Property property = new Property(itemToProperty.getKey(), + ToscaElementProperty toscaElementProperty = new ToscaElementProperty(itemToProperty.getKey(), (LinkedHashMap<String, Object>) itemToProperty.getValue()); - toscaElement.addProperties(property); + toscaElement.addProperties(toscaElementProperty); } } allItemsFound.put(toscaElement.getName(), toscaElement); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/MetadataParser.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java index fb70231fb..a51818e2e 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/MetadataParser.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParser.java @@ -1,11 +1,10 @@ - /*- * ============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 @@ -22,25 +21,11 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.parser.metadata; import com.google.gson.JsonObject; -import org.onap.clamp.tosca.DictionaryService; - -public class MetadataParser { +import org.onap.clamp.clds.tosca.update.elements.ToscaElementProperty; - /** - * This method is used to start the processing of the metadata field. - * - * @param property The property metadata as Json Object - * @param dictionaryService the Dictionary service, if null nothing will be done - * @return The jsonObject structure that must be added to the json schema - */ - public static JsonObject processAllMetadataElement(Property property, DictionaryService dictionaryService) { - if (dictionaryService != null) { - return null; - } else { - return null; - } - } +public interface ToscaMetadataParser { + JsonObject processAllMetadataElement(ToscaElementProperty toscaElementProperty); } 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 new file mode 100644 index 000000000..349ccee9e --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java @@ -0,0 +1,178 @@ +/*- + * ============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.parser.metadata; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +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.tosca.DictionaryElement; +import org.onap.clamp.tosca.DictionaryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataParser { + + @Autowired + private DictionaryService dictionaryService; + + /** + * This method is used to start the processing of the metadata field. + * + * @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) { + if (dictionaryService != null) { + return parseMetadataPossibleValues(toscaElementProperty.getItems(), dictionaryService); + } + else { + return null; + } + } + + private static JsonObject parseMetadataPossibleValues(LinkedHashMap<String, Object> childNodeMap, + DictionaryService dictionaryService) { + 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); + } + + }); + } + } + } + }); + } + } + return childObject; + } + + private static void processDictionaryElements(String dictionaryReference, JsonObject childObject, + DictionaryService dictionaryService) { + String[] dictionaryKeyArray = + dictionaryReference.substring(dictionaryReference.indexOf(ToscaSchemaConstants.DICTIONARY) + 11, + dictionaryReference.length()).split("#"); + if (dictionaryKeyArray.length > 1) { + // We support only one # as of now. + List<DictionaryElement> dictionaryElements = null; + if (dictionaryKeyArray.length == 2) { + dictionaryElements = new ArrayList<>(dictionaryService.getDictionary(dictionaryKeyArray[0]) + .getDictionaryElements()); + JsonArray subDictionaryNames = new JsonArray(); + new ArrayList<DictionaryElement>(dictionaryService.getDictionary(dictionaryKeyArray[1]) + .getDictionaryElements()).forEach(elem -> subDictionaryNames.add(elem.getShortName())); + + JsonArray jsonArray = new JsonArray(); + + Optional.of(dictionaryElements).get().stream().forEach(c -> { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty(JsonEditorSchemaConstants.TYPE, getJsonType(c.getType())); + if (c.getType() != null + && c.getType().equalsIgnoreCase(ToscaSchemaConstants.TYPE_STRING)) { + jsonObject.addProperty(JsonEditorSchemaConstants.MIN_LENGTH, 1); + + } + jsonObject.addProperty(JsonEditorSchemaConstants.ID, c.getName()); + jsonObject.addProperty(JsonEditorSchemaConstants.LABEL, c.getShortName()); + jsonObject.add(JsonEditorSchemaConstants.OPERATORS, subDictionaryNames); + jsonArray.add(jsonObject); + }); + + JsonObject filterObject = new JsonObject(); + filterObject.add(JsonEditorSchemaConstants.FILTERS, jsonArray); + + childObject.addProperty(JsonEditorSchemaConstants.TYPE, + JsonEditorSchemaConstants.TYPE_QBLDR); + // TO invoke validation on such parameters + childObject.addProperty(JsonEditorSchemaConstants.MIN_LENGTH, 1); + childObject.add(JsonEditorSchemaConstants.QSSCHEMA, filterObject); + + } + } + else { + List<DictionaryElement> dictionaryElements = + new ArrayList<>(dictionaryService.getDictionary(dictionaryKeyArray[0]).getDictionaryElements()); + JsonArray dictionaryNames = new JsonArray(); + JsonArray dictionaryFullNames = new JsonArray(); + dictionaryElements.stream().forEach(c -> { + // Json type will be translated before Policy creation + if (c.getType() != null && !c.getType().equalsIgnoreCase("json")) { + dictionaryFullNames.add(c.getName()); + } + dictionaryNames.add(c.getShortName()); + }); + + if (dictionaryFullNames.size() > 0) { + childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryFullNames); + // Add Enum titles for generated translated values during JSON instance + // generation + JsonObject enumTitles = new JsonObject(); + enumTitles.add(JsonEditorSchemaConstants.ENUM_TITLES, dictionaryNames); + childObject.add(JsonEditorSchemaConstants.OPTIONS, enumTitles); + } + else { + childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryNames); + } + } + } + + private static String getJsonType(String toscaType) { + String jsonType = null; + if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_INTEGER)) { + jsonType = JsonEditorSchemaConstants.TYPE_INTEGER; + } + else if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_LIST)) { + jsonType = JsonEditorSchemaConstants.TYPE_ARRAY; + } + else { + jsonType = JsonEditorSchemaConstants.TYPE_STRING; + } + return jsonType; + } + +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java index 6a531aeea..f64ba68cf 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java @@ -21,28 +21,28 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.templates; import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.List; -public class Template { +public class JsonTemplate { /** * name parameter is used as "key", in the LinkedHashMap of Templates. */ private String name; - private List<TemplateField> templateFields; + private List<JsonTemplateField> jsonTemplateFields; - public Template(String name) { + public JsonTemplate(String name) { this.name = name; - this.templateFields = new ArrayList<>(); + this.jsonTemplateFields = new ArrayList<>(); } - public Template(String name, List<TemplateField> templateFields) { + public JsonTemplate(String name, List<JsonTemplateField> jsonTemplateFields) { this.name = name; - this.templateFields = templateFields; + this.jsonTemplateFields = jsonTemplateFields; } public String getName() { @@ -53,12 +53,12 @@ public class Template { this.name = name; } - public List<TemplateField> getTemplateFields() { - return templateFields; + public List<JsonTemplateField> getJsonTemplateFields() { + return jsonTemplateFields; } - public void setTemplateFields(List<TemplateField> templateFields) { - this.templateFields = templateFields; + public void setJsonTemplateFields(List<JsonTemplateField> jsonTemplateFields) { + this.jsonTemplateFields = jsonTemplateFields; } /** @@ -68,8 +68,8 @@ public class Template { * @return Ture if it exists, false otherwise */ public boolean hasFields(String fieldName) { - for (TemplateField templateField : this.getTemplateFields()) { - if (templateField.getTitle().equals(fieldName)) { + for (JsonTemplateField jsonTemplateField : this.getJsonTemplateFields()) { + if (jsonTemplateField.getTitle().equals(fieldName)) { return true; } } @@ -82,21 +82,21 @@ public class Template { * @param fieldName The field name * @return THe Field found */ - public TemplateField getSpecificField(String fieldName) { - for (TemplateField templateField : this.getTemplateFields()) { - if (templateField.getTitle().equals(fieldName)) { - return templateField; + public JsonTemplateField getSpecificField(String fieldName) { + for (JsonTemplateField jsonTemplateField : this.getJsonTemplateFields()) { + if (jsonTemplateField.getTitle().equals(fieldName)) { + return jsonTemplateField; } } return null; } - public void addField(TemplateField templateField) { - templateFields.add(templateField); + public void addField(JsonTemplateField jsonTemplateField) { + jsonTemplateFields.add(jsonTemplateField); } - public void removeField(TemplateField templateField) { - templateFields.remove(templateField); + public void removeField(JsonTemplateField jsonTemplateField) { + jsonTemplateFields.remove(jsonTemplateField); } /** @@ -106,9 +106,9 @@ public class Template { * @param state True or false */ public void setVisibility(String nameField, boolean state) { - for (TemplateField templateField : this.templateFields) { - if (templateField.getTitle().equals(nameField)) { - templateField.setVisible(state); + for (JsonTemplateField jsonTemplateField : this.jsonTemplateFields) { + if (jsonTemplateField.getTitle().equals(nameField)) { + jsonTemplateField.setVisible(state); } } } @@ -120,9 +120,9 @@ public class Template { * @param state true or false */ public void setStatic(String nameField, boolean state) { - for (TemplateField templateField : this.templateFields) { - if (templateField.getTitle().equals(nameField)) { - templateField.setStaticValue(state); + for (JsonTemplateField jsonTemplateField : this.jsonTemplateFields) { + if (jsonTemplateField.getTitle().equals(nameField)) { + jsonTemplateField.setStaticValue(state); } } } @@ -134,9 +134,9 @@ public class Template { * @param newValue The new value as Object */ public void updateValueField(String nameField, Object newValue) { - for (TemplateField templateField : this.templateFields) { - if (templateField.getTitle().equals(nameField)) { - templateField.setValue(newValue); + for (JsonTemplateField jsonTemplateField : this.jsonTemplateFields) { + if (jsonTemplateField.getTitle().equals(nameField)) { + jsonTemplateField.setValue(newValue); } } } @@ -144,23 +144,23 @@ public class Template { /** * Compare two templates : size and their contents. * - * @param template the template + * @param jsonTemplate the template * @return a boolean */ - public boolean checkFields(Template template) { + public boolean checkFields(JsonTemplate jsonTemplate) { boolean duplicateFields = false; - if (template.getTemplateFields().size() == this.getTemplateFields().size()) { + if (jsonTemplate.getJsonTemplateFields().size() == this.getJsonTemplateFields().size()) { int countMatchingFields = 0; //loop each component of first - for (TemplateField templateFieldToCheck : template.getTemplateFields()) { - for (TemplateField templateField : this.getTemplateFields()) { - if (templateFieldToCheck.compareWithField(templateField)) { + for (JsonTemplateField jsonTemplateFieldToCheck : jsonTemplate.getJsonTemplateFields()) { + for (JsonTemplateField jsonTemplateField : this.getJsonTemplateFields()) { + if (jsonTemplateFieldToCheck.compareWithField(jsonTemplateField)) { countMatchingFields++; } } } - if (template.getTemplateFields().size() == countMatchingFields) { + if (jsonTemplate.getJsonTemplateFields().size() == countMatchingFields) { duplicateFields = true; } } @@ -212,13 +212,13 @@ public class Template { */ public void injectStaticValue(JsonObject jsonSchema, String fieldName) { if (isVisible(fieldName)) { - TemplateField toInject = this.getSpecificField(fieldName); + JsonTemplateField toInject = this.getSpecificField(fieldName); jsonSchema.addProperty(fieldName, (String) toInject.getValue()); } } @Override public String toString() { - return " templateFields : " + templateFields; + return " templateFields : " + jsonTemplateFields; } } diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateField.java b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateField.java index 34446436a..a1e15307c 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateField.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateField.java @@ -21,15 +21,15 @@ * */ -package org.onap.clamp.clds.tosca.update; +package org.onap.clamp.clds.tosca.update.templates; -public class TemplateField { +public class JsonTemplateField { private String title; private Object value; private Boolean visible; private Boolean staticValue; - public TemplateField(String title) { + public JsonTemplateField(String title) { this.title = title; } @@ -41,7 +41,7 @@ public class TemplateField { * @param visible visible or not * @param staticValue The static value */ - public TemplateField(String title, Object value, Boolean visible, Boolean staticValue) { + public JsonTemplateField(String title, Object value, Boolean visible, Boolean staticValue) { this.title = title; this.value = value; this.visible = visible; @@ -98,18 +98,19 @@ public class TemplateField { return false; } - TemplateField templateField = (TemplateField) otherField; + JsonTemplateField jsonTemplateField = (JsonTemplateField) otherField; - if (title != null ? !title.equals(templateField.title) : templateField.title != null) { + if (title != null ? !title.equals(jsonTemplateField.title) : jsonTemplateField.title != null) { return false; } - if (value != null ? !value.equals(templateField.value) : templateField.value != null) { + if (value != null ? !value.equals(jsonTemplateField.value) : jsonTemplateField.value != null) { return false; } - if (visible != null ? !visible.equals(templateField.visible) : templateField.visible != null) { + if (visible != null ? !visible.equals(jsonTemplateField.visible) : jsonTemplateField.visible != null) { return false; } - return staticValue != null ? staticValue.equals(templateField.staticValue) : templateField.staticValue == null; + return staticValue != null ? staticValue.equals(jsonTemplateField.staticValue) : + jsonTemplateField.staticValue == null; } @Override @@ -121,9 +122,9 @@ public class TemplateField { return false; } - TemplateField templateField = (TemplateField) object; + JsonTemplateField jsonTemplateField = (JsonTemplateField) object; - return title != null ? title.equals(templateField.title) : templateField.title == null; + return title != null ? title.equals(jsonTemplateField.title) : jsonTemplateField.title == null; } @Override @@ -134,15 +135,15 @@ public class TemplateField { /** * This method test the entire equality. * - * @param templateField1 object one - * @param templateField2 object two + * @param jsonTemplateField1 object one + * @param jsonTemplateField2 object two * @return true if they are totally equals (all attributes, false otherwise */ - public static boolean fieldsEquals(TemplateField templateField1, TemplateField templateField2) { - return (templateField2.getTitle().equals(templateField1.getTitle()) - && templateField2.getValue().equals(templateField1.getValue()) - && templateField2.getVisible().equals(templateField1.getVisible()) - && templateField2.getStaticValue().equals(templateField1.getStaticValue())); + public static boolean fieldsEquals(JsonTemplateField jsonTemplateField1, JsonTemplateField jsonTemplateField2) { + return (jsonTemplateField2.getTitle().equals(jsonTemplateField1.getTitle()) + && jsonTemplateField2.getValue().equals(jsonTemplateField1.getValue()) + && jsonTemplateField2.getVisible().equals(jsonTemplateField1.getVisible()) + && jsonTemplateField2.getStaticValue().equals(jsonTemplateField1.getStaticValue())); } } 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 new file mode 100644 index 000000000..5e4b66009 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java @@ -0,0 +1,184 @@ +/*- + * ============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.templates; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.onap.clamp.clds.tosca.update.UnknownComponentException; +import org.onap.clamp.clds.tosca.update.elements.ToscaElement; +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; + +public class JsonTemplateManager { + private LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates; + private LinkedHashMap<String, ToscaElement> toscaElements; + + /** + * Constructor. + * + * @param toscaYamlContent Policy Tosca Yaml content as string + * @param nativeToscaDatatypes The tosca yaml with tosca native datatypes + * @param jsonSchemaTemplates template properties as string + */ + public JsonTemplateManager(String toscaYamlContent, String nativeToscaDatatypes, String jsonSchemaTemplates) { + if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) { + this.toscaElements = ToscaElementParser.searchAllToscaElements(toscaYamlContent, nativeToscaDatatypes); + this.jsonSchemaTemplates = initializeTemplates(jsonSchemaTemplates); + } + else { + toscaElements = null; + } + } + + //GETTERS & SETTERS + public LinkedHashMap<String, ToscaElement> getToscaElements() { + return toscaElements; + } + + public void setToscaElements(LinkedHashMap<String, ToscaElement> toscaElements) { + this.toscaElements = toscaElements; + } + + public LinkedHashMap<String, JsonTemplate> getJsonSchemaTemplates() { + return jsonSchemaTemplates; + } + + public void setJsonSchemaTemplates(LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates) { + this.jsonSchemaTemplates = jsonSchemaTemplates; + } + + /** + * Add a template. + * + * @param name name + * @param jsonTemplateFields fields + */ + public void addTemplate(String name, List<JsonTemplateField> jsonTemplateFields) { + JsonTemplate jsonTemplate = new JsonTemplate(name, jsonTemplateFields); + //If it is true, the operation does not have any interest : + // replace OR put two different object with the same body + if (!jsonSchemaTemplates.containsKey(jsonTemplate.getName()) || !this.hasTemplate(jsonTemplate)) { + this.jsonSchemaTemplates.put(jsonTemplate.getName(), jsonTemplate); + } + } + + /** + * By name, find and remove a given template. + * + * @param nameTemplate name template + */ + public void removeTemplate(String nameTemplate) { + this.jsonSchemaTemplates.remove(nameTemplate); + } + + /** + * Update Template : adding with true flag, removing with false. + * + * @param nameTemplate name template + * @param jsonTemplateField field name + * @param operation operation + */ + 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)) { + this.jsonSchemaTemplates.get(nameTemplate).addField(jsonTemplateField); + } + // Operation = false && field is present => remove Field + else if (!operation && this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) { + this.jsonSchemaTemplates.get(nameTemplate).removeField(jsonTemplateField); + } + } + + /** + * Check if the JSONTemplates have the same bodies. + * + * @param jsonTemplate template + * @return a boolean + */ + public boolean hasTemplate(JsonTemplate jsonTemplate) { + boolean duplicateTemplate = false; + Collection<String> templatesName = jsonSchemaTemplates.keySet(); + if (templatesName.contains(jsonTemplate.getName())) { + JsonTemplate existingJsonTemplate = jsonSchemaTemplates.get(jsonTemplate.getName()); + duplicateTemplate = existingJsonTemplate.checkFields(jsonTemplate); + } + return duplicateTemplate; + } + + /** + * For a given policy type, get a corresponding JsonObject from the tosca model. + * + * @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 + * @return an json object defining the equivalent json schema from the tosca for a given policy type + */ + public JsonObject getJsonSchemaForPolicyType(String policyType, ToscaMetadataParser toscaMetadataParser) + throws UnknownComponentException { + ToscaConverterToJsonSchema + toscaConverterToJsonSchema = new ToscaConverterToJsonSchema(toscaElements, jsonSchemaTemplates, + toscaMetadataParser); + if (toscaConverterToJsonSchema.getToscaElement(policyType) == null) { + throw new UnknownComponentException(policyType); + } + return toscaConverterToJsonSchema.getJsonSchemaOfToscaElement(policyType); + } + + /** + * Create and complete several Templates from file.properties. + * + * @param jsonTemplates The template properties as String + * @return a map + */ + @SuppressWarnings("unused") + private LinkedHashMap<String, JsonTemplate> initializeTemplates(String jsonTemplates) { + + LinkedHashMap<String, JsonTemplate> generatedTemplates = new LinkedHashMap<>(); + JsonObject templates = JsonUtils.GSON.fromJson(jsonTemplates, JsonObject.class); + + for (Map.Entry<String, JsonElement> templateAsJson : templates.entrySet()) { + JsonTemplate jsonTemplate = new JsonTemplate(templateAsJson.getKey()); + JsonObject templateBody = (JsonObject) templateAsJson.getValue(); + for (Map.Entry<String, JsonElement> field : templateBody.entrySet()) { + String fieldName = field.getKey(); + JsonObject bodyFieldAsJson = (JsonObject) field.getValue(); + Object fieldValue = bodyFieldAsJson.get("defaultValue").getAsString(); + Boolean fieldVisible = bodyFieldAsJson.get("visible").getAsBoolean(); + Boolean fieldStatic = bodyFieldAsJson.get("static").getAsBoolean(); + JsonTemplateField + bodyJsonTemplateField = new JsonTemplateField(fieldName, fieldValue, fieldVisible, fieldStatic); + jsonTemplate.getJsonTemplateFields().add(bodyJsonTemplateField); + } + generatedTemplates.put(jsonTemplate.getName(), jsonTemplate); + } + return generatedTemplates; + } + +} diff --git a/src/main/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilder.java b/src/main/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilder.java index 846b3ab2d..6cf342f2c 100755 --- a/src/main/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilder.java +++ b/src/main/java/org/onap/clamp/clds/util/drawing/ClampGraphBuilder.java @@ -88,7 +88,7 @@ public class ClampGraphBuilder { public ClampGraphBuilder addLoopElementModel(LoopElementModel loopElementModel) { if (LoopElementModel.MICRO_SERVICE_TYPE.equals(loopElementModel.getLoopElementType())) { microServices.add(new MicroServicePolicy(loopElementModel.getName(), - loopElementModel.getPolicyModels().first(), false, loopElementModel)); + loopElementModel.getPolicyModels().first(), false,null,loopElementModel,null,null)); } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(loopElementModel.getLoopElementType())) { policies.add(new OperationalPolicy(loopElementModel.getName(), null, null, loopElementModel.getPolicyModels().first(), loopElementModel, null, null)); diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java index 2bf3decd6..dd6fbf051 100644 --- a/src/main/java/org/onap/clamp/loop/Loop.java +++ b/src/main/java/org/onap/clamp/loop/Loop.java @@ -27,6 +27,7 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; +import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.HashSet; @@ -48,11 +49,11 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; -import org.apache.commons.lang3.RandomStringUtils; import org.hibernate.annotations.SortNatural; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; +import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; import org.onap.clamp.clds.util.drawing.SvgLoopGenerator; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.common.AuditEntity; @@ -63,7 +64,6 @@ import org.onap.clamp.loop.log.LoopLog; import org.onap.clamp.loop.service.Service; import org.onap.clamp.loop.template.LoopElementModel; import org.onap.clamp.loop.template.LoopTemplate; -import org.onap.clamp.policy.Policy; import org.onap.clamp.policy.microservice.MicroServicePolicy; import org.onap.clamp.policy.operational.OperationalPolicy; @@ -164,24 +164,29 @@ public class Loop extends AuditEntity implements Serializable { * @param name The loop name * @param loopTemplate The loop template from which a new loop instance must be created */ - public Loop(String name, LoopTemplate loopTemplate) { - this(name,""); + public Loop(String name, LoopTemplate loopTemplate, ToscaConverterWithDictionarySupport toscaConverter) { + this(name, ""); this.setLoopTemplate(loopTemplate); this.setModelService(loopTemplate.getModelService()); loopTemplate.getLoopElementModelsUsed().forEach(element -> { if (LoopElementModel.MICRO_SERVICE_TYPE.equals(element.getLoopElementModel().getLoopElementType())) { - this.addMicroServicePolicy(new MicroServicePolicy(Policy.generatePolicyName("MICROSERVICE_", - loopTemplate.getModelService().getName(),loopTemplate.getModelService().getVersion(), - RandomStringUtils.randomAlphanumeric(3),RandomStringUtils.randomAlphanumeric(3)), - element.getLoopElementModel().getPolicyModels().first(), false, element.getLoopElementModel())); - } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE + try { + this.addMicroServicePolicy((MicroServicePolicy) element.getLoopElementModel() + .createPolicyInstance(this, toscaConverter)); + } catch (IOException e) { + logger.error("Exception caught when creating the microservice policy instance of the loop " + + "instance", e); + } + } + else if (LoopElementModel.OPERATIONAL_POLICY_TYPE .equals(element.getLoopElementModel().getLoopElementType())) { - this.addOperationalPolicy(new OperationalPolicy(Policy.generatePolicyName("OPERATIONAL_", - loopTemplate.getModelService().getName(),loopTemplate.getModelService().getVersion(), - RandomStringUtils.randomAlphanumeric(3),RandomStringUtils.randomAlphanumeric(3)), null, - new JsonObject(), - element.getLoopElementModel().getPolicyModels().first(), element.getLoopElementModel(), - null,null)); + try { + this.addOperationalPolicy((OperationalPolicy) element.getLoopElementModel() + .createPolicyInstance(this, toscaConverter)); + } catch (IOException e) { + logger.error("Exception caught when creating the operational policy instance of the loop instance", + e); + } } }); } @@ -379,7 +384,8 @@ public class Loop extends AuditEntity implements Serializable { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } + else if (!name.equals(other.name)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java index 1a4ae5997..d230eb976 100644 --- a/src/main/java/org/onap/clamp/loop/LoopController.java +++ b/src/main/java/org/onap/clamp/loop/LoopController.java @@ -26,6 +26,7 @@ package org.onap.clamp.loop; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; +import java.io.IOException; import java.lang.reflect.Type; import java.util.List; import org.onap.clamp.clds.util.JsonUtils; @@ -105,7 +106,7 @@ public class LoopController { * @param policyVersion The policy model version * @return The loop modified */ - public Loop addOperationalPolicy(String loopName, String policyType, String policyVersion) { + public Loop addOperationalPolicy(String loopName, String policyType, String policyVersion) throws IOException { return loopService.addOperationalPolicy(loopName, policyType, policyVersion); } diff --git a/src/main/java/org/onap/clamp/loop/LoopService.java b/src/main/java/org/onap/clamp/loop/LoopService.java index 953a59471..acd125b78 100644 --- a/src/main/java/org/onap/clamp/loop/LoopService.java +++ b/src/main/java/org/onap/clamp/loop/LoopService.java @@ -24,14 +24,14 @@ package org.onap.clamp.loop; import com.google.gson.JsonObject; +import java.io.IOException; import java.util.List; import java.util.Set; import javax.persistence.EntityNotFoundException; -import org.apache.commons.lang3.RandomStringUtils; +import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; import org.onap.clamp.loop.template.LoopTemplatesService; import org.onap.clamp.loop.template.PolicyModel; import org.onap.clamp.loop.template.PolicyModelsService; -import org.onap.clamp.policy.Policy; import org.onap.clamp.policy.microservice.MicroServicePolicy; import org.onap.clamp.policy.microservice.MicroServicePolicyService; import org.onap.clamp.policy.operational.OperationalPolicy; @@ -57,6 +57,9 @@ public class LoopService { @Autowired private LoopTemplatesService loopTemplateService; + @Autowired + private ToscaConverterWithDictionarySupport toscaConverter; + Loop saveOrUpdateLoop(Loop loop) { return loopsRepository.save(loop); } @@ -76,12 +79,13 @@ public class LoopService { /** * Creates a Loop Instance from Loop Template Name. * - * @param loopName Name of the Loop to be created + * @param loopName Name of the Loop to be created * @param templateName Loop Template to used for Loop * @return Loop Instance */ public Loop createLoopFromTemplate(String loopName, String templateName) { - return loopsRepository.save(new Loop(loopName,loopTemplateService.getLoopTemplate(templateName))); + return loopsRepository + .save(new Loop(loopName, loopTemplateService.getLoopTemplate(templateName), toscaConverter)); } /** @@ -104,22 +108,21 @@ public class LoopService { /** * This method add an operational policy to a loop instance. + * This creates an operational policy from the policy model info and not the loop element model * - * @param loopName The loop name - * @param policyType The policy model type + * @param loopName The loop name + * @param policyType The policy model type * @param policyVersion The policy model version * @return The loop modified */ - Loop addOperationalPolicy(String loopName, String policyType, String policyVersion) { + Loop addOperationalPolicy(String loopName, String policyType, String policyVersion) throws IOException { Loop loop = getLoop(loopName); PolicyModel policyModel = policyModelsService.getPolicyModel(policyType, policyVersion); if (policyModel == null) { return null; } loop.addOperationalPolicy( - new OperationalPolicy(Policy.generatePolicyName("OPERATIONAL", loop.getModelService().getName(), - loop.getModelService().getVersion(), RandomStringUtils.randomAlphanumeric(3), - RandomStringUtils.randomAlphanumeric(4)), loop, null, policyModel, null, null, null)); + new OperationalPolicy(loop,loop.getModelService(), policyModel, toscaConverter)); return loopsRepository.saveAndFlush(loop); } diff --git a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java index b7ed1de9a..6db6d920f 100644 --- a/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java +++ b/src/main/java/org/onap/clamp/loop/service/CsarServiceInstaller.java @@ -27,9 +27,7 @@ package org.onap.clamp.loop.service; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; - import java.util.Map.Entry; - import org.onap.clamp.clds.client.CdsServices; import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; import org.onap.clamp.clds.model.cds.CdsBpWorkFlowListResponse; @@ -96,7 +94,8 @@ public class CsarServiceInstaller { if (SdcTypes.PNF == type || SdcTypes.VF == type) { JsonObject controllerProperties = createCdsArtifactProperties(nodeTemplate); if (controllerProperties != null) { - resourcesPropByType.getAsJsonObject(nodeTemplate.getName()).add("controllerProperties", controllerProperties); + resourcesPropByType.getAsJsonObject(nodeTemplate.getName()) + .add("controllerProperties", controllerProperties); } } } @@ -151,7 +150,8 @@ public class CsarServiceInstaller { Object artifactName = nodeTemplate.getPropertyValue("sdnc_model_name"); Object artifactVersion = nodeTemplate.getPropertyValue("sdnc_model_version"); if (artifactName != null && artifactVersion != null) { - CdsBpWorkFlowListResponse response = queryCdsToGetWorkFlowList(artifactName.toString(), artifactVersion.toString()); + CdsBpWorkFlowListResponse response = + queryCdsToGetWorkFlowList(artifactName.toString(), artifactVersion.toString()); if (response == null) { return null; } @@ -159,7 +159,7 @@ public class CsarServiceInstaller { JsonObject workFlowProps = new JsonObject(); for (String workFlow : response.getWorkflows()) { JsonObject inputs = queryCdsToGetWorkFlowInputProperties(response.getBlueprintName(), - response.getVersion(), workFlow); + response.getVersion(), workFlow); workFlowProps.add(workFlow, inputs); } @@ -176,7 +176,8 @@ public class CsarServiceInstaller { return cdsServices.getBlueprintWorkflowList(artifactName, artifactVersion); } - private JsonObject queryCdsToGetWorkFlowInputProperties(String artifactName, String artifactVersion, String workFlow) { + private JsonObject queryCdsToGetWorkFlowInputProperties(String artifactName, String artifactVersion, + String workFlow) { return cdsServices.getWorkflowInputProperties(artifactName, artifactVersion, workFlow); } } diff --git a/src/main/java/org/onap/clamp/loop/service/Service.java b/src/main/java/org/onap/clamp/loop/service/Service.java index 89c0b2d42..338032a16 100644 --- a/src/main/java/org/onap/clamp/loop/service/Service.java +++ b/src/main/java/org/onap/clamp/loop/service/Service.java @@ -27,15 +27,12 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; - import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; - import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; @@ -44,7 +41,7 @@ import org.onap.clamp.dao.model.jsontype.StringJsonUserType; @Entity @Table(name = "services") -@TypeDefs({ @TypeDef(name = "json", typeClass = StringJsonUserType.class) }) +@TypeDefs({@TypeDef(name = "json", typeClass = StringJsonUserType.class)}) public class Service implements Serializable { /** @@ -120,6 +117,8 @@ public class Service implements Serializable { } /** + * Name getter. + * * @return the name */ public String getName() { @@ -127,6 +126,8 @@ public class Service implements Serializable { } /** + * Version getter. + * * @return the version */ public String getVersion() { @@ -157,7 +158,8 @@ public class Service implements Serializable { if (other.serviceUuid != null) { return false; } - } else if (!serviceUuid.equals(other.serviceUuid)) { + } + else if (!serviceUuid.equals(other.serviceUuid)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java b/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java index 479605983..dfdfc42b3 100644 --- a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java +++ b/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java @@ -24,6 +24,7 @@ package org.onap.clamp.loop.template; import com.google.gson.annotations.Expose; +import java.io.IOException; import java.io.Serializable; import java.util.HashSet; import java.util.Set; @@ -40,7 +41,12 @@ import javax.persistence.ManyToMany; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.SortNatural; +import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; +import org.onap.clamp.loop.Loop; import org.onap.clamp.loop.common.AuditEntity; +import org.onap.clamp.policy.Policy; +import org.onap.clamp.policy.microservice.MicroServicePolicy; +import org.onap.clamp.policy.operational.OperationalPolicy; /** * This class represents a micro service/operational/... model for a loop template. @@ -241,6 +247,24 @@ public class LoopElementModel extends AuditEntity implements Serializable { this.blueprint = blueprint; } + /** + * Create a policy instance from the current loop element model. + * + * @return A Policy object. + * @throws IOException in case of failure when creating an operational policy + */ + public Policy createPolicyInstance(Loop loop, ToscaConverterWithDictionarySupport toscaConverter) + throws IOException { + if (LoopElementModel.MICRO_SERVICE_TYPE.equals(this.getLoopElementType())) { + return new MicroServicePolicy(loop, loop.getModelService(), this, toscaConverter); + } + else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) { + return new OperationalPolicy(loop, loop.getModelService(), this, toscaConverter); + } else { + return null; + } + } + @Override public int hashCode() { final int prime = 31; @@ -265,7 +289,8 @@ public class LoopElementModel extends AuditEntity implements Serializable { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } + else if (!name.equals(other.name)) { return false; } return true; 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 aeea55dbb..ae66c54b8 100644 --- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java +++ b/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java @@ -56,7 +56,7 @@ public class PolicyModelsService { * @return The Policy Model */ public PolicyModel saveOrUpdatePolicyModel(PolicyModel policyModel) { - return policyModelsRepository.save(policyModel); + return 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 c9055bf9d..3b2206461 100644 --- a/src/main/java/org/onap/clamp/policy/Policy.java +++ b/src/main/java/org/onap/clamp/policy/Policy.java @@ -30,7 +30,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; -import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Map; import javax.persistence.Column; @@ -44,9 +43,6 @@ import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.json.JSONObject; -import org.onap.clamp.clds.tosca.update.ToscaConverterManager; -import org.onap.clamp.clds.tosca.update.UnknownComponentException; -import org.onap.clamp.clds.util.ResourceFileUtil; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.common.AuditEntity; import org.onap.clamp.loop.template.LoopElementModel; @@ -286,23 +282,4 @@ public abstract class Policy extends AuditEntity { .append(blueprintFilename.replaceAll(".yaml", "")); return buffer.toString().replace('.', '_').replaceAll(" ", ""); } - - /** - * This method can be used to generate the json Schema used by the UI. - * - * @param policyToscaModel The tosca model as String that must be converted - * @param policyModelType The tosca model type (the policy_type entry in the tosca) that will used to create the - * json schema - * @return THe Json Schema as JsonObject - * @throws IOException In case of failure when opening the templates.json file - * @throws UnknownComponentException If the policyModelType is not found in the tosca model - */ - public static JsonObject generateJsonRepresentationFromToscaModel(String policyToscaModel, - String policyModelType) - throws IOException, UnknownComponentException { - return new ToscaConverterManager(policyToscaModel,ResourceFileUtil.getResourceAsString( - "clds/tosca_update/default-tosca-types.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")) - .startConversionToJson(policyModelType); - } } 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 b8093ccf1..321c12f6a 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java @@ -27,7 +27,6 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; -import java.io.IOException; import java.io.Serializable; import java.util.HashSet; import java.util.Set; @@ -38,11 +37,13 @@ import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; import javax.persistence.Transient; +import org.apache.commons.lang3.RandomStringUtils; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.tosca.update.UnknownComponentException; +import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.Loop; +import org.onap.clamp.loop.service.Service; import org.onap.clamp.loop.template.LoopElementModel; import org.onap.clamp.loop.template.PolicyModel; import org.onap.clamp.policy.Policy; @@ -91,31 +92,10 @@ public class MicroServicePolicy extends Policy implements Serializable { @Column(name = "dcae_blueprint_id") private String dcaeBlueprintId; - public MicroServicePolicy() { - // serialization - } - /** - * The constructor that creates the json representation from the policyTosca - * using the ToscaYamlToJsonConvertor. - * - * @param name The name of the MicroService - * @param policyModel The policy model of the MicroService - * @param shared The flag indicate whether the MicroService is shared + * Constructor for serialization. */ - public MicroServicePolicy(String name, PolicyModel policyModel, Boolean shared, LoopElementModel loopElementModel) { - this.name = name; - this.setPolicyModel(policyModel); - this.shared = shared; - try { - this.setJsonRepresentation( - Policy.generateJsonRepresentationFromToscaModel(policyModel.getPolicyModelTosca(), - policyModel.getPolicyModelType())); - } catch (UnknownComponentException | NullPointerException | IOException e) { - logger.error("Unable to generate the microservice policy Schema ... ", e); - this.setJsonRepresentation(new JsonObject()); - } - this.setLoopElementModel(loopElementModel); + public MicroServicePolicy() { } /** @@ -129,7 +109,7 @@ public class MicroServicePolicy extends Policy implements Serializable { * @param jsonRepresentation The UI representation in json format * @param loopElementModel The loop element model from which this instance should be created * @param pdpGroup The Pdp Group info - * @param pdpSubgroup The Pdp Subgrouop info + * @param pdpSubgroup The Pdp Subgroup info */ public MicroServicePolicy(String name, PolicyModel policyModel, Boolean shared, JsonObject jsonRepresentation, LoopElementModel loopElementModel, String pdpGroup, @@ -143,6 +123,25 @@ public class MicroServicePolicy extends Policy implements Serializable { this.setPdpSubgroup(pdpSubgroup); } + /** + * Constructor with tosca converter. + * + * @param loop The loop instance + * @param service The service model object + * @param loopElementModel The loop element model from which this microservice instance is created + * @param toscaConverter The tosca converter that will used to convert the tosca policy model + */ + public MicroServicePolicy(Loop loop, Service service, LoopElementModel loopElementModel, + ToscaConverterWithDictionarySupport toscaConverter) { + this(Policy.generatePolicyName("MICROSERVICE", service.getName(), service.getVersion(), + RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), + loopElementModel.getPolicyModels().first(), false, + toscaConverter.convertToscaToJsonSchemaObject( + loopElementModel.getPolicyModels().first().getPolicyModelTosca(), + loopElementModel.getPolicyModels().first().getPolicyModelType()), + loopElementModel, null, null); + } + @Override public String getName() { return name; 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 9cf516330..355a889e0 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -48,11 +48,13 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; +import org.apache.commons.lang3.RandomStringUtils; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; -import org.onap.clamp.clds.tosca.update.UnknownComponentException; +import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.Loop; +import org.onap.clamp.loop.service.Service; import org.onap.clamp.loop.template.LoopElementModel; import org.onap.clamp.loop.template.PolicyModel; import org.onap.clamp.policy.Policy; @@ -80,54 +82,101 @@ public class OperationalPolicy extends Policy implements Serializable { @JoinColumn(name = "loop_id", nullable = false) private Loop loop; + /** + * Constructor for serialization. + */ public OperationalPolicy() { - // Serialization } /** * The constructor. * * @param name The name of the operational policy - * @param loop The loop that uses this operational policy * @param configurationsJson The operational policy property in the format of * json + * @param jsonRepresentation The jsonObject defining the json schema * @param policyModel The policy model associated if any, can be null * @param loopElementModel The loop element from which this instance is supposed to be created * @param pdpGroup The Pdp Group info * @param pdpSubgroup The Pdp Subgroup info */ - public OperationalPolicy(String name, Loop loop, JsonObject configurationsJson, PolicyModel policyModel, + public OperationalPolicy(String name, JsonObject configurationsJson, + JsonObject jsonRepresentation, PolicyModel policyModel, LoopElementModel loopElementModel, String pdpGroup, String pdpSubgroup) { this.name = name; - this.loop = loop; this.setPolicyModel(policyModel); this.setConfigurationsJson(configurationsJson); this.setPdpGroup(pdpGroup); this.setPdpSubgroup(pdpSubgroup); this.setLoopElementModel(loopElementModel); - this.setJsonRepresentation(this.generateJsonRepresentation(policyModel)); + this.setJsonRepresentation(jsonRepresentation); + + } + /** + * Create an operational policy from a loop element model. + * + * @param loop The parent loop + * @param service The loop service + * @param loopElementModel The loop element 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, LoopElementModel loopElementModel, + ToscaConverterWithDictionarySupport toscaConverter) throws IOException { + this(Policy.generatePolicyName("OPERATIONAL", service.getName(), service.getVersion(), + RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), new JsonObject(), + new JsonObject(), loopElementModel.getPolicyModels().first(), loopElementModel, null, null); + this.setLoop(loop); + this.setJsonRepresentation(generateJsonRepresentation(this, toscaConverter)); + } + + /** + * 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 + * @throws IOException In case of issues with the legacy files (generated from resource files + */ + public OperationalPolicy(Loop loop, Service service, PolicyModel policyModel, + ToscaConverterWithDictionarySupport toscaConverter) throws IOException { + this(Policy.generatePolicyName("OPERATIONAL", service.getName(), service.getVersion(), + RandomStringUtils.randomAlphanumeric(3), RandomStringUtils.randomAlphanumeric(3)), new JsonObject(), + new JsonObject(), policyModel, null, null, null); + this.setLoop(loop); + this.setJsonRepresentation(generateJsonRepresentation(this, toscaConverter)); } - private JsonObject generateJsonRepresentation(PolicyModel policyModel) { + /** + * This method can generate a Json representation (json schema) for an operational policy. + * This is mainly to support a legacy case and a generic case. + * + * @param operationalPolicy The operational policy + * @param toscaConverter The tosca converter + * @return The Json Object with Json schema + */ + public static JsonObject generateJsonRepresentation(OperationalPolicy operationalPolicy, + ToscaConverterWithDictionarySupport toscaConverter) + throws IOException { JsonObject jsonReturned = new JsonObject(); - if (policyModel == null) { + if (operationalPolicy.getPolicyModel() == null) { return new JsonObject(); } - try { - if (isLegacy()) { - // Op policy Legacy case - LegacyOperationalPolicy.preloadConfiguration(jsonReturned, loop); - jsonReturned = - OperationalPolicyRepresentationBuilder.generateOperationalPolicySchema(loop.getModelService()); - } else { - // Generic Case - jsonReturned = Policy.generateJsonRepresentationFromToscaModel(policyModel.getPolicyModelTosca(), - policyModel.getPolicyModelType()); - } - } catch (UnknownComponentException | IOException | NullPointerException e) { - logger.error("Unable to generate the operational policy Schema ... ", e); + if (operationalPolicy.isLegacy()) { + // Op policy Legacy case + LegacyOperationalPolicy.preloadConfiguration(jsonReturned, operationalPolicy.loop); + jsonReturned = OperationalPolicyRepresentationBuilder + .generateOperationalPolicySchema(operationalPolicy.loop.getModelService()); + } + else { + // Generic Case + jsonReturned = toscaConverter.convertToscaToJsonSchemaObject( + operationalPolicy.getPolicyModel().getPolicyModelTosca(), + operationalPolicy.getPolicyModel().getPolicyModelType()); } + return jsonReturned; } @@ -178,7 +227,8 @@ public class OperationalPolicy extends Policy implements Serializable { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } + else if (!name.equals(other.name)) { return false; } return true; @@ -243,7 +293,8 @@ public class OperationalPolicy extends Policy implements Serializable { String opPayload = new GsonBuilder().setPrettyPrinting().create().toJson(payload); logger.info("Operational policy payload: " + opPayload); return opPayload; - } else { + } + else { return super.createPolicyPayload(); } } @@ -261,7 +312,7 @@ public class OperationalPolicy extends Policy implements Serializable { if (guardsList != null) { for (JsonElement guardElem : guardsList.getAsJsonArray()) { result.put(guardElem.getAsJsonObject().get("policy-id").getAsString(), - new GsonBuilder().create().toJson(guardElem)); + new GsonBuilder().create().toJson(guardElem)); } } } 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 244f4c27a..0298cfde7 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java @@ -28,10 +28,8 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; - import java.io.IOException; import java.util.Map.Entry; - import org.onap.clamp.clds.util.JsonUtils; import org.onap.clamp.clds.util.ResourceFileUtil; import org.onap.clamp.loop.service.Service; @@ -79,7 +77,7 @@ public class OperationalPolicyRepresentationBuilder { } private static JsonObject createSchemaProperty(String title, String type, String defaultValue, String readOnlyFlag, - String[] enumArray) { + String[] enumArray) { JsonObject property = new JsonObject(); property.addProperty("title", title); property.addProperty("type", type); @@ -128,8 +126,9 @@ public class OperationalPolicyRepresentationBuilder { modelVfModules.get(entry.getKey()).getAsJsonObject().get("vfModuleModelName").getAsString(), "True", null)); properties.add("modelInvariantId", - createSchemaProperty("Model Invariant Id (ModelInvariantUUID)", "string", modelVfModules - .get(entry.getKey()).getAsJsonObject().get("vfModuleModelInvariantUUID").getAsString(), + createSchemaProperty("Model Invariant Id (ModelInvariantUUID)", "string", + modelVfModules.get(entry.getKey()).getAsJsonObject().get("vfModuleModelInvariantUUID") + .getAsString(), "True", null)); properties.add("modelVersionId", createSchemaProperty("Model Version Id (ModelUUID)", "string", @@ -144,8 +143,9 @@ public class OperationalPolicyRepresentationBuilder { "True", null)); properties .add("modelCustomizationId", - createSchemaProperty("Customization ID", "string", modelVfModules.get(entry.getKey()) - .getAsJsonObject().get("vfModuleModelCustomizationUUID").getAsString(), "True", + createSchemaProperty("Customization ID", "string", + modelVfModules.get(entry.getKey()).getAsJsonObject() + .get("vfModuleModelCustomizationUUID").getAsString(), "True", null)); vfModuleOneOfSchema.add("properties", properties); @@ -180,7 +180,7 @@ public class OperationalPolicyRepresentationBuilder { JsonObject obj = new JsonObject(); obj.addProperty("title", workflowsEntry.getKey()); obj.add("properties", createPayloadProperty(workflowsEntry.getValue().getAsJsonObject(), - controllerProperties)); + controllerProperties)); schemaArray.add(obj); } @@ -207,7 +207,8 @@ public class OperationalPolicyRepresentationBuilder { StringBuilder builder = new StringBuilder("'").append("artifact_name : ").append(artifactName).append("\n") .append("artifact_version : ").append(artifactVersion).append("\n") .append("mode : async").append("\n") - .append("data : ").append("'").append("\\").append("'").append(data).append("\\").append("'").append("'"); + .append("data : ").append("'").append("\\").append("'").append(data).append("\\").append("'") + .append("'"); return builder.toString(); } } diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index 29082abf1..0451f1e0d 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -444,236 +444,280 @@ 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="#_route61">2.1. GET /v1/healthcheck</a> +<li><a href="#_route36">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="#_route62">2.2. GET /v1/user/getUser</a> +<li><a href="#_route37">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="#_route49">2.3. GET /v2/dictionary</a> +<li><a href="#_route35">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="#_route51">2.4. PUT /v2/dictionary</a> +<li><a href="#_route21">2.4. GET /v2/dictionary</a> <ul class="sectlevel3"> -<li><a href="#_parameters">2.4.1. Parameters</a></li> -<li><a href="#_responses_4">2.4.2. Responses</a></li> -<li><a href="#_consumes">2.4.3. Consumes</a></li> -<li><a href="#_produces_4">2.4.4. Produces</a></li> +<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="#_v2_dictionary_secondary_names_get">2.5. GET /v2/dictionary/secondary/names</a> +<li><a href="#_route23">2.5. PUT /v2/dictionary</a> <ul class="sectlevel3"> -<li><a href="#_responses_5">2.5.1. Responses</a></li> -<li><a href="#_produces_5">2.5.2. Produces</a></li> +<li><a href="#_parameters">2.5.1. Parameters</a></li> +<li><a href="#_responses_5">2.5.2. Responses</a></li> +<li><a href="#_consumes">2.5.3. Consumes</a></li> +<li><a href="#_produces_5">2.5.4. Produces</a></li> </ul> </li> -<li><a href="#_v2_dictionary_dictionaryname_get">2.6. GET /v2/dictionary/{dictionaryName}</a> +<li><a href="#_v2_dictionary_secondary_names_get">2.6. GET /v2/dictionary/secondary/names</a> <ul class="sectlevel3"> -<li><a href="#_parameters_2">2.6.1. Parameters</a></li> -<li><a href="#_responses_6">2.6.2. Responses</a></li> -<li><a href="#_produces_6">2.6.3. Produces</a></li> +<li><a href="#_responses_6">2.6.1. Responses</a></li> +<li><a href="#_produces_6">2.6.2. Produces</a></li> </ul> </li> -<li><a href="#_v2_dictionary_name_put">2.7. PUT /v2/dictionary/{name}</a> +<li><a href="#_v2_dictionary_dictionaryname_get">2.7. GET /v2/dictionary/{dictionaryName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_3">2.7.1. Parameters</a></li> +<li><a href="#_parameters_2">2.7.1. Parameters</a></li> <li><a href="#_responses_7">2.7.2. Responses</a></li> -<li><a href="#_consumes_2">2.7.3. Consumes</a></li> -<li><a href="#_produces_7">2.7.4. Produces</a></li> +<li><a href="#_produces_7">2.7.3. Produces</a></li> </ul> </li> -<li><a href="#_route53">2.8. DELETE /v2/dictionary/{name}</a> +<li><a href="#_v2_dictionary_name_put">2.8. PUT /v2/dictionary/{name}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_4">2.8.1. Parameters</a></li> +<li><a href="#_parameters_3">2.8.1. Parameters</a></li> <li><a href="#_responses_8">2.8.2. Responses</a></li> -<li><a href="#_produces_8">2.8.3. Produces</a></li> +<li><a href="#_consumes_2">2.8.3. Consumes</a></li> +<li><a href="#_produces_8">2.8.4. Produces</a></li> </ul> </li> -<li><a href="#_v2_dictionary_name_elements_shortname_delete">2.9. DELETE /v2/dictionary/{name}/elements/{shortName}</a> +<li><a href="#_route25">2.9. DELETE /v2/dictionary/{name}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_5">2.9.1. Parameters</a></li> +<li><a href="#_parameters_4">2.9.1. Parameters</a></li> <li><a href="#_responses_9">2.9.2. Responses</a></li> <li><a href="#_produces_9">2.9.3. Produces</a></li> </ul> </li> -<li><a href="#_route45">2.10. PUT /v2/loop/delete/{loopName}</a> +<li><a href="#_v2_dictionary_name_elements_shortname_delete">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_6">2.10.1. Parameters</a></li> +<li><a href="#_parameters_5">2.10.1. Parameters</a></li> <li><a href="#_responses_10">2.10.2. Responses</a></li> +<li><a href="#_produces_10">2.10.3. Produces</a></li> </ul> </li> -<li><a href="#_route39">2.11. PUT /v2/loop/deploy/{loopName}</a> +<li><a href="#_route16">2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_7">2.11.1. Parameters</a></li> +<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_10">2.11.3. Produces</a></li> +<li><a href="#_produces_11">2.11.3. Produces</a></li> </ul> </li> -<li><a href="#_route33">2.12. GET /v2/loop/getAllNames</a> +<li><a href="#_route18">2.12. POST /v2/loop/create/{loopName}?templateName={templateName}</a> <ul class="sectlevel3"> -<li><a href="#_responses_12">2.12.1. Responses</a></li> -<li><a href="#_produces_11">2.12.2. Produces</a></li> +<li><a href="#_parameters_7">2.12.1. Parameters</a></li> +<li><a href="#_responses_12">2.12.2. Responses</a></li> +<li><a href="#_consumes_3">2.12.3. Consumes</a></li> +<li><a href="#_produces_12">2.12.4. Produces</a></li> </ul> </li> -<li><a href="#_route46">2.13. GET /v2/loop/getstatus/{loopName}</a> +<li><a href="#_route14">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> -<li><a href="#_produces_12">2.13.3. Produces</a></li> </ul> </li> -<li><a href="#_route40">2.14. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}</a> +<li><a href="#_route8">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="#_route43">2.15. PUT /v2/loop/restart/{loopName}</a> +<li><a href="#_route2">2.15. GET /v2/loop/getAllNames</a> <ul class="sectlevel3"> -<li><a href="#_parameters_10">2.15.1. Parameters</a></li> -<li><a href="#_responses_15">2.15.2. Responses</a></li> -<li><a href="#_produces_14">2.15.3. Produces</a></li> +<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="#_route42">2.16. PUT /v2/loop/stop/{loopName}</a> +<li><a href="#_route15">2.16. GET /v2/loop/getstatus/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_11">2.16.1. Parameters</a></li> +<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="#_route44">2.17. PUT /v2/loop/submit/{loopName}</a> +<li><a href="#_route9">2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_12">2.17.1. Parameters</a></li> +<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="#_route35">2.18. GET /v2/loop/svgRepresentation/{loopName}</a> +<li><a href="#_route17">2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_13">2.18.1. Parameters</a></li> +<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="#_route41">2.19. PUT /v2/loop/undeploy/{loopName}</a> +<li><a href="#_route12">2.19. PUT /v2/loop/restart/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_14">2.19.1. Parameters</a></li> +<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="#_route36">2.20. POST /v2/loop/updateGlobalProperties/{loopName}</a> +<li><a href="#_route11">2.20. PUT /v2/loop/stop/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_15">2.20.1. Parameters</a></li> +<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="#_consumes_3">2.20.3. Consumes</a></li> -<li><a href="#_produces_19">2.20.4. Produces</a></li> +<li><a href="#_produces_19">2.20.3. Produces</a></li> </ul> </li> -<li><a href="#_route38">2.21. POST /v2/loop/updateMicroservicePolicy/{loopName}</a> +<li><a href="#_route13">2.21. PUT /v2/loop/submit/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_16">2.21.1. Parameters</a></li> +<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="#_consumes_4">2.21.3. Consumes</a></li> -<li><a href="#_produces_20">2.21.4. Produces</a></li> +<li><a href="#_produces_20">2.21.3. Produces</a></li> </ul> </li> -<li><a href="#_route37">2.22. POST /v2/loop/updateOperationalPolicies/{loopName}</a> +<li><a href="#_route4">2.22. GET /v2/loop/svgRepresentation/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_17">2.22.1. Parameters</a></li> +<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="#_consumes_5">2.22.3. Consumes</a></li> -<li><a href="#_produces_21">2.22.4. Produces</a></li> +<li><a href="#_produces_21">2.22.3. Produces</a></li> </ul> </li> -<li><a href="#_route34">2.23. GET /v2/loop/{loopName}</a> +<li><a href="#_route10">2.23. PUT /v2/loop/undeploy/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_18">2.23.1. Parameters</a></li> +<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="#_route56">2.24. GET /v2/policyToscaModels</a> +<li><a href="#_route5">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a> <ul class="sectlevel3"> -<li><a href="#_responses_24">2.24.1. Responses</a></li> -<li><a href="#_produces_23">2.24.2. Produces</a></li> +<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> </ul> </li> -<li><a href="#_v2_policytoscamodels_yaml_policymodeltype_get">2.25. GET /v2/policyToscaModels/yaml/{policyModelType}</a> +<li><a href="#_route7">2.25. POST /v2/loop/updateMicroservicePolicy/{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="#_produces_24">2.25.3. Produces</a></li> +<li><a href="#_consumes_5">2.25.3. Consumes</a></li> +<li><a href="#_produces_24">2.25.4. Produces</a></li> </ul> </li> -<li><a href="#_v2_policytoscamodels_policymodeltype_get">2.26. GET /v2/policyToscaModels/{policyModelType}</a> +<li><a href="#_route6">2.26. POST /v2/loop/updateOperationalPolicies/{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="#_produces_25">2.26.3. Produces</a></li> +<li><a href="#_consumes_6">2.26.3. Consumes</a></li> +<li><a href="#_produces_25">2.26.4. Produces</a></li> </ul> </li> -<li><a href="#_route57">2.27. PUT /v2/policyToscaModels/{policyModelType}</a> +<li><a href="#_route3">2.27. GET /v2/loop/{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="#_consumes_6">2.27.3. Consumes</a></li> -<li><a href="#_produces_26">2.27.4. Produces</a></li> +<li><a href="#_produces_26">2.27.3. Produces</a></li> </ul> </li> -<li><a href="#_route60">2.28. GET /v2/templates</a> +<li><a href="#_route29">2.28. POST /v2/policyToscaModels</a> <ul class="sectlevel3"> -<li><a href="#_responses_28">2.28.1. Responses</a></li> -<li><a href="#_produces_27">2.28.2. Produces</a></li> +<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> </ul> </li> -<li><a href="#_v2_templates_names_get">2.29. GET /v2/templates/names</a> +<li><a href="#_route28">2.29. GET /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> </ul> </li> -<li><a href="#_v2_templates_templatename_get">2.30. GET /v2/templates/{templateName}</a> +<li><a href="#_v2_policytoscamodels_yaml_policymodeltype_policymodelversion_get">2.30. GET /v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}</a> <ul class="sectlevel3"> -<li><a href="#_parameters_22">2.30.1. Parameters</a></li> +<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> </ul> </li> +<li><a href="#_v2_policytoscamodels_policymodeltype_policymodelversion_get">2.31. GET /v2/policyToscaModels/{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="#_route30">2.32. PUT /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> +</ul> +</li> +<li><a href="#_route34">2.33. GET /v2/templates</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> +</ul> +</li> +<li><a href="#_v2_templates_names_get">2.34. GET /v2/templates/names</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> +<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> +</ul> +</li> +<li><a href="#_v2_templates_templatename_svgrepresentation_get">2.36. GET /v2/templates/{templateName}/svgRepresentation</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> </ul> </li> <li><a href="#_definitions">3. Definitions</a> <ul class="sectlevel2"> -<li><a href="#_cldshealthcheck">3.1. CldsHealthCheck</a></li> -<li><a href="#_dictionary">3.2. Dictionary</a></li> -<li><a href="#_dictionaryelement">3.3. DictionaryElement</a></li> -<li><a href="#_externalcomponent">3.4. ExternalComponent</a></li> -<li><a href="#_externalcomponentstate">3.5. ExternalComponentState</a></li> -<li><a href="#_jsonarray">3.6. JsonArray</a></li> -<li><a href="#_jsonnull">3.7. JsonNull</a></li> -<li><a href="#_jsonobject">3.8. JsonObject</a></li> -<li><a href="#_jsonprimitive">3.9. JsonPrimitive</a></li> -<li><a href="#_loop">3.10. Loop</a></li> -<li><a href="#_loopelementmodel">3.11. LoopElementModel</a></li> -<li><a href="#_looplog">3.12. LoopLog</a></li> -<li><a href="#_looptemplate">3.13. LoopTemplate</a></li> -<li><a href="#_looptemplateloopelementmodel">3.14. LoopTemplateLoopElementModel</a></li> -<li><a href="#_microservicepolicy">3.15. MicroServicePolicy</a></li> -<li><a href="#_number">3.16. Number</a></li> -<li><a href="#_operationalpolicy">3.17. OperationalPolicy</a></li> -<li><a href="#_policymodel">3.18. PolicyModel</a></li> -<li><a href="#_service">3.19. Service</a></li> +<li><a href="#_clampinformation">3.1. ClampInformation</a></li> +<li><a href="#_cldshealthcheck">3.2. CldsHealthCheck</a></li> +<li><a href="#_dictionary">3.3. Dictionary</a></li> +<li><a href="#_dictionaryelement">3.4. DictionaryElement</a></li> +<li><a href="#_externalcomponent">3.5. ExternalComponent</a></li> +<li><a href="#_externalcomponentstate">3.6. ExternalComponentState</a></li> +<li><a href="#_jsonarray">3.7. JsonArray</a></li> +<li><a href="#_jsonnull">3.8. JsonNull</a></li> +<li><a href="#_jsonobject">3.9. JsonObject</a></li> +<li><a href="#_jsonprimitive">3.10. JsonPrimitive</a></li> +<li><a href="#_loop">3.11. Loop</a></li> +<li><a href="#_loopelementmodel">3.12. LoopElementModel</a></li> +<li><a href="#_looplog">3.13. LoopLog</a></li> +<li><a href="#_looptemplate">3.14. LoopTemplate</a></li> +<li><a href="#_looptemplateloopelementmodel">3.15. LoopTemplateLoopElementModel</a></li> +<li><a href="#_microservicepolicy">3.16. MicroServicePolicy</a></li> +<li><a href="#_number">3.17. Number</a></li> +<li><a href="#_operationalpolicy">3.18. OperationalPolicy</a></li> +<li><a href="#_policymodel">3.19. PolicyModel</a></li> +<li><a href="#_service">3.20. Service</a></li> </ul> </li> </ul> @@ -692,7 +736,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:46347<br> +<p><em>Host</em> : localhost:41607<br> <em>BasePath</em> : /restservices/clds/<br> <em>Schemes</em> : HTTP</p> </div> @@ -703,7 +747,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="_route61"><a class="anchor" href="#_route61"></a><a class="link" href="#_route61">2.1. GET /v1/healthcheck</a></h3> +<h3 id="_route36"><a class="anchor" href="#_route36"></a><a class="link" href="#_route36">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"> @@ -740,7 +784,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route62"><a class="anchor" href="#_route62"></a><a class="link" href="#_route62">2.2. GET /v1/user/getUser</a></h3> +<h3 id="_route37"><a class="anchor" href="#_route37"></a><a class="link" href="#_route37">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"> @@ -774,7 +818,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route49"><a class="anchor" href="#_route49"></a><a class="link" href="#_route49">2.3. GET /v2/dictionary</a></h3> +<h3 id="_route35"><a class="anchor" href="#_route35"></a><a class="link" href="#_route35">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"> @@ -794,7 +838,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="#_dictionary">Dictionary</a></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_clampinformation">ClampInformation</a></p></td> </tr> </tbody> </table> @@ -811,9 +855,46 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route51"><a class="anchor" href="#_route51"></a><a class="link" href="#_route51">2.4. PUT /v2/dictionary</a></h3> +<h3 id="_route21"><a class="anchor" href="#_route21"></a><a class="link" href="#_route21">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"> +<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="#_dictionary">Dictionary</a></p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_produces_4"><a class="anchor" href="#_produces_4"></a><a class="link" href="#_produces_4">2.4.2. Produces</a></h4> +<div class="ulist"> +<ul> +<li> +<p><code>application/json</code></p> +</li> +</ul> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_route23"><a class="anchor" href="#_route23"></a><a class="link" href="#_route23">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.4.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -838,7 +919,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_4"><a class="anchor" href="#_responses_4"></a><a class="link" href="#_responses_4">2.4.2. Responses</a></h4> +<h4 id="_responses_5"><a class="anchor" href="#_responses_5"></a><a class="link" href="#_responses_5">2.5.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -862,7 +943,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"><a class="anchor" href="#_consumes"></a><a class="link" href="#_consumes">2.4.3. Consumes</a></h4> +<h4 id="_consumes"><a class="anchor" href="#_consumes"></a><a class="link" href="#_consumes">2.5.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -872,7 +953,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_4"><a class="anchor" href="#_produces_4"></a><a class="link" href="#_produces_4">2.4.4. Produces</a></h4> +<h4 id="_produces_5"><a class="anchor" href="#_produces_5"></a><a class="link" href="#_produces_5">2.5.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -883,9 +964,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_dictionary_secondary_names_get"><a class="anchor" href="#_v2_dictionary_secondary_names_get"></a><a class="link" href="#_v2_dictionary_secondary_names_get">2.5. GET /v2/dictionary/secondary/names</a></h3> +<h3 id="_v2_dictionary_secondary_names_get"><a class="anchor" href="#_v2_dictionary_secondary_names_get"></a><a class="link" href="#_v2_dictionary_secondary_names_get">2.6. GET /v2/dictionary/secondary/names</a></h3> <div class="sect3"> -<h4 id="_responses_5"><a class="anchor" href="#_responses_5"></a><a class="link" href="#_responses_5">2.5.1. Responses</a></h4> +<h4 id="_responses_6"><a class="anchor" href="#_responses_6"></a><a class="link" href="#_responses_6">2.6.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -909,7 +990,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_5"><a class="anchor" href="#_produces_5"></a><a class="link" href="#_produces_5">2.5.2. Produces</a></h4> +<h4 id="_produces_6"><a class="anchor" href="#_produces_6"></a><a class="link" href="#_produces_6">2.6.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -920,9 +1001,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_dictionary_dictionaryname_get"><a class="anchor" href="#_v2_dictionary_dictionaryname_get"></a><a class="link" href="#_v2_dictionary_dictionaryname_get">2.6. GET /v2/dictionary/{dictionaryName}</a></h3> +<h3 id="_v2_dictionary_dictionaryname_get"><a class="anchor" href="#_v2_dictionary_dictionaryname_get"></a><a class="link" href="#_v2_dictionary_dictionaryname_get">2.7. GET /v2/dictionary/{dictionaryName}</a></h3> <div class="sect3"> -<h4 id="_parameters_2"><a class="anchor" href="#_parameters_2"></a><a class="link" href="#_parameters_2">2.6.1. Parameters</a></h4> +<h4 id="_parameters_2"><a class="anchor" href="#_parameters_2"></a><a class="link" href="#_parameters_2">2.7.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -947,7 +1028,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_6"><a class="anchor" href="#_responses_6"></a><a class="link" href="#_responses_6">2.6.2. Responses</a></h4> +<h4 id="_responses_7"><a class="anchor" href="#_responses_7"></a><a class="link" href="#_responses_7">2.7.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -971,7 +1052,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_6"><a class="anchor" href="#_produces_6"></a><a class="link" href="#_produces_6">2.6.3. Produces</a></h4> +<h4 id="_produces_7"><a class="anchor" href="#_produces_7"></a><a class="link" href="#_produces_7">2.7.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -982,9 +1063,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_dictionary_name_put"><a class="anchor" href="#_v2_dictionary_name_put"></a><a class="link" href="#_v2_dictionary_name_put">2.7. PUT /v2/dictionary/{name}</a></h3> +<h3 id="_v2_dictionary_name_put"><a class="anchor" href="#_v2_dictionary_name_put"></a><a class="link" href="#_v2_dictionary_name_put">2.8. PUT /v2/dictionary/{name}</a></h3> <div class="sect3"> -<h4 id="_parameters_3"><a class="anchor" href="#_parameters_3"></a><a class="link" href="#_parameters_3">2.7.1. Parameters</a></h4> +<h4 id="_parameters_3"><a class="anchor" href="#_parameters_3"></a><a class="link" href="#_parameters_3">2.8.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -1015,7 +1096,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_7"><a class="anchor" href="#_responses_7"></a><a class="link" href="#_responses_7">2.7.2. Responses</a></h4> +<h4 id="_responses_8"><a class="anchor" href="#_responses_8"></a><a class="link" href="#_responses_8">2.8.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1039,7 +1120,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_2"><a class="anchor" href="#_consumes_2"></a><a class="link" href="#_consumes_2">2.7.3. Consumes</a></h4> +<h4 id="_consumes_2"><a class="anchor" href="#_consumes_2"></a><a class="link" href="#_consumes_2">2.8.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1049,7 +1130,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_7"><a class="anchor" href="#_produces_7"></a><a class="link" href="#_produces_7">2.7.4. Produces</a></h4> +<h4 id="_produces_8"><a class="anchor" href="#_produces_8"></a><a class="link" href="#_produces_8">2.8.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1060,9 +1141,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route53"><a class="anchor" href="#_route53"></a><a class="link" href="#_route53">2.8. DELETE /v2/dictionary/{name}</a></h3> +<h3 id="_route25"><a class="anchor" href="#_route25"></a><a class="link" href="#_route25">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.8.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1087,7 +1168,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_8"><a class="anchor" href="#_responses_8"></a><a class="link" href="#_responses_8">2.8.2. Responses</a></h4> +<h4 id="_responses_9"><a class="anchor" href="#_responses_9"></a><a class="link" href="#_responses_9">2.9.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 33.3333%;"> @@ -1108,7 +1189,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_8"><a class="anchor" href="#_produces_8"></a><a class="link" href="#_produces_8">2.8.3. Produces</a></h4> +<h4 id="_produces_9"><a class="anchor" href="#_produces_9"></a><a class="link" href="#_produces_9">2.9.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1119,9 +1200,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_dictionary_name_elements_shortname_delete"><a class="anchor" href="#_v2_dictionary_name_elements_shortname_delete"></a><a class="link" href="#_v2_dictionary_name_elements_shortname_delete">2.9. DELETE /v2/dictionary/{name}/elements/{shortName}</a></h3> +<h3 id="_v2_dictionary_name_elements_shortname_delete"><a class="anchor" href="#_v2_dictionary_name_elements_shortname_delete"></a><a class="link" href="#_v2_dictionary_name_elements_shortname_delete">2.10. DELETE /v2/dictionary/{name}/elements/{shortName}</a></h3> <div class="sect3"> -<h4 id="_parameters_5"><a class="anchor" href="#_parameters_5"></a><a class="link" href="#_parameters_5">2.9.1. Parameters</a></h4> +<h4 id="_parameters_5"><a class="anchor" href="#_parameters_5"></a><a class="link" href="#_parameters_5">2.10.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -1152,7 +1233,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_9"><a class="anchor" href="#_responses_9"></a><a class="link" href="#_responses_9">2.9.2. Responses</a></h4> +<h4 id="_responses_10"><a class="anchor" href="#_responses_10"></a><a class="link" href="#_responses_10">2.10.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 33.3333%;"> @@ -1173,7 +1254,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_9"><a class="anchor" href="#_produces_9"></a><a class="link" href="#_produces_9">2.9.3. Produces</a></h4> +<h4 id="_produces_10"><a class="anchor" href="#_produces_10"></a><a class="link" href="#_produces_10">2.10.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1184,9 +1265,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route45"><a class="anchor" href="#_route45"></a><a class="link" href="#_route45">2.10. PUT /v2/loop/delete/{loopName}</a></h3> +<h3 id="_route16"><a class="anchor" href="#_route16"></a><a class="link" href="#_route16">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.10.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1207,11 +1288,157 @@ 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> <div class="sect3"> -<h4 id="_responses_10"><a class="anchor" href="#_responses_10"></a><a class="link" href="#_responses_10">2.10.2. Responses</a></h4> +<h4 id="_responses_11"><a class="anchor" href="#_responses_11"></a><a class="link" href="#_responses_11">2.11.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_11"><a class="anchor" href="#_produces_11"></a><a class="link" href="#_produces_11">2.11.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="_route18"><a class="anchor" href="#_route18"></a><a class="link" href="#_route18">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"> +<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}?templateName={templateName</strong><br> +<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_12"><a class="anchor" href="#_responses_12"></a><a class="link" href="#_responses_12">2.12.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="_consumes_3"><a class="anchor" href="#_consumes_3"></a><a class="link" href="#_consumes_3">2.12.3. Consumes</a></h4> +<div class="ulist"> +<ul> +<li> +<p><code>application/json</code></p> +</li> +</ul> +</div> +</div> +<div class="sect3"> +<h4 id="_produces_12"><a class="anchor" href="#_produces_12"></a><a class="link" href="#_produces_12">2.12.4. Produces</a></h4> +<div class="ulist"> +<ul> +<li> +<p><code>application/json</code></p> +</li> +</ul> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_route14"><a class="anchor" href="#_route14"></a><a class="link" href="#_route14">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"> +<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> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_responses_13"><a class="anchor" href="#_responses_13"></a><a class="link" href="#_responses_13">2.13.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 33.3333%;"> @@ -1233,9 +1460,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route39"><a class="anchor" href="#_route39"></a><a class="link" href="#_route39">2.11. PUT /v2/loop/deploy/{loopName}</a></h3> +<h3 id="_route8"><a class="anchor" href="#_route8"></a><a class="link" href="#_route8">2.14. PUT /v2/loop/deploy/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_7"><a class="anchor" href="#_parameters_7"></a><a class="link" href="#_parameters_7">2.11.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1260,7 +1487,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_11"><a class="anchor" href="#_responses_11"></a><a class="link" href="#_responses_11">2.11.2. Responses</a></h4> +<h4 id="_responses_14"><a class="anchor" href="#_responses_14"></a><a class="link" href="#_responses_14">2.14.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1284,7 +1511,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_10"><a class="anchor" href="#_produces_10"></a><a class="link" href="#_produces_10">2.11.3. Produces</a></h4> +<h4 id="_produces_13"><a class="anchor" href="#_produces_13"></a><a class="link" href="#_produces_13">2.14.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1295,9 +1522,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route33"><a class="anchor" href="#_route33"></a><a class="link" href="#_route33">2.12. GET /v2/loop/getAllNames</a></h3> +<h3 id="_route2"><a class="anchor" href="#_route2"></a><a class="link" href="#_route2">2.15. GET /v2/loop/getAllNames</a></h3> <div class="sect3"> -<h4 id="_responses_12"><a class="anchor" href="#_responses_12"></a><a class="link" href="#_responses_12">2.12.1. Responses</a></h4> +<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"> <colgroup> <col style="width: 10%;"> @@ -1321,7 +1548,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_11"><a class="anchor" href="#_produces_11"></a><a class="link" href="#_produces_11">2.12.2. Produces</a></h4> +<h4 id="_produces_14"><a class="anchor" href="#_produces_14"></a><a class="link" href="#_produces_14">2.15.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1332,9 +1559,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route46"><a class="anchor" href="#_route46"></a><a class="link" href="#_route46">2.13. GET /v2/loop/getstatus/{loopName}</a></h3> +<h3 id="_route15"><a class="anchor" href="#_route15"></a><a class="link" href="#_route15">2.16. GET /v2/loop/getstatus/{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> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1359,7 +1586,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_13"><a class="anchor" href="#_responses_13"></a><a class="link" href="#_responses_13">2.13.2. Responses</a></h4> +<h4 id="_responses_16"><a class="anchor" href="#_responses_16"></a><a class="link" href="#_responses_16">2.16.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1383,7 +1610,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_12"><a class="anchor" href="#_produces_12"></a><a class="link" href="#_produces_12">2.13.3. Produces</a></h4> +<h4 id="_produces_15"><a class="anchor" href="#_produces_15"></a><a class="link" href="#_produces_15">2.16.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1394,9 +1621,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route40"><a class="anchor" href="#_route40"></a><a class="link" href="#_route40">2.14. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}</a></h3> +<h3 id="_route9"><a class="anchor" href="#_route9"></a><a class="link" href="#_route9">2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{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> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1421,7 +1648,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_14"><a class="anchor" href="#_responses_14"></a><a class="link" href="#_responses_14">2.14.2. Responses</a></h4> +<h4 id="_responses_17"><a class="anchor" href="#_responses_17"></a><a class="link" href="#_responses_17">2.17.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1445,7 +1672,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_13"><a class="anchor" href="#_produces_13"></a><a class="link" href="#_produces_13">2.14.3. Produces</a></h4> +<h4 id="_produces_16"><a class="anchor" href="#_produces_16"></a><a class="link" href="#_produces_16">2.17.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1456,9 +1683,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route43"><a class="anchor" href="#_route43"></a><a class="link" href="#_route43">2.15. PUT /v2/loop/restart/{loopName}</a></h3> +<h3 id="_route17"><a class="anchor" href="#_route17"></a><a class="link" href="#_route17">2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3> <div class="sect3"> -<h4 id="_parameters_10"><a class="anchor" href="#_parameters_10"></a><a class="link" href="#_parameters_10">2.15.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1479,11 +1706,23 @@ 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> <div class="sect3"> -<h4 id="_responses_15"><a class="anchor" href="#_responses_15"></a><a class="link" href="#_responses_15">2.15.2. Responses</a></h4> +<h4 id="_responses_18"><a class="anchor" href="#_responses_18"></a><a class="link" href="#_responses_18">2.18.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1507,7 +1746,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_14"><a class="anchor" href="#_produces_14"></a><a class="link" href="#_produces_14">2.15.3. Produces</a></h4> +<h4 id="_produces_17"><a class="anchor" href="#_produces_17"></a><a class="link" href="#_produces_17">2.18.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1518,9 +1757,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route42"><a class="anchor" href="#_route42"></a><a class="link" href="#_route42">2.16. PUT /v2/loop/stop/{loopName}</a></h3> +<h3 id="_route12"><a class="anchor" href="#_route12"></a><a class="link" href="#_route12">2.19. PUT /v2/loop/restart/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_11"><a class="anchor" href="#_parameters_11"></a><a class="link" href="#_parameters_11">2.16.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1545,7 +1784,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_16"><a class="anchor" href="#_responses_16"></a><a class="link" href="#_responses_16">2.16.2. Responses</a></h4> +<h4 id="_responses_19"><a class="anchor" href="#_responses_19"></a><a class="link" href="#_responses_19">2.19.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1569,7 +1808,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_15"><a class="anchor" href="#_produces_15"></a><a class="link" href="#_produces_15">2.16.3. Produces</a></h4> +<h4 id="_produces_18"><a class="anchor" href="#_produces_18"></a><a class="link" href="#_produces_18">2.19.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1580,9 +1819,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route44"><a class="anchor" href="#_route44"></a><a class="link" href="#_route44">2.17. PUT /v2/loop/submit/{loopName}</a></h3> +<h3 id="_route11"><a class="anchor" href="#_route11"></a><a class="link" href="#_route11">2.20. PUT /v2/loop/stop/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_12"><a class="anchor" href="#_parameters_12"></a><a class="link" href="#_parameters_12">2.17.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1607,7 +1846,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_17"><a class="anchor" href="#_responses_17"></a><a class="link" href="#_responses_17">2.17.2. Responses</a></h4> +<h4 id="_responses_20"><a class="anchor" href="#_responses_20"></a><a class="link" href="#_responses_20">2.20.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1631,7 +1870,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_16"><a class="anchor" href="#_produces_16"></a><a class="link" href="#_produces_16">2.17.3. Produces</a></h4> +<h4 id="_produces_19"><a class="anchor" href="#_produces_19"></a><a class="link" href="#_produces_19">2.20.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1642,9 +1881,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route35"><a class="anchor" href="#_route35"></a><a class="link" href="#_route35">2.18. GET /v2/loop/svgRepresentation/{loopName}</a></h3> +<h3 id="_route13"><a class="anchor" href="#_route13"></a><a class="link" href="#_route13">2.21. PUT /v2/loop/submit/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.18.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1669,7 +1908,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_18"><a class="anchor" href="#_responses_18"></a><a class="link" href="#_responses_18">2.18.2. Responses</a></h4> +<h4 id="_responses_21"><a class="anchor" href="#_responses_21"></a><a class="link" href="#_responses_21">2.21.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1687,13 +1926,75 @@ 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> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_produces_20"><a class="anchor" href="#_produces_20"></a><a class="link" href="#_produces_20">2.21.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="_route4"><a class="anchor" href="#_route4"></a><a class="link" href="#_route4">2.22. GET /v2/loop/svgRepresentation/{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"> +<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> </tbody> </table> </div> <div class="sect3"> -<h4 id="_produces_17"><a class="anchor" href="#_produces_17"></a><a class="link" href="#_produces_17">2.18.3. Produces</a></h4> +<h4 id="_responses_22"><a class="anchor" href="#_responses_22"></a><a class="link" href="#_responses_22">2.22.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">string</p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect3"> +<h4 id="_produces_21"><a class="anchor" href="#_produces_21"></a><a class="link" href="#_produces_21">2.22.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1704,9 +2005,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route41"><a class="anchor" href="#_route41"></a><a class="link" href="#_route41">2.19. PUT /v2/loop/undeploy/{loopName}</a></h3> +<h3 id="_route10"><a class="anchor" href="#_route10"></a><a class="link" href="#_route10">2.23. PUT /v2/loop/undeploy/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_14"><a class="anchor" href="#_parameters_14"></a><a class="link" href="#_parameters_14">2.19.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1731,7 +2032,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_19"><a class="anchor" href="#_responses_19"></a><a class="link" href="#_responses_19">2.19.2. Responses</a></h4> +<h4 id="_responses_23"><a class="anchor" href="#_responses_23"></a><a class="link" href="#_responses_23">2.23.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -1755,7 +2056,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_18"><a class="anchor" href="#_produces_18"></a><a class="link" href="#_produces_18">2.19.3. Produces</a></h4> +<h4 id="_produces_22"><a class="anchor" href="#_produces_22"></a><a class="link" href="#_produces_22">2.23.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1766,9 +2067,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route36"><a class="anchor" href="#_route36"></a><a class="link" href="#_route36">2.20. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> +<h3 id="_route5"><a class="anchor" href="#_route5"></a><a class="link" href="#_route5">2.24. POST /v2/loop/updateGlobalProperties/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_15"><a class="anchor" href="#_parameters_15"></a><a class="link" href="#_parameters_15">2.20.1. Parameters</a></h4> +<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"> <colgroup> <col style="width: 22.2222%;"> @@ -1799,7 +2100,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_20"><a class="anchor" href="#_responses_20"></a><a class="link" href="#_responses_20">2.20.2. Responses</a></h4> +<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%;"> @@ -1823,7 +2124,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_3"><a class="anchor" href="#_consumes_3"></a><a class="link" href="#_consumes_3">2.20.3. Consumes</a></h4> +<h4 id="_consumes_4"><a class="anchor" href="#_consumes_4"></a><a class="link" href="#_consumes_4">2.24.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1833,7 +2134,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_19"><a class="anchor" href="#_produces_19"></a><a class="link" href="#_produces_19">2.20.4. Produces</a></h4> +<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.24.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -1844,9 +2145,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route38"><a class="anchor" href="#_route38"></a><a class="link" href="#_route38">2.21. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> +<h3 id="_route7"><a class="anchor" href="#_route7"></a><a class="link" href="#_route7">2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_16"><a class="anchor" href="#_parameters_16"></a><a class="link" href="#_parameters_16">2.21.1. Parameters</a></h4> +<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%;"> @@ -1877,7 +2178,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_21"><a class="anchor" href="#_responses_21"></a><a class="link" href="#_responses_21">2.21.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%;"> @@ -1901,7 +2202,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.21.3. Consumes</a></h4> +<h4 id="_consumes_5"><a class="anchor" href="#_consumes_5"></a><a class="link" href="#_consumes_5">2.25.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1911,7 +2212,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_20"><a class="anchor" href="#_produces_20"></a><a class="link" href="#_produces_20">2.21.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> @@ -1922,9 +2223,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route37"><a class="anchor" href="#_route37"></a><a class="link" href="#_route37">2.22. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> +<h3 id="_route6"><a class="anchor" href="#_route6"></a><a class="link" href="#_route6">2.26. POST /v2/loop/updateOperationalPolicies/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_17"><a class="anchor" href="#_parameters_17"></a><a class="link" href="#_parameters_17">2.22.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%;"> @@ -1955,7 +2256,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_22"><a class="anchor" href="#_responses_22"></a><a class="link" href="#_responses_22">2.22.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%;"> @@ -1979,7 +2280,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.22.3. Consumes</a></h4> +<h4 id="_consumes_6"><a class="anchor" href="#_consumes_6"></a><a class="link" href="#_consumes_6">2.26.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -1989,7 +2290,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_21"><a class="anchor" href="#_produces_21"></a><a class="link" href="#_produces_21">2.22.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> @@ -2000,9 +2301,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route34"><a class="anchor" href="#_route34"></a><a class="link" href="#_route34">2.23. GET /v2/loop/{loopName}</a></h3> +<h3 id="_route3"><a class="anchor" href="#_route3"></a><a class="link" href="#_route3">2.27. GET /v2/loop/{loopName}</a></h3> <div class="sect3"> -<h4 id="_parameters_18"><a class="anchor" href="#_parameters_18"></a><a class="link" href="#_parameters_18">2.23.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%;"> @@ -2027,7 +2328,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_23"><a class="anchor" href="#_responses_23"></a><a class="link" href="#_responses_23">2.23.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%;"> @@ -2051,7 +2352,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_22"><a class="anchor" href="#_produces_22"></a><a class="link" href="#_produces_22">2.23.3. Produces</a></h4> +<h4 id="_produces_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.27.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2062,9 +2363,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route56"><a class="anchor" href="#_route56"></a><a class="link" href="#_route56">2.24. GET /v2/policyToscaModels</a></h3> +<h3 id="_route29"><a class="anchor" href="#_route29"></a><a class="link" href="#_route29">2.28. POST /v2/policyToscaModels</a></h3> <div class="sect3"> -<h4 id="_responses_24"><a class="anchor" href="#_responses_24"></a><a class="link" href="#_responses_24">2.24.1. Responses</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%;"> +<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>Body</strong></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>body</strong><br> +<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_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%;"> @@ -2088,7 +2414,17 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect3"> -<h4 id="_produces_23"><a class="anchor" href="#_produces_23"></a><a class="link" href="#_produces_23">2.24.2. Produces</a></h4> +<h4 id="_consumes_7"><a class="anchor" href="#_consumes_7"></a><a class="link" href="#_consumes_7">2.28.3. Consumes</a></h4> +<div class="ulist"> +<ul> +<li> +<p><code>plain/text</code></p> +</li> +</ul> +</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> <div class="ulist"> <ul> <li> @@ -2099,9 +2435,46 @@ 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_get"><a class="anchor" href="#_v2_policytoscamodels_yaml_policymodeltype_get"></a><a class="link" href="#_v2_policytoscamodels_yaml_policymodeltype_get">2.25. GET /v2/policyToscaModels/yaml/{policyModelType}</a></h3> +<h3 id="_route28"><a class="anchor" href="#_route28"></a><a class="link" href="#_route28">2.29. GET /v2/policyToscaModels</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="_responses_29"><a class="anchor" href="#_responses_29"></a><a class="link" href="#_responses_29">2.29.1. 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="#_policymodel">PolicyModel</a></p></td> +</tr> +</tbody> +</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> +<div class="ulist"> +<ul> +<li> +<p><code>application/json</code></p> +</li> +</ul> +</div> +</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> +<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> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2122,11 +2495,17 @@ 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>policyModelVersion</strong><br> +<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_25"><a class="anchor" href="#_responses_25"></a><a class="link" href="#_responses_25">2.25.2. Responses</a></h4> +<h4 id="_responses_30"><a class="anchor" href="#_responses_30"></a><a class="link" href="#_responses_30">2.30.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2150,7 +2529,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_24"><a class="anchor" href="#_produces_24"></a><a class="link" href="#_produces_24">2.25.3. Produces</a></h4> +<h4 id="_produces_29"><a class="anchor" href="#_produces_29"></a><a class="link" href="#_produces_29">2.30.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2161,9 +2540,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_get"><a class="anchor" href="#_v2_policytoscamodels_policymodeltype_get"></a><a class="link" href="#_v2_policytoscamodels_policymodeltype_get">2.26. GET /v2/policyToscaModels/{policyModelType}</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.31. GET /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</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_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%;"> @@ -2184,11 +2563,17 @@ 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>policyModelVersion</strong><br> +<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_26"><a class="anchor" href="#_responses_26"></a><a class="link" href="#_responses_26">2.26.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%;"> @@ -2212,7 +2597,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_25"><a class="anchor" href="#_produces_25"></a><a class="link" href="#_produces_25">2.26.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> @@ -2223,9 +2608,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route57"><a class="anchor" href="#_route57"></a><a class="link" href="#_route57">2.27. PUT /v2/policyToscaModels/{policyModelType}</a></h3> +<h3 id="_route30"><a class="anchor" href="#_route30"></a><a class="link" href="#_route30">2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}</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_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%;"> @@ -2247,6 +2632,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b <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>policyModelVersion</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> <em>required</em></p></td> @@ -2256,7 +2647,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_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%;"> @@ -2280,7 +2671,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.27.3. Consumes</a></h4> +<h4 id="_consumes_8"><a class="anchor" href="#_consumes_8"></a><a class="link" href="#_consumes_8">2.32.3. Consumes</a></h4> <div class="ulist"> <ul> <li> @@ -2290,7 +2681,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_26"><a class="anchor" href="#_produces_26"></a><a class="link" href="#_produces_26">2.27.4. Produces</a></h4> +<h4 id="_produces_31"><a class="anchor" href="#_produces_31"></a><a class="link" href="#_produces_31">2.32.4. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2301,9 +2692,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </div> <div class="sect2"> -<h3 id="_route60"><a class="anchor" href="#_route60"></a><a class="link" href="#_route60">2.28. GET /v2/templates</a></h3> +<h3 id="_route34"><a class="anchor" href="#_route34"></a><a class="link" href="#_route34">2.33. GET /v2/templates</a></h3> <div class="sect3"> -<h4 id="_responses_28"><a class="anchor" href="#_responses_28"></a><a class="link" href="#_responses_28">2.28.1. Responses</a></h4> +<h4 id="_responses_33"><a class="anchor" href="#_responses_33"></a><a class="link" href="#_responses_33">2.33.1. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2327,7 +2718,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_27"><a class="anchor" href="#_produces_27"></a><a class="link" href="#_produces_27">2.28.2. Produces</a></h4> +<h4 id="_produces_32"><a class="anchor" href="#_produces_32"></a><a class="link" href="#_produces_32">2.33.2. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2338,9 +2729,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.29. 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.34. GET /v2/templates/names</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_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%;"> @@ -2364,7 +2755,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_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> @@ -2375,9 +2766,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.30. 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.35. GET /v2/templates/{templateName}</a></h3> <div class="sect3"> -<h4 id="_parameters_22"><a class="anchor" href="#_parameters_22"></a><a class="link" href="#_parameters_22">2.30.1. Parameters</a></h4> +<h4 id="_parameters_26"><a class="anchor" href="#_parameters_26"></a><a class="link" href="#_parameters_26">2.35.1. Parameters</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 22.2222%;"> @@ -2402,7 +2793,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_35"><a class="anchor" href="#_responses_35"></a><a class="link" href="#_responses_35">2.35.2. Responses</a></h4> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 10%;"> @@ -2426,7 +2817,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_34"><a class="anchor" href="#_produces_34"></a><a class="link" href="#_produces_34">2.35.3. Produces</a></h4> <div class="ulist"> <ul> <li> @@ -2436,13 +2827,107 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </div> </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> +<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> +<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>templateName</strong><br> +<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_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%;"> +<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">string</p></td> +</tr> +</tbody> +</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> +<div class="ulist"> +<ul> +<li> +<p><code>application/xml</code></p> +</li> +</ul> +</div> +</div> +</div> </div> </div> <div class="sect1"> <h2 id="_definitions"><a class="anchor" href="#_definitions"></a><a class="link" href="#_definitions">3. Definitions</a></h2> <div class="sectionbody"> <div class="sect2"> -<h3 id="_cldshealthcheck"><a class="anchor" href="#_cldshealthcheck"></a><a class="link" href="#_cldshealthcheck">3.1. CldsHealthCheck</a></h3> +<h3 id="_clampinformation"><a class="anchor" href="#_clampinformation"></a><a class="link" href="#_clampinformation">3.1. ClampInformation</a></h3> +<table class="tableblock frame-all grid-all stretch"> +<colgroup> +<col style="width: 42.8571%;"> +<col style="width: 57.1429%;"> +</colgroup> +<thead> +<tr> +<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>allPermissions</strong><br> +<em>optional</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">< string > array</p></td> +</tr> +<tr> +<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>cldsVersion</strong><br> +<em>optional</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>userName</strong><br> +<em>optional</em></p></td> +<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td> +</tr> +</tbody> +</table> +</div> +<div class="sect2"> +<h3 id="_cldshealthcheck"><a class="anchor" href="#_cldshealthcheck"></a><a class="link" href="#_cldshealthcheck">3.2. CldsHealthCheck</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2474,7 +2959,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_dictionary"><a class="anchor" href="#_dictionary"></a><a class="link" href="#_dictionary">3.2. Dictionary</a></h3> +<h3 id="_dictionary"><a class="anchor" href="#_dictionary"></a><a class="link" href="#_dictionary">3.3. Dictionary</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2531,7 +3016,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_dictionaryelement"><a class="anchor" href="#_dictionaryelement"></a><a class="link" href="#_dictionaryelement">3.3. DictionaryElement</a></h3> +<h3 id="_dictionaryelement"><a class="anchor" href="#_dictionaryelement"></a><a class="link" href="#_dictionaryelement">3.4. DictionaryElement</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2598,7 +3083,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_externalcomponent"><a class="anchor" href="#_externalcomponent"></a><a class="link" href="#_externalcomponent">3.4. ExternalComponent</a></h3> +<h3 id="_externalcomponent"><a class="anchor" href="#_externalcomponent"></a><a class="link" href="#_externalcomponent">3.5. ExternalComponent</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2625,7 +3110,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_externalcomponentstate"><a class="anchor" href="#_externalcomponentstate"></a><a class="link" href="#_externalcomponentstate">3.5. ExternalComponentState</a></h3> +<h3 id="_externalcomponentstate"><a class="anchor" href="#_externalcomponentstate"></a><a class="link" href="#_externalcomponentstate">3.6. ExternalComponentState</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2657,7 +3142,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_jsonarray"><a class="anchor" href="#_jsonarray"></a><a class="link" href="#_jsonarray">3.6. JsonArray</a></h3> +<h3 id="_jsonarray"><a class="anchor" href="#_jsonarray"></a><a class="link" href="#_jsonarray">3.7. JsonArray</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2774,7 +3259,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_jsonnull"><a class="anchor" href="#_jsonnull"></a><a class="link" href="#_jsonnull">3.7. JsonNull</a></h3> +<h3 id="_jsonnull"><a class="anchor" href="#_jsonnull"></a><a class="link" href="#_jsonnull">3.8. JsonNull</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -2891,7 +3376,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_jsonobject"><a class="anchor" href="#_jsonobject"></a><a class="link" href="#_jsonobject">3.8. JsonObject</a></h3> +<h3 id="_jsonobject"><a class="anchor" href="#_jsonobject"></a><a class="link" href="#_jsonobject">3.9. JsonObject</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3008,7 +3493,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_jsonprimitive"><a class="anchor" href="#_jsonprimitive"></a><a class="link" href="#_jsonprimitive">3.9. JsonPrimitive</a></h3> +<h3 id="_jsonprimitive"><a class="anchor" href="#_jsonprimitive"></a><a class="link" href="#_jsonprimitive">3.10. JsonPrimitive</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3140,7 +3625,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_loop"><a class="anchor" href="#_loop"></a><a class="link" href="#_loop">3.10. Loop</a></h3> +<h3 id="_loop"><a class="anchor" href="#_loop"></a><a class="link" href="#_loop">3.11. Loop</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3237,7 +3722,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_loopelementmodel"><a class="anchor" href="#_loopelementmodel"></a><a class="link" href="#_loopelementmodel">3.11. LoopElementModel</a></h3> +<h3 id="_loopelementmodel"><a class="anchor" href="#_loopelementmodel"></a><a class="link" href="#_loopelementmodel">3.12. LoopElementModel</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3309,7 +3794,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_looplog"><a class="anchor" href="#_looplog"></a><a class="link" href="#_looplog">3.12. LoopLog</a></h3> +<h3 id="_looplog"><a class="anchor" href="#_looplog"></a><a class="link" href="#_looplog">3.13. LoopLog</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3356,7 +3841,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_looptemplate"><a class="anchor" href="#_looptemplate"></a><a class="link" href="#_looptemplate">3.13. LoopTemplate</a></h3> +<h3 id="_looptemplate"><a class="anchor" href="#_looptemplate"></a><a class="link" href="#_looptemplate">3.14. LoopTemplate</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3438,7 +3923,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_looptemplateloopelementmodel"><a class="anchor" href="#_looptemplateloopelementmodel"></a><a class="link" href="#_looptemplateloopelementmodel">3.14. LoopTemplateLoopElementModel</a></h3> +<h3 id="_looptemplateloopelementmodel"><a class="anchor" href="#_looptemplateloopelementmodel"></a><a class="link" href="#_looptemplateloopelementmodel">3.15. LoopTemplateLoopElementModel</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3470,7 +3955,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_microservicepolicy"><a class="anchor" href="#_microservicepolicy"></a><a class="link" href="#_microservicepolicy">3.15. MicroServicePolicy</a></h3> +<h3 id="_microservicepolicy"><a class="anchor" href="#_microservicepolicy"></a><a class="link" href="#_microservicepolicy">3.16. MicroServicePolicy</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3577,13 +4062,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_number"><a class="anchor" href="#_number"></a><a class="link" href="#_number">3.16. Number</a></h3> +<h3 id="_number"><a class="anchor" href="#_number"></a><a class="link" href="#_number">3.17. Number</a></h3> <div class="paragraph"> <p><em>Type</em> : object</p> </div> </div> <div class="sect2"> -<h3 id="_operationalpolicy"><a class="anchor" href="#_operationalpolicy"></a><a class="link" href="#_operationalpolicy">3.17. OperationalPolicy</a></h3> +<h3 id="_operationalpolicy"><a class="anchor" href="#_operationalpolicy"></a><a class="link" href="#_operationalpolicy">3.18. OperationalPolicy</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3665,7 +4150,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_policymodel"><a class="anchor" href="#_policymodel"></a><a class="link" href="#_policymodel">3.18. PolicyModel</a></h3> +<h3 id="_policymodel"><a class="anchor" href="#_policymodel"></a><a class="link" href="#_policymodel">3.19. PolicyModel</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> @@ -3732,7 +4217,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b </table> </div> <div class="sect2"> -<h3 id="_service"><a class="anchor" href="#_service"></a><a class="link" href="#_service">3.19. Service</a></h3> +<h3 id="_service"><a class="anchor" href="#_service"></a><a class="link" href="#_service">3.20. Service</a></h3> <table class="tableblock frame-all grid-all stretch"> <colgroup> <col style="width: 42.8571%;"> diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index 3ce033f64..dbccb32de 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -176,7 +176,9 @@ clamp.config.security.permission.instance=dev clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal ## Tosca converter -clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json +clamp.config.tosca.converter.json.schema.templates=classpath:/clds/tosca-converter/templates.json +clamp.config.tosca.converter.default.datatypes=classpath:/clds/tosca-converter/default-tosca-types.yaml +clamp.config.tosca.converter.dictionary.support.enabled=true # Configuration settings for CDS clamp.config.cds.url=http4://blueprints-processor-http:8080 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a249d2d00..90c4186ef 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -189,7 +189,9 @@ clamp.config.cadi.aafUrl=https://AAF_LOCATE_URL/onap.org.osaaf.aaf.service:2.1 clamp.config.cadi.cadiX509Issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US ## Tosca converter -clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json +clamp.config.tosca.converter.json.schema.templates=classpath:/clds/tosca-converter/templates.json +clamp.config.tosca.converter.default.datatypes=classpath:/clds/tosca-converter/default-tosca-types.yaml +clamp.config.tosca.converter.dictionary.support.enabled=true # Configuration settings for CDS clamp.config.cds.url=http4://blueprints-processor-http:8080 diff --git a/src/main/resources/clds/tosca_update/default-tosca-types.yaml b/src/main/resources/clds/tosca-converter/default-tosca-types.yaml index a11a73698..a11a73698 100644 --- a/src/main/resources/clds/tosca_update/default-tosca-types.yaml +++ b/src/main/resources/clds/tosca-converter/default-tosca-types.yaml diff --git a/src/main/resources/clds/tosca_update/templates.json b/src/main/resources/clds/tosca-converter/templates.json index f709e2f6d..f709e2f6d 100644 --- a/src/main/resources/clds/tosca_update/templates.json +++ b/src/main/resources/clds/tosca-converter/templates.json |