From: Threefoot, Jane (jt6620) Date: Wed, 14 Mar 2018 18:48:10 +0000 (-0400) Subject: added new aai-schema-ingest library X-Git-Tag: v1.2.1~9^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=1fc5ce5b48f8c270d5d044356843b8a8566bdccc;p=aai%2Faai-common.git added new aai-schema-ingest library New, lightweight, configurable library for OXM and edge rules json ingest. Allows for broken-up OXM and json for increased model-driven capabilities. Issue-ID: AAI-875 Change-Id: I987c7dc2ad9a68ef3ccaac8da8d3b5b0205dc264 Signed-off-by: Threefoot, Jane (jt6620) --- diff --git a/aai-schema-ingest/.classpath b/aai-schema-ingest/.classpath new file mode 100644 index 00000000..fae1a2b3 --- /dev/null +++ b/aai-schema-ingest/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml new file mode 100644 index 00000000..d56b3bb0 --- /dev/null +++ b/aai-schema-ingest/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + + org.onap.aai.aai-common + aai-common + 1.2.1-SNAPSHOT + + aai-schema-ingest + aai-schema-ingest + 1.0.0-SNAPSHOT + jar + + + + org.eclipse.persistence + eclipselink + 2.6.2 + + + com.google.guava + guava + 16.0 + + + org.apache.tinkerpop + gremlin-core + 3.0.1-incubating + + + com.jayway.jsonpath + json-path + 2.2.0 + + + org.springframework + spring-context + 4.3.6.RELEASE + + + org.springframework + spring-test + 4.3.6.RELEASE + + + org.springframework.boot + spring-boot-test + 1.5.1.RELEASE + test + + + + junit + junit + 4.12 + test + + + org.mockito + mockito-all + 1.10.19 + test + + + + diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java new file mode 100644 index 00000000..aa90a300 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeIngestor.java @@ -0,0 +1,581 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.onap.aai.edges.enums.AAIDirection; +import org.onap.aai.edges.enums.DirectionNotation; +import org.onap.aai.edges.enums.EdgeField; +import org.onap.aai.edges.enums.EdgeType; +import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException; +import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; +import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.Version; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; +import com.jayway.jsonpath.Criteria; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.Filter; +import static com.jayway.jsonpath.Filter.filter; +import com.jayway.jsonpath.JsonPath; +import static com.jayway.jsonpath.Criteria.where; + +@Component +/** + * EdgeIngestor - ingests A&AI edge rule schema files per given config, serves that edge rule + * information, including allowing various filters to extract particular rules. + */ +public class EdgeIngestor { + private Map> versionJsonFilesMap = new EnumMap<>(Version.class); + private static final String READ_START = "$.rules.[?]"; + private static final String READ_ALL_START = "$.rules.*"; + + //-----ingest-----// + @Autowired + /** + * Instantiates the EdgeIngestor bean. + * + * @param translator - ConfigTranslator autowired in by Spring framework which + * contains the configuration information needed to ingest the desired files. + */ + public EdgeIngestor(ConfigTranslator translator) { + Map> filesToIngest = translator.getEdgeFiles(); + + for (Entry> verFile : filesToIngest.entrySet()) { + Version v = verFile.getKey(); + List files = verFile.getValue(); + + List docs = new ArrayList<>(); + + for (String rulesFilename : files) { + String fileContents = readInJsonFile(rulesFilename); + docs.add(JsonPath.parse(fileContents)); + } + versionJsonFilesMap.put(v, docs); + } + } + + /** + * Reads the json file at the given filename into an in-memory String. + * + * @param rulesFilename - json file to be read (must include path to the file) + * @return String json contents of the given file + */ + private String readInJsonFile(String rulesFilename) { + StringBuilder sb = new StringBuilder(); + try(BufferedReader br = new BufferedReader(new FileReader(rulesFilename))) { + String line; + while ((line = br.readLine()) != null) { + sb.append(line); + } + } catch (IOException e) { + throw new ExceptionInInitializerError(e); + } + return sb.toString(); + } + + //-----methods for getting rule info-----// + + /** + * Gets list of all edge rules defined in the latest version's schema + * + * @return Multimap of node names keys to the EdgeRules associated with those types + * where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + * @throws EdgeRuleNotFoundException if none found + */ + public Multimap getAllCurrentRules() throws EdgeRuleNotFoundException { + return getAllRules(Version.getLatest()); + } + + /** + * Gets list of all edge rules defined in the given version's schema + * + * @return Multimap of node names keys to the EdgeRules associated with those types + * where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + * @throws EdgeRuleNotFoundException if none found + */ + public Multimap getAllRules(Version v) throws EdgeRuleNotFoundException { + Multimap found = extractRules(null, v); + if (found.isEmpty()) { + throw new EdgeRuleNotFoundException("No rules found for version " + v.toString() + "."); + } else { + return found; + } + } + + /** + * Finds the rules (if any) matching the given query criteria. If none, the returned Multimap + * will be empty. + * + * @param q - EdgeRuleQuery with filter criteria set + * + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + * @throws EdgeRuleNotFoundException if none found + */ + public Multimap getRules(EdgeRuleQuery q) throws EdgeRuleNotFoundException { + Multimap found = extractRules(q.getFilter(), q.getVersion()); + if (found.isEmpty()) { + throw new EdgeRuleNotFoundException("No rules found for " + q.toString()); + } else { + return found; + } + } + + /** + * Gets the rule satisfying the given filter criteria. If there are more than one + * that match, return the default rule. If there is no clear default to return, or + * no rules match at all, error. + * + * @param q - EdgeRuleQuery with filter criteria set + * @return EdgeRule satisfying given criteria + * @throws EdgeRuleNotFoundException if none found that match + * @throws AmbiguousRuleChoiceException if multiple match but no way to choice one from them + * Specifically, if multiple node type pairs come back (ie bar|foo and asdf|foo, + * no way to know which is appropriate over the others), + * or if there is a mix of Tree and Cousin edges because again there is no way to + * know which is "defaulter" than the other. + * The default property only clarifies among multiple cousin edges of the same node pair, + * ex: which l-interface|logical-link rule to default to. + */ + public EdgeRule getRule(EdgeRuleQuery q) throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + Multimap found = extractRules(q.getFilter(), q.getVersion()); + + if (found.isEmpty()) { + throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + "."); + } + + EdgeRule rule = null; + if (found.keys().size() == 1) { //only one found, cool we're done + for (Entry e : found.entries()) { + rule = e.getValue(); + } + } else { + rule = getDefaultRule(found); + } + + if (rule == null) { //should never get here though + throw new EdgeRuleNotFoundException("No rule found for " + q.toString() + "."); + } else { + return rule; + } + } + + private EdgeRule getDefaultRule(Multimap found) throws AmbiguousRuleChoiceException { + if (found.keySet().size() > 1) { //ie multiple node pairs (a|c and b|c not just all a|c) case + StringBuilder sb = new StringBuilder(); + for (String k : found.keySet()) { + sb.append(k).append(" "); + } + throw new AmbiguousRuleChoiceException("No way to select single rule from these pairs: " + sb.toString() + "."); + } + + int defaultCount = 0; + EdgeRule defRule = null; + for (Entry e : found.entries()) { + EdgeRule rule = e.getValue(); + if (rule.isDefault()) { + defaultCount++; + defRule = rule; + } + } + if (defaultCount > 1) { + throw new AmbiguousRuleChoiceException("Multiple defaults found."); + } else if (defaultCount == 0) { + throw new AmbiguousRuleChoiceException("No default found."); + } + + return defRule; + } + + /** + * Checks if there exists any rule that satisfies the given filter criteria. + * + * @param q - EdgeRuleQuery with filter criteria set + * @return boolean + */ + public boolean hasRule(EdgeRuleQuery q) { + return !extractRules(q.getFilter(), q.getVersion()).isEmpty(); + } + + /** + * Gets all cousin rules for the given node type in the latest schema version. + * + * @param nodeType + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getCousinRules(String nodeType) { + return getCousinRules(nodeType, Version.getLatest()); //default to latest + } + + /** + * Gets all cousin rules for the given node type in the given schema version. + * + * @param nodeType + * @param v - the version of the edge rules to query + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getCousinRules(String nodeType, Version v) { + return extractRules(new EdgeRuleQuery.Builder(nodeType).edgeType(EdgeType.COUSIN).build().getFilter(), v); + } + + /** + * Returns if the given node type has any cousin relationships in the current version. + * @param nodeType + * @return boolean + */ + public boolean hasCousinRule(String nodeType) { + return hasCousinRule(nodeType, Version.getLatest()); + } + + /** + * Returns if the given node type has any cousin relationships in the given version. + * @param nodeType + * @return boolean + */ + public boolean hasCousinRule(String nodeType, Version v) { + return !getCousinRules(nodeType, v).isEmpty(); + } + + /** + * Gets all rules where "{given nodeType} contains {otherType}" in the latest schema version. + * + * @param nodeType - node type that is the container in the returned relationships + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getChildRules(String nodeType) { + return getChildRules(nodeType, Version.getLatest()); + } + + /** + * Gets all rules where "{given nodeType} contains {otherType}" in the given schema version. + * + * @param nodeType - node type that is the container in the returned relationships + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getChildRules(String nodeType, Version v) { + Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getSameDirectionContainmentCriteria()); + Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getOppositeDirectionContainmentCriteria()); + Filter total = from.or(to); + + return extractRules(total, v); + } + + /** + * Returns if the given node type has any child relationships (ie it contains another node type) in the current version. + * @param nodeType + * @return boolean + */ + public boolean hasChildRule(String nodeType) { + return hasChildRule(nodeType, Version.getLatest()); + } + + /** + * Returns if the given node type has any child relationships (ie it contains another node type) in the given version. + * @param nodeType + * @return boolean + */ + public boolean hasChildRule(String nodeType, Version v) { + return !getChildRules(nodeType, v).isEmpty(); + } + + /** + * Gets all rules where "{given nodeType} is contained by {otherType}" in the latest schema version. + * + * @param nodeType - node type that is the containee in the returned relationships + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getParentRules(String nodeType) { + return getParentRules(nodeType, Version.getLatest()); + } + + /** + * Gets all rules where "{given nodeType} is contained by {otherType}" in the given schema version. + * + * @param nodeType - node type that is the containee in the returned relationships + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + public Multimap getParentRules(String nodeType, Version v) { + Filter from = assembleFilterSegments(where(EdgeField.FROM.toString()).is(nodeType), getOppositeDirectionContainmentCriteria()); + Filter to = assembleFilterSegments(where(EdgeField.TO.toString()).is(nodeType), getSameDirectionContainmentCriteria()); + Filter total = from.or(to); + + return extractRules(total, v); + } + + /** + * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the current version. + * @param nodeType + * @return boolean + */ + public boolean hasParentRule(String nodeType) { + return hasParentRule(nodeType, Version.getLatest()); + } + + /** + * Returns if the given node type has any parent relationships (ie it is contained by another node type) in the given version. + * @param nodeType + * @return boolean + */ + public boolean hasParentRule(String nodeType, Version v) { + return !getParentRules(nodeType, v).isEmpty(); + } + + /** + * Applies the given filter to the DocumentContext(s) for the given version to extract + * edge rules, and converts this extracted information into the Multimap form + * + * @param filter - JsonPath filter to read the DocumentContexts with. May be null + * to denote no filter, ie get all. + * @param v - The schema version to extract from + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Map will be empty if + * no rules are found. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + private Multimap extractRules(Filter filter, Version v) { + List> foundRules = new ArrayList<>(); + List docs = versionJsonFilesMap.get(v); + if (docs != null) { + for (DocumentContext doc : docs) { + if (filter == null) { + foundRules.addAll(doc.read(READ_ALL_START)); + } else { + foundRules.addAll(doc.read(READ_START, filter)); + } + } + } + + return convertToEdgeRules(foundRules); + } + + //-----filter building helpers-----// + /** + * ANDs together the given start criteria with each criteria in the pieces list, and + * then ORs together these segments into one filter. + * + * JsonPath doesn't have an OR method on Criteria, only on Filters, so assembling + * a complete filter requires this sort of roundabout construction. + * + * @param start - Criteria of the form where(from/to).is(nodeType) + * (ie the start of any A&AI edge rule query) + * @param pieces - Other Criteria to be applied + * @return Filter constructed from the given Criteria + */ + private Filter assembleFilterSegments(Criteria start, List pieces) { + List segments = new ArrayList<>(); + for (Criteria c : pieces) { + segments.add(filter(start).and(c)); + } + Filter assembled = segments.remove(0); + for (Filter f : segments) { + assembled = assembled.or(f); + } + return assembled; + } + + /** + * Builds the sub-Criteria for a containment edge rule query where the direction + * and containment fields must match. + * + * Used for getChildRules() where the container node type is in the "from" position and + * for getParentRules() where the containee type is in the "to" position. + * + * @return List covering property permutations defined with either notation or explicit direction + */ + private List getSameDirectionContainmentCriteria() { + List crits = new ArrayList<>(); + + crits.add(where(EdgeField.CONTAINS.toString()).is(DirectionNotation.DIRECTION.toString())); + + crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.OUT.toString()) + .and(EdgeField.CONTAINS.toString()).is(Direction.OUT.toString())); + + crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.IN.toString()) + .and(EdgeField.CONTAINS.toString()).is(Direction.IN.toString())); + + return crits; + } + + /** + * Builds the sub-Criteria for a containment edge rule query where the direction + * and containment fields must not match. + * + * Used for getChildRules() where the container node type is in the "to" position and + * for getParentRules() where the containee type is in the "from" position. + * + * @return List covering property permutations defined with either notation or explicit direction + */ + private List getOppositeDirectionContainmentCriteria() { + List crits = new ArrayList<>(); + + crits.add(where(EdgeField.CONTAINS.toString()).is(DirectionNotation.OPPOSITE.toString())); + + crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.OUT.toString()) + .and(EdgeField.CONTAINS.toString()).is(Direction.IN.toString())); + + crits.add(where(EdgeField.DIRECTION.toString()).is(Direction.IN.toString()) + .and(EdgeField.CONTAINS.toString()).is(Direction.OUT.toString())); + + return crits; + } + + //-----rule packaging helpers-----// + /** + * Converts the raw output from reading the json file to the Multimap format + * + * @param List> allFound - raw edge rule output read from json file(s) + * (could be empty if none found) + * @return Multimap of node names keys to the EdgeRules where the key takes the form of + * {alphabetically first nodetype}|{alphabetically second nodetype}. Will be empty if input + * was empty. + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + private Multimap convertToEdgeRules(List> allFound) { + Multimap rules = ArrayListMultimap.create(); + + if (!allFound.isEmpty()) { + for (Map raw : allFound) { + EdgeRule converted = new EdgeRule(raw); + String alphabetizedKey = buildAlphabetizedKey(raw.get(EdgeField.FROM.toString()), raw.get(EdgeField.TO.toString())); + rules.put(alphabetizedKey, converted); + } + } + + return rules; + } + + /** + * Builds the multimap key for the rules, where nodetypes are alphabetically sorted + * (ignoring dashes). + * + * @param nodeA - first nodetype + * @param nodeB - second nodetype + * @return {alphabetically first nodetype}|{alphabetically second nodetype} + * ex: buildAlphabetizedKey("l-interface", "logical-link") -> "l-interface|logical-link" + * buildAlphabetizedKey("logical-link", "l-interface") -> "l-interface|logical-link" + * + * This is alphabetical order to normalize the keys, as sometimes there will be multiple + * rules for a pair of node types but the from/to value in the json is flipped for some of them. + */ + private String buildAlphabetizedKey(String nodeA, String nodeB) { + //normalize + String normalizedNodeA = nodeA.replace("-", ""); + String normalizedNodeB = nodeB.replace("-", ""); + int cmp = normalizedNodeA.compareTo(normalizedNodeB); + + StringBuilder sb = new StringBuilder(); + if (cmp <= 0) { + sb.append(nodeA); + sb.append("|"); + sb.append(nodeB); + } else { + sb.append(nodeB); + sb.append("|"); + sb.append(nodeA); + } + return sb.toString(); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java new file mode 100644 index 00000000..f859aae6 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRule.java @@ -0,0 +1,191 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.edges; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.onap.aai.edges.enums.AAIDirection; +import org.onap.aai.edges.enums.DirectionNotation; +import org.onap.aai.edges.enums.EdgeField; +import org.onap.aai.edges.enums.EdgeProperty; +import org.onap.aai.edges.enums.MultiplicityRule; + +import java.util.EnumMap; +import java.util.Map; + +/** + * Container for A&AI edge rule information + */ +public class EdgeRule { + private String from; + private String to; + private String label; + private Direction direction; + private MultiplicityRule multiplicityRule; + private Map edgeFields; + private boolean isDefaultEdge; + private String description; + + /** + * Instantiates a new edge rule. + * + * @param fieldVals - Map where first string is + * an EdgeField value and second string is the + * value of that field + */ + public EdgeRule(Map fieldVals) { + edgeFields = new EnumMap<>(EdgeProperty.class); + + from = fieldVals.get(EdgeField.FROM.toString()); + to = fieldVals.get(EdgeField.TO.toString()); + label = fieldVals.get(EdgeField.LABEL.toString()); + direction = Direction.valueOf(fieldVals.get(EdgeField.DIRECTION.toString())); + multiplicityRule = MultiplicityRule.getValue(fieldVals.get(EdgeField.MULTIPLICITY.toString())); + + for (EdgeProperty prop : EdgeProperty.values()) { + String rawVal = fieldVals.get(prop.toString()); + edgeFields.put(prop, convertNotation(direction, rawVal)); + } + + isDefaultEdge = Boolean.valueOf(fieldVals.get(EdgeField.DEFAULT.toString())); + + description = fieldVals.get(EdgeField.DESCRIPTION.toString()); + if (description == null) { //bc description is optional and not in v12 and earlier + description = ""; + } + } + + /** + * Converts whatever string was in the json for an edge property value into + * the appropriate AAIDirection + * + * @param Direction dir - the edge direction + * @param String rawVal - property value from the json, may be + * IN, OUT, BOTH, NONE, ${direction}, or !${direction} + * @return AAIDirection - IN/OUT/BOTH/NONE if that's the rawVal, or + * translates the direction notation into the correct IN/OUT + */ + private AAIDirection convertNotation(Direction dir, String rawVal) { + if (AAIDirection.NONE.toString().equals(rawVal)) { + return AAIDirection.NONE; + } else if (AAIDirection.BOTH.toString().equals(rawVal)) { + return AAIDirection.BOTH; + } else if (AAIDirection.OUT.toString().equals(rawVal)) { + return AAIDirection.OUT; + } else if (AAIDirection.IN.toString().equals(rawVal)) { + return AAIDirection.IN; + } + + DirectionNotation rawDN = DirectionNotation.getValue(rawVal); + if (DirectionNotation.DIRECTION.equals(rawDN)) { + return AAIDirection.getValue(dir); + } else { + return AAIDirection.getValue(dir.opposite()); + } + } + + /** + * Gets the name of the node type in the "from" field + * @return String nodetype + */ + public String getFrom() { + return from; + } + + /** + * Gets the name of the node type in the "to" field + * @return String nodetype + */ + public String getTo() { + return to; + } + + /** + * Gets the edge label + * + * @return String label + */ + public String getLabel() { + return label; + } + + /** + * Gets the multiplicity rule. + * + * @return MultiplicityRule + */ + public MultiplicityRule getMultiplicityRule() { + return multiplicityRule; + } + + /** + * Gets the edge direction + * + * @return Direction + */ + public Direction getDirection() { + return direction; + } + + /** + * Gets the value of contains-other-v + * + * @return the value of contains-other-v + */ + public String getContains() { + return edgeFields.get(EdgeProperty.CONTAINS).toString(); + } + + /** + * Gets the value of delete-other-v + * + * @return the value of delete-other-v + */ + public String getDeleteOtherV() { + return edgeFields.get(EdgeProperty.DELETE_OTHER_V).toString(); + } + + /** + * Gets the value of the prevent-delete property + * + * @return String prevent-delete property value + */ + public String getPreventDelete() { + return edgeFields.get(EdgeProperty.PREVENT_DELETE).toString(); + } + + /** + * Returns if this rule is a default or not + * + * @return boolean + */ + public boolean isDefault() { + return isDefaultEdge; + } + + /** + * Gets the description on the edge rule (if there is one) + * @return String description + */ + public String getDescription() { + return this.description; + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java new file mode 100644 index 00000000..3029685f --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/EdgeRuleQuery.java @@ -0,0 +1,214 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges; + +import org.onap.aai.edges.enums.AAIDirection; +import org.onap.aai.edges.enums.EdgeField; +import org.onap.aai.edges.enums.EdgeProperty; +import org.onap.aai.edges.enums.EdgeType; +import org.onap.aai.setup.Version; + +import com.jayway.jsonpath.Filter; +import com.jayway.jsonpath.Predicate; + +import static com.jayway.jsonpath.Filter.filter; + +import java.util.ArrayList; +import java.util.List; + +import static com.jayway.jsonpath.Criteria.where; + +/** + * For querying the edge rules schema (not the database) + * + */ +public class EdgeRuleQuery { + private Filter filter; + private Version v; + private String nodeA; + private String nodeB; + private String label; + private EdgeType type; + + public static class Builder { + //required + private String nodeA; + + //optional - null will translate to any value of the param + private String nodeB = null; + private String label = null; + private EdgeType type = null; + private Version version = Version.getLatest(); //default + + public Builder(String nodeA) { + this.nodeA = nodeA; + } + + public Builder(String nodeA, String nodeB) { + this.nodeA = nodeA; + this.nodeB = nodeB; + } + + private String getFirstNodeType() { + return nodeA; + } + + private String getSecondNodeType() { + return nodeB; + } + + public Builder label(String label) { + this.label = label; + return this; + } + + private String getLabel() { + return label; + } + + public Builder edgeType(EdgeType type) { + this.type = type; + return this; + } + + private EdgeType getEdgeType() { + return type; + } + + public Builder version(Version version) { + this.version = version; + return this; + } + private Version getVersion() { + return version; + } + + public EdgeRuleQuery build() { + return new EdgeRuleQuery(this); + } + } + + private EdgeRuleQuery(Builder builder) { + this.v = builder.getVersion(); + this.nodeA = builder.getFirstNodeType(); + this.nodeB = builder.getSecondNodeType(); + this.label = builder.getLabel(); + this.type = builder.getEdgeType(); + + //will cover from A to B case + List criteriaFromTo = new ArrayList<>(); + criteriaFromTo.add(buildToFromPart(builder.getFirstNodeType(), builder.getSecondNodeType())); + //will cover from B to A case - must be separate bc jsonpath won't let me OR predicates >:C + List criteriaToFrom = new ArrayList<>(); + criteriaToFrom.add(buildToFromPart(builder.getSecondNodeType(), builder.getFirstNodeType())); + + + + if (builder.getLabel() != null) { + Predicate labelPred = addLabel(builder.getLabel()); + criteriaFromTo.add(labelPred); + criteriaToFrom.add(labelPred); + } + + if (builder.getEdgeType() != null) { + Predicate typePred = addType(builder.getEdgeType()); + criteriaFromTo.add(typePred); + criteriaToFrom.add(typePred); + } + + + + this.filter = filter(criteriaFromTo).or(filter(criteriaToFrom)); + } + + private Predicate buildToFromPart(String from, String to) { + if (from == null && to == null) { //shouldn't ever happen though + throw new IllegalStateException("must have at least one node defined"); + } + + Predicate p; + + if (to == null) { + p = where(EdgeField.FROM.toString()).is(from); + } else if (from == null) { + p = where(EdgeField.TO.toString()).is(to); + } else { + p = where(EdgeField.FROM.toString()).is(from).and(EdgeField.TO.toString()).is(to); + } + + return p; + } + + private Predicate addLabel(String label) { + return where(EdgeField.LABEL.toString()).is(label); + } + + private Predicate addType(EdgeType type) { + if (type == EdgeType.COUSIN) { + return where(EdgeProperty.CONTAINS.toString()).is(AAIDirection.NONE.toString()); + } else { //equals TREE + return where(EdgeProperty.CONTAINS.toString()).ne(AAIDirection.NONE.toString()); + } + } + + /** + * Provides the JsonPath filter for actually querying the edge rule schema files + * @return Filter + */ + public Filter getFilter() { + return this.filter; + } + + /** + * So the Ingestor knows which version of the rules to search + * @return the Version + */ + public Version getVersion() { + return this.v; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + + sb.append("EdgeRuleQuery with filter params node type: ").append(nodeA); + + if (nodeB != null) { + sb.append(", node type: ").append(nodeB); + } + + if (label != null) { + sb.append(", label: ").append(label); + } + + sb.append(", type: "); + if (type != null) { + sb.append(type.toString()); + } else { + sb.append("any"); + } + + sb.append(", for version: ").append(v.toString()).append("."); + return sb.toString(); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/AAIDirection.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/AAIDirection.java new file mode 100644 index 00000000..3f748a50 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/AAIDirection.java @@ -0,0 +1,62 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.edges.enums; + +import org.apache.tinkerpop.gremlin.structure.Direction; + +public enum AAIDirection { + IN, OUT, BOTH, NONE; + + public AAIDirection opposite() { + if (this.equals(OUT)) { + return IN; + } else if (this.equals(IN)) { + return OUT; + } else { + return BOTH; + } + } + + public static AAIDirection getValue(String aaidir) { + if (OUT.toString().equals(aaidir)) { + return OUT; + } else if (IN.toString().equals(aaidir)) { + return IN; + } else if (NONE.toString().equals(aaidir)) { + return NONE; + } else { //should be BOTH + return BOTH; + } + } + + public static AAIDirection getValue(Direction dir) { + if (dir == Direction.OUT) { + return OUT; + } else if (dir == Direction.IN) { + return IN; + } else if (dir == Direction.BOTH) { + return BOTH; + } else { + return NONE; + } + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/DirectionNotation.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/DirectionNotation.java new file mode 100644 index 00000000..203249a4 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/DirectionNotation.java @@ -0,0 +1,49 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges.enums; + +public enum DirectionNotation { + DIRECTION("${direction}"), + OPPOSITE("!${direction}"); + + private final String val; + + DirectionNotation(String dir) { + this.val = dir; + } + + public static DirectionNotation getValue(String val) { + if (DIRECTION.toString().equals(val)) { + return DIRECTION; + } else if (OPPOSITE.toString().equals(val)) { + return OPPOSITE; + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return this.val; + } +} \ No newline at end of file diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeField.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeField.java new file mode 100644 index 00000000..3e896f61 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeField.java @@ -0,0 +1,50 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges.enums; + +/** + * Enumerates all edge rule fields + * + */ +public enum EdgeField { + FROM("from"), + TO("to"), + LABEL("label"), + DIRECTION("direction"), + MULTIPLICITY("multiplicity"), + CONTAINS("contains-other-v"), + DELETE_OTHER_V("delete-other-v"), + PREVENT_DELETE("prevent-delete"), + DEFAULT("default"), + DESCRIPTION("description"); + private final String name; + + private EdgeField(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeProperty.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeProperty.java new file mode 100644 index 00000000..2f6afa47 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeProperty.java @@ -0,0 +1,43 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges.enums; + +/** + * Enumerates edge rule fields which are edge properties + * (ie which have a directional value) + */ +public enum EdgeProperty { + CONTAINS("contains-other-v"), + DELETE_OTHER_V("delete-other-v"), + PREVENT_DELETE("prevent-delete"); + private final String name; + + private EdgeProperty(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeType.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeType.java new file mode 100644 index 00000000..00dce0fd --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/EdgeType.java @@ -0,0 +1,27 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.edges.enums; + +public enum EdgeType { + COUSIN, + TREE; +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/MultiplicityRule.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/MultiplicityRule.java new file mode 100644 index 00000000..4fc8938d --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/enums/MultiplicityRule.java @@ -0,0 +1,41 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.edges.enums; + +public enum MultiplicityRule { + MANY2ONE, + ONE2MANY, + ONE2ONE, + MANY2MANY; + + public static MultiplicityRule getValue(String multiplicity) { + if ("Many2Many".equalsIgnoreCase(multiplicity)) { + return MANY2MANY; + } else if ("One2Many".equalsIgnoreCase(multiplicity)) { + return ONE2MANY; + } else if ("One2One".equalsIgnoreCase(multiplicity)) { + return ONE2ONE; + } else { //should be "Many2One" + return MANY2ONE; + } + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java new file mode 100644 index 00000000..ebb9739b --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/AmbiguousRuleChoiceException.java @@ -0,0 +1,29 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges.exceptions; + +public class AmbiguousRuleChoiceException extends Exception { + public AmbiguousRuleChoiceException(String msg) { + super(msg); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java new file mode 100644 index 00000000..e1a8fe6b --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/edges/exceptions/EdgeRuleNotFoundException.java @@ -0,0 +1,29 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges.exceptions; + +public class EdgeRuleNotFoundException extends Exception { + public EdgeRuleNotFoundException(String msg) { + super(msg); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java new file mode 100644 index 00000000..5a29806d --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java @@ -0,0 +1,107 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.nodes; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.xml.bind.JAXBException; + +import org.eclipse.persistence.jaxb.JAXBContextProperties; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory; +import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.Version; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +/** + * NodeIngestor - ingests A&AI OXM files per given config, serves DynamicJAXBContext per version + */ +public class NodeIngestor { + + private Map versionContextMap = new EnumMap<>(Version.class); + + @Autowired + /** + * Instantiates the NodeIngestor bean. + * + * @param translator - ConfigTranslator autowired in by Spring framework which + * contains the configuration information needed to ingest the desired files. + */ + public NodeIngestor(ConfigTranslator translator) { + Map> filesToIngest = translator.getNodeFiles(); + + try { + for (Entry> verFiles : filesToIngest.entrySet()) { + Version v = verFiles.getKey(); + List files = verFiles.getValue(); + final DynamicJAXBContext ctx = ingest(files); + versionContextMap.put(v, ctx); + } + } catch (FileNotFoundException | JAXBException e) { + throw new ExceptionInInitializerError(e); + } + } + + /** + * Ingests the given OXM files into DynamicJAXBContext + * + * @param files - List of full filenames (ie including the path) to be ingested + * + * @return DynamicJAXBContext including schema information from all given files + * + * @throws FileNotFoundException if an OXM file can't be found + * @throws JAXBException if there's an error creating the DynamicJAXBContext + */ + private DynamicJAXBContext ingest(List files) throws FileNotFoundException, JAXBException { + List streams = new ArrayList<>(); + + for (String name : files) { + streams.add(new FileInputStream(new File(name))); + } + + Map properties = new HashMap<>(); + properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, streams); + return DynamicJAXBContextFactory.createContextFromOXM(this.getClass().getClassLoader(), properties); + } + + /** + * Gets the DynamicJAXBContext for the given version + * + * @param Version v + * @return DynamicJAXBContext + */ + public DynamicJAXBContext getContextForVersion(Version v) { + return versionContextMap.get(v); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java new file mode 100644 index 00000000..b34622de --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/ConfigTranslator.java @@ -0,0 +1,61 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Converts the contents of the schema config file + * (which lists which schema files to be loaded) to + * the format the Ingestors can work with. + * + */ +public abstract class ConfigTranslator { + protected SchemaLocationsBean bean; + + @Autowired + public ConfigTranslator(SchemaLocationsBean bean) { + this.bean = bean; + } + + /** + * Translates the contents of the schema config file + * into the input for the NodeIngestor + * + * @return Map of Version to the list of (string) filenames to be + * ingested for that version + */ + public abstract Map> getNodeFiles(); + + /** + * Translates the contents of the schema config file + * into the input for the EdgeIngestor + * + * @return Map of Version to the List of (String) filenames to be + * ingested for that version + */ + public abstract Map> getEdgeFiles(); +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java new file mode 100644 index 00000000..96c63447 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/SchemaLocationsBean.java @@ -0,0 +1,111 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; + +@Configuration +@PropertySource("classpath:schemaIngest.properties") +@PropertySource(value = "file:${schemaIngestPropLoc}", ignoreResourceNotFound=true) +public class SchemaLocationsBean { + /* + * Per Spring documentation, the last PropertySource that works will + * be applied. Here, schemaIngestPropLoc will be an environment variable + * set on install that tells Spring where to look for the schema + * ingest properties file (and the actual filename), but the former + * PropertySource gives the default of looking on the classpath for + * schemaIngest.properties in case that second one doesn't work. + * + * The schemaIngest.properties file (or its equivalent if you choose + * to name it otherwise) must contain the entries the below @Value + * annotations are looking for. + */ + + @Value("${schemaConfig}") + private String schemaConfigLoc; + + @Value("${nodeDir}") + private String nodeDirectory; + + @Value("${edgeDir}") + private String edgeDirectory; + + /** + * @return the file name/location with the list of schema files to be ingested + */ + public String getSchemaConfigLocation() { + return schemaConfigLoc; + } + + /** + * Sets the name/location of the file with the list of schema files to ingest + * + * @param String schemaConfigLoc - the file name/location + */ + public void setSchemaConfigLocation(String schemaConfigLoc) { + this.schemaConfigLoc = schemaConfigLoc; + } + + /** + * @return the location of the OXM files + */ + public String getNodeDirectory() { + return nodeDirectory; + } + + /** + * Sets the location of the OXM files + * + * @param String nodeDirectory - the location of the OXM files + */ + public void setNodeDirectory(String nodeDirectory) { + this.nodeDirectory = nodeDirectory; + } + + /** + * @return the location of the edge rule json files + */ + public String getEdgeDirectory() { + return edgeDirectory; + } + + /** + * Sets the location of the edge rule json files + * + * @param String edgeDirectory - the location of the edge rule files + */ + public void setEdgeDirectory(String edgeDirectory) { + this.edgeDirectory = edgeDirectory; + } + + //this allows the code to actually read the value from the config file + //without this those strings get set to literally "${edgeDir}" etc + @Bean + public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { + return new PropertySourcesPlaceholderConfigurer(); + } +} diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/Version.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Version.java new file mode 100644 index 00000000..8cc39426 --- /dev/null +++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Version.java @@ -0,0 +1,40 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.aai.setup; + +public enum Version { + V8, + V9, + V10, + V11, + V12, + V13; + + public static boolean isLatest(Version v) { + return getLatest().equals(v); + } + + public static Version getLatest(){ + Version[] vals = values(); //guaranteed to be in declaration order + return vals[vals.length-1]; //requires we always have the latest version listed last + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java new file mode 100644 index 00000000..9f6d67a1 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorTest.java @@ -0,0 +1,306 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges; + +import static org.junit.Assert.*; + +import java.util.Collection; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.onap.aai.edges.enums.AAIDirection; +import org.onap.aai.edges.enums.MultiplicityRule; +import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException; +import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; +import org.onap.aai.testutils.TestUtilConfigTranslator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.google.common.collect.Multimap; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class, TestUtilConfigTranslator.class, EdgeIngestor.class}) +@SpringBootTest +public class EdgeIngestorTest { + @Autowired + EdgeIngestor ei; + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void getRulesTest1() throws EdgeRuleNotFoundException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build(); + Multimap results = ei.getRules(q); + assertTrue(results.size() == 5); + assertTrue(results.containsKey("bar|foo")); + + assertTrue(2 == results.get("bar|foo").size()); + boolean seenLabel1 = false; + boolean seenLabel2 = false; + for(EdgeRule r : results.get("bar|foo")) { + if ("eats".equals(r.getLabel())) { + seenLabel1 = true; + } + if ("eatz".equals(r.getLabel())) { + seenLabel2 = true; + } + } + assertTrue(seenLabel1 && seenLabel2); + + assertTrue(results.containsKey("baz|foo")); + assertTrue(results.containsKey("foo|quux")); + assertTrue(results.containsKey("dog|foo")); + } + + @Test + public void getRulesTest2() throws EdgeRuleNotFoundException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("puppy", "dog").build(); + Multimap results = ei.getRules(q); + assertTrue(results.size() == 1); + assertTrue(results.containsKey("dog|puppy")); + Collection cr = results.get("dog|puppy"); + for (EdgeRule r : cr) { + assertTrue("dog".equals(r.getFrom())); + assertTrue("puppy".equals(r.getTo())); + assertTrue("caresFor".equals(r.getLabel())); + assertTrue(Direction.OUT.equals(r.getDirection())); + assertTrue("One2Many".equalsIgnoreCase(r.getMultiplicityRule().toString())); + assertTrue("NONE".equals(r.getContains())); + assertTrue("OUT".equals(r.getDeleteOtherV())); + assertTrue("NONE".equals(r.getPreventDelete())); + assertTrue(r.isDefault()); + } + } + + @Test + public void getRulesTest3() throws EdgeRuleNotFoundException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").version(Version.V11).build(); + Multimap results = ei.getRules(q); + assertTrue(results.size() == 4); + assertTrue(results.containsKey("lag-interface|l-interface")); + assertTrue(results.containsKey("l-interface|logical-link")); + assertTrue(results.get("l-interface|logical-link").size() == 3); + } + + @Test + public void getRulesNoneFound() throws EdgeRuleNotFoundException { + thrown.expect(EdgeRuleNotFoundException.class); + thrown.expectMessage("No rules found for"); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface").build(); + ei.getRules(q); + } + + @Test + public void getRuleSimpleTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("notation", "parent").build(); + EdgeRule result = ei.getRule(q); + assertTrue("parent".equals(result.getFrom())); + assertTrue("notation".equals(result.getTo())); + assertTrue("has".equals(result.getLabel())); + assertTrue(Direction.OUT.equals(result.getDirection())); + assertTrue(MultiplicityRule.MANY2MANY.equals(result.getMultiplicityRule())); + assertTrue(AAIDirection.OUT.toString().equals(result.getContains())); + assertTrue(AAIDirection.NONE.toString().equals(result.getDeleteOtherV())); + assertTrue(AAIDirection.NONE.toString().equals(result.getPreventDelete())); + assertTrue("parent contains notation".equals(result.getDescription())); + } + + @Test + public void getRuleWithDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").version(Version.V11).build(); + EdgeRule res = ei.getRule(q); + assertTrue(res.isDefault()); + assertTrue("tosca.relationships.network.LinksTo".equals(res.getLabel())); + } + + @Test + public void getRuleWithNonDefault() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","logical-link").label("org.onap.relationships.inventory.Source").version(Version.V11).build(); + EdgeRule res = ei.getRule(q); + assertFalse(res.isDefault()); + assertTrue("org.onap.relationships.inventory.Source".equals(res.getLabel())); + } + + @Test + public void getRuleNoneFoundTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + thrown.expect(EdgeRuleNotFoundException.class); + thrown.expectMessage("No rule found for"); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("l-interface","nonexistent").build(); + ei.getRule(q); + } + + @Test + public void getRuleTooManyPairsTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + thrown.expect(AmbiguousRuleChoiceException.class); + thrown.expectMessage("No way to select single rule from these pairs:"); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build(); + ei.getRule(q); + } + + @Test + public void getRuleAmbiguousDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + thrown.expect(AmbiguousRuleChoiceException.class); + thrown.expectMessage("Multiple defaults found."); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("seed","plant").version(Version.V11).build(); + ei.getRule(q); + } + + @Test + public void getRuleNoDefaultTest() throws EdgeRuleNotFoundException, AmbiguousRuleChoiceException { + thrown.expect(AmbiguousRuleChoiceException.class); + thrown.expectMessage("No default found."); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("apple", "orange").version(Version.V11).build(); + ei.getRule(q); + } + + @Test + public void hasRuleTest() { + assertTrue(ei.hasRule(new EdgeRuleQuery.Builder("l-interface").version(Version.V11).build())); + assertFalse(ei.hasRule(new EdgeRuleQuery.Builder("l-interface").build())); + } + + @Test + public void getCousinRulesTest() { + Multimap results = ei.getCousinRules("dog"); + assertTrue(results.size() == 2); + assertTrue(results.containsKey("dog|puppy")); + assertTrue(results.containsKey("dog|foo")); + } + + @Test + public void getCousinRulesWithVersionTest() { + Multimap results = ei.getCousinRules("foo", Version.V10); + assertTrue(results.size() == 2); + assertTrue(results.containsKey("bar|foo")); + assertTrue(results.get("bar|foo").size() == 2); + } + + @Test + public void getCousinsNoneInVersionTest() { + Multimap results = ei.getCousinRules("foo", Version.V11); + assertTrue(results.isEmpty()); + } + + @Test + public void hasCousinTest() { + assertTrue(ei.hasCousinRule("foo")); + assertTrue(ei.hasCousinRule("foo", Version.V10)); + assertFalse(ei.hasCousinRule("parent")); + assertFalse(ei.hasCousinRule("foo", Version.V11)); + } + + @Test + public void getChildRulesTest() { + Multimap results = ei.getChildRules("parent"); + assertTrue(results.size() == 6); + assertTrue(results.containsKey("notation|parent")); + assertTrue(results.containsKey("not-notation|parent")); + assertTrue(results.containsKey("out-out|parent")); + assertTrue(results.containsKey("in-in|parent")); + assertTrue(results.containsKey("in-out|parent")); + assertTrue(results.containsKey("out-in|parent")); + } + + @Test + public void getChildRulesWithVersionTest() { + Multimap results = ei.getChildRules("foo", Version.V10); + assertTrue(results.size() == 2); + assertTrue(results.containsKey("baz|foo")); + assertTrue(results.containsKey("foo|quux")); + } + + @Test + public void getChildRulesNoneInVersionTest() { + Multimap results = ei.getChildRules("foo", Version.V11); + assertTrue(results.isEmpty()); + } + + @Test + public void hasChildTest() { + assertTrue(ei.hasChildRule("foo")); + assertTrue(ei.hasChildRule("foo", Version.V10)); + assertFalse(ei.hasChildRule("puppy")); + assertFalse(ei.hasChildRule("foo", Version.V11)); + } + + @Test + public void getParentRulesTest() { + Multimap results = ei.getParentRules("parent"); + assertTrue(results.size() == 6); + assertTrue(results.containsKey("grandparent1|parent")); + assertTrue(results.containsKey("grandparent2|parent")); + assertTrue(results.containsKey("grandparent3|parent")); + assertTrue(results.containsKey("grandparent4|parent")); + assertTrue(results.containsKey("grandparent5|parent")); + assertTrue(results.containsKey("grandparent6|parent")); + } + + @Test + public void getParentRulesWithVersionTest() { + Multimap results = ei.getParentRules("baz", Version.V10); + assertTrue(results.size() == 1); + assertTrue(results.containsKey("baz|foo")); + } + + @Test + public void getParentRulesNoneInVersionTest() { + Multimap results = ei.getParentRules("baz", Version.V11); + assertTrue(results.isEmpty()); + } + + @Test + public void hasParentTest() { + assertTrue(ei.hasParentRule("parent")); + assertTrue(ei.hasParentRule("quux", Version.V10)); + assertFalse(ei.hasParentRule("puppy")); + assertFalse(ei.hasParentRule("foo", Version.V11)); + } + + @Test + public void getAllCurrentRulesTest() throws EdgeRuleNotFoundException { + Multimap res = ei.getAllCurrentRules(); + assertTrue(res.size() == 18); + } + + @Test + public void getAllRulesTest() throws EdgeRuleNotFoundException { + Multimap res = ei.getAllRules(Version.V10); + assertTrue(res.size() == 4); + assertTrue(res.containsKey("bar|foo")); + assertTrue(res.get("bar|foo").size() == 2); + assertTrue(res.containsKey("baz|foo")); + assertTrue(res.containsKey("foo|quux")); + + thrown.expect(EdgeRuleNotFoundException.class); + thrown.expectMessage("No rules found for version V9."); + ei.getAllRules(Version.V9); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java new file mode 100644 index 00000000..74aceb51 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeIngestorWiringTest.java @@ -0,0 +1,58 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; +import org.onap.aai.testutils.ConfigTranslatorForWiringTest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.google.common.collect.Multimap; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class, ConfigTranslatorForWiringTest.class, EdgeIngestor.class}) +@TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/forWiringTests/schemaIngestWiringTest.properties"}) +@SpringBootTest +public class EdgeIngestorWiringTest { + @Autowired + EdgeIngestor ei; + + @Test + public void test() throws EdgeRuleNotFoundException { + assertNotNull(ei); + EdgeRuleQuery q = new EdgeRuleQuery.Builder("quux", "foo").label("dancesWith").version(Version.V10).build(); + Multimap results = ei.getRules(q); + assertTrue(results.size() == 1); + assertTrue(results.containsKey("foo|quux")); + } + +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java new file mode 100644 index 00000000..f21246cb --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/EdgeRuleQueryTest.java @@ -0,0 +1,135 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.edges; + +import static org.junit.Assert.*; + +import java.io.InputStream; +import java.util.List; +import java.util.Scanner; + +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.edges.enums.EdgeType; + +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; + +public class EdgeRuleQueryTest { + private DocumentContext testRules; + private String readStart = "$.rules.[?]"; + + /* **** DATA SETUP **** */ + @Before + public void setup() { + InputStream is = getClass().getResourceAsStream("/edgeRules/test.json"); + + Scanner scanner = new Scanner(is); + String json = scanner.useDelimiter("\\Z").next(); + scanner.close(); + + this.testRules = JsonPath.parse(json); + } + + /* **** TESTS **** */ + @Test + public void testFromToSingle() { + //rule defined from quux to foo + EdgeRuleQuery q = new EdgeRuleQuery.Builder("quux", "foo").build(); + List results = testRules.read(readStart, q.getFilter()); + + assertTrue(results.size() == 1); + } + + @Test + public void testToFromSingle() { + //rule defined from quux to foo, this is flipped + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo", "quux").build(); + List results = testRules.read(readStart, q.getFilter()); + + assertTrue(results.size() == 1); + } + + @Test + public void testFromToMultiple() { + //rules have two from foo to bar + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo", "bar").build(); + List results = testRules.read(readStart, q.getFilter()); + assertTrue(results.size() == 2); + } + + @Test + public void testToFromMultiple() { + //rules have two from foo to bar + EdgeRuleQuery q = new EdgeRuleQuery.Builder("bar", "foo").build(); + List results = testRules.read(readStart, q.getFilter()); + + assertTrue(results.size() == 2); + assertTrue(!(results.get(0).toString().equals(results.get(1).toString()))); + } + + @Test + public void testJustFrom() { + //there are 4 foo rules (foo>bar, foo>bar, foo>baz, quux>foo) + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").build(); + List results = testRules.read(readStart, q.getFilter()); + assertTrue(results.size() == 4); + + //there are 2 bar rules + EdgeRuleQuery q2 = new EdgeRuleQuery.Builder("bar").build(); + List results2 = testRules.read(readStart, q2.getFilter()); + assertTrue(results2.size() == 2); + } + + @Test + public void testWithLabel() { + //there are foo >eats> bar and foo >eatz> bar + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo","bar").label("eatz").build(); + List results = testRules.read(readStart, q.getFilter()); + assertTrue(results.size() == 1); + assertTrue(results.get(0).toString().contains("eatz")); + } + + @Test + public void testCousin() { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").edgeType(EdgeType.COUSIN).build(); + List results = testRules.read(readStart, q.getFilter()); + assertTrue(results.size() == 2); + + EdgeRuleQuery q2 = new EdgeRuleQuery.Builder("foo", "bar").edgeType(EdgeType.COUSIN).label("eats").build(); + List results2 = testRules.read(readStart, q2.getFilter()); + assertTrue(results2.size() == 1); + assertTrue(results2.get(0).toString().contains("eats")); + + EdgeRuleQuery q3 = new EdgeRuleQuery.Builder("foo","quux").edgeType(EdgeType.COUSIN).build(); + List results3 = testRules.read(readStart, q3.getFilter()); + assertTrue(results3.isEmpty()); + } + + @Test + public void testTree() { + EdgeRuleQuery q = new EdgeRuleQuery.Builder("foo").edgeType(EdgeType.TREE).build(); + List results = testRules.read(readStart, q.getFilter()); + assertTrue(results.size() == 2); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java new file mode 100644 index 00000000..08507a34 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorTest.java @@ -0,0 +1,84 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.nodes; + +import static org.junit.Assert.*; + +import org.eclipse.persistence.dynamic.DynamicEntity; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; +import org.onap.aai.testutils.TestUtilConfigTranslator; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class, TestUtilConfigTranslator.class, NodeIngestor.class}) +@SpringBootTest +public class NodeIngestorTest { + @Autowired + NodeIngestor ni; + + //set thrown.expect to whatever a specific test needs + //this establishes a default of expecting no exceptions to be thrown + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void test() { + DynamicJAXBContext ctx10 = ni.getContextForVersion(Version.V10); + + //should work bc Foo is valid in test_network_v10 schema + DynamicEntity foo10 = ctx10.newDynamicEntity("Foo"); + foo10.set("fooId","bar"); + assertTrue("bar".equals(foo10.get("fooId"))); + + //should work bc Bar is valid in test_business_v10 schema + DynamicEntity bar10 = ctx10.newDynamicEntity("Bar"); + bar10.set("barId","bar2"); + assertTrue("bar2".equals(bar10.get("barId"))); + + + DynamicJAXBContext ctx11 = ni.getContextForVersion(Version.V11); + + //should work bc Foo.quantity is valid in test_network_v11 schema + DynamicEntity foo11 = ctx11.newDynamicEntity("Foo"); + foo11.set("quantity","12"); + assertTrue("12".equals(foo11.get("quantity"))); + + DynamicEntity quux11 = ctx11.newDynamicEntity("Quux"); + quux11.set("qManagerName","some guy"); + assertTrue("some guy".equals(quux11.get("qManagerName"))); + + + thrown.expect(IllegalArgumentException.class); + //should fail bc Quux not in v10 test schema + ctx10.newDynamicEntity("Quux"); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java new file mode 100644 index 00000000..e62cc6ab --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/nodes/NodeIngestorWiringTest.java @@ -0,0 +1,57 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.nodes; + +import static org.junit.Assert.*; + +import org.eclipse.persistence.dynamic.DynamicEntity; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; +import org.onap.aai.testutils.ConfigTranslatorForWiringTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class, ConfigTranslatorForWiringTest.class, NodeIngestor.class}) +@TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/forWiringTests/schemaIngestWiringTest.properties"}) +@SpringBootTest +public class NodeIngestorWiringTest { + @Autowired + NodeIngestor ni; + + @Test + public void test() { + DynamicJAXBContext ctx10 = ni.getContextForVersion(Version.V10); + + //should work bc Bar is valid in test_business_v10 schema + DynamicEntity bar10 = ctx10.newDynamicEntity("Bar"); + bar10.set("barId","bar2"); + assertTrue("bar2".equals(bar10.get("barId"))); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java new file mode 100644 index 00000000..9d66551b --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/ConfigTranslatorWiringTest.java @@ -0,0 +1,61 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import static org.junit.Assert.*; + +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.testutils.ConfigTranslatorForWiringTest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class, ConfigTranslatorForWiringTest.class}) +@TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/forWiringTests/schemaIngestWiringTest.properties"}) +@SpringBootTest +public class ConfigTranslatorWiringTest { + @Autowired + ConfigTranslator ct; + + @Test + public void test() { + assertNotNull(ct); + Map> nodes = ct.getNodeFiles(); + assertTrue(nodes.containsKey(Version.V10)); + assertTrue(1 == nodes.get(Version.V10).size()); + assertTrue("src/test/resources/oxm/test_business_v10.xml".equals(nodes.get(Version.V10).get(0))); + + Map> edges = ct.getEdgeFiles(); + assertTrue(edges.containsKey(Version.V10)); + assertTrue(1 == edges.get(Version.V10).size()); + assertTrue("src/test/resources/edgeRules/test.json".equals(edges.get(Version.V10).get(0))); + } + +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java new file mode 100644 index 00000000..5074f913 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanDefaultInjectionTest.java @@ -0,0 +1,46 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class}) +public class SchemaLocationsBeanDefaultInjectionTest { + @Autowired + SchemaLocationsBean bean; + + @Test + public void test() { + assertNotNull(bean); + assertTrue("foo".equals(bean.getSchemaConfigLocation())); + assertTrue("bar".equals(bean.getNodeDirectory())); + assertTrue("quux".equals(bean.getEdgeDirectory())); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java new file mode 100644 index 00000000..f9d6b620 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanEnvVarInjectionTest.java @@ -0,0 +1,48 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {SchemaLocationsBean.class}) +@TestPropertySource(properties = {"schemaIngestPropLoc = src/test/resources/forWiringTests/schemaIngest2.properties"}) +public class SchemaLocationsBeanEnvVarInjectionTest { + @Autowired + SchemaLocationsBean bean; + + @Test + public void test() { + assertNotNull(bean); + assertTrue("testConfig.json".equals(bean.getSchemaConfigLocation())); + assertTrue("bloop/blap".equals(bean.getNodeDirectory())); + assertTrue("different".equals(bean.getEdgeDirectory())); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java new file mode 100644 index 00000000..0a22bbb0 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterTest.java @@ -0,0 +1,46 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = { "classpath:forWiringTests/testContext.xml"}) +public class SchemaLocationsBeanXMLSetterTest { + @Autowired + SchemaLocationsBean bean; + + @Test + public void test() { + assertNotNull(bean); + assertTrue("fromXML".equals(bean.getSchemaConfigLocation())); + assertTrue("whatAnXML".equals(bean.getNodeDirectory())); + assertTrue("XMLwiringYAY".equals(bean.getEdgeDirectory())); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java new file mode 100644 index 00000000..4604b045 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/setup/SchemaLocationsBeanXMLSetterWithPropFileTest.java @@ -0,0 +1,46 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.setup; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = { "classpath:forWiringTests/testUsingPropFileContext.xml"}) +public class SchemaLocationsBeanXMLSetterWithPropFileTest { + @Autowired + SchemaLocationsBean bean; + + @Test + public void test() { + assertNotNull(bean); + assertTrue("imatest".equals(bean.getSchemaConfigLocation())); + assertTrue("andIMalittleteapot".equals(bean.getNodeDirectory())); + assertTrue("meh".equals(bean.getEdgeDirectory())); + } +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java new file mode 100644 index 00000000..5e1b6c82 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/ConfigTranslatorForWiringTest.java @@ -0,0 +1,60 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.testutils; + +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; + +import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; + +public class ConfigTranslatorForWiringTest extends ConfigTranslator { + + public ConfigTranslatorForWiringTest(SchemaLocationsBean bean) { + super(bean); + } + + @Override + public Map> getNodeFiles() { + String f = bean.getNodeDirectory() + "test_business_v10.xml"; + List files = new ArrayList<>(); + files.add(f); + Map> mp = new EnumMap<>(Version.class); + mp.put(Version.V10, files); + return mp; + } + + @Override + public Map> getEdgeFiles() { + String f = bean.getEdgeDirectory() + "test.json"; + List files = new ArrayList<>(); + files.add(f); + Map> mp = new EnumMap<>(Version.class); + mp.put(Version.V10, files); + return mp; + } + +} diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java new file mode 100644 index 00000000..785b7403 --- /dev/null +++ b/aai-schema-ingest/src/test/java/org/onap/aai/testutils/TestUtilConfigTranslator.java @@ -0,0 +1,76 @@ +/** + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright © 2017 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========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.aai.testutils; + +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; + +import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.Version; + +public class TestUtilConfigTranslator extends ConfigTranslator { + + public TestUtilConfigTranslator(SchemaLocationsBean bean) { + super(bean); + } + + @Override + public Map> getNodeFiles() { + List files10 = new ArrayList<>(); + files10.add("src/test/resources/oxm/test_network_v10.xml"); + files10.add("src/test/resources/oxm/test_business_v10.xml"); + + List files11 = new ArrayList<>(); + files11.add("src/test/resources/oxm/test_network_v11.xml"); + files11.add("src/test/resources/oxm/test_business_v11.xml"); + + Map> input = new EnumMap<>(Version.class); + input.put(Version.V10, files10); + input.put(Version.V11, files11); + return input; + } + + @Override + public Map> getEdgeFiles() { + List files = new ArrayList<>(); + files.add("src/test/resources/edgeRules/test.json"); + files.add("src/test/resources/edgeRules/test2.json"); + files.add("src/test/resources/edgeRules/otherTestRules.json"); + Map> input = new EnumMap<>(Version.class); + input.put(Version.getLatest(), files); + + List files2 = new ArrayList<>(); + files2.add("src/test/resources/edgeRules/test.json"); + input.put(Version.V10, files2); + + List files3 = new ArrayList<>(); + files3.add("src/test/resources/edgeRules/test3.json"); + files3.add("src/test/resources/edgeRules/defaultEdgesTest.json"); + input.put(Version.V11, files3); + + return input; + } +} diff --git a/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json b/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json new file mode 100644 index 00000000..2f4baed6 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/defaultEdgesTest.json @@ -0,0 +1,52 @@ +{ + "rules": [ + { + "from": "apple", + "to": "orange", + "label": "sitsBy", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"for testing pairs with no default" + }, + { + "from": "apple", + "to": "orange", + "label": "makesSaladWith", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"for testing pairs with no default" + }, + { + "from": "seed", + "to": "plant", + "label": "grows", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "seed", + "to": "plant", + "label": "becomes", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json b/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json new file mode 100644 index 00000000..881239f6 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/otherTestRules.json @@ -0,0 +1,136 @@ +{ + "rules": [ + { + "from": "parent", + "to": "notation", + "label": "has", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains notation" + }, + { + "from": "not-notation", + "to": "parent", + "label": "contains", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains not-notation" + }, + { + "from": "parent", + "to": "out-out", + "label": "eats", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains out-out" + }, + { + "from": "parent", + "to": "in-in", + "label": "verbs", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains in-in" + }, + { + "from": "out-in", + "to": "parent", + "label": "alarms", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains out-in" + }, + { + "from": "in-out", + "to": "parent", + "label": "befriends", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contains in-out" + }, + { + "from": "parent", + "to": "grandparent1", + "label": "has", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent1" + }, + { + "from": "grandparent2", + "to": "parent", + "label": "contains", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent2" + }, + { + "from": "parent", + "to": "grandparent3", + "label": "eats", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent3" + }, + { + "from": "parent", + "to": "grandparent4", + "label": "verbs", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent4" + }, + { + "from": "grandparent5", + "to": "parent", + "label": "alarms", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "OUT", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent5" + }, + { + "from": "grandparent6", + "to": "parent", + "label": "befriends", + "direction": "IN", + "multiplicity": "Many2Many", + "contains-other-v": "IN", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "description": "parent contained by grandparent6" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test.json b/aai-schema-ingest/src/test/resources/edgeRules/test.json new file mode 100644 index 00000000..66691ebf --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test.json @@ -0,0 +1,48 @@ +{ + "rules": [ + { + "from": "foo", + "to": "bar", + "label": "eats", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "foo", + "to": "bar", + "label": "eatz", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "foo", + "to": "baz", + "label": "isVeryHappyAbout", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "${direction}", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "quux", + "to": "foo", + "label": "dancesWith", + "direction": "IN", + "multiplicity": "One2Many", + "contains-other-v": "!${direction}", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test2.json b/aai-schema-ingest/src/test/resources/edgeRules/test2.json new file mode 100644 index 00000000..7d94e41c --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test2.json @@ -0,0 +1,27 @@ +{ + "rules": [ + { + "from": "foo", + "to": "dog", + "label": "pets", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe" + }, + { + "from": "dog", + "to": "puppy", + "label": "caresFor", + "direction": "OUT", + "multiplicity": "One2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe", + "default": "true" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test3.json b/aai-schema-ingest/src/test/resources/edgeRules/test3.json new file mode 100644 index 00000000..916efdcc --- /dev/null +++ b/aai-schema-ingest/src/test/resources/edgeRules/test3.json @@ -0,0 +1,64 @@ +{ + "rules": [ + { + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Source", + "direction": "OUT", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" + }, + { + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Destination", + "direction": "OUT", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" + }, + { + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "lag-interface", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + } + ] +} \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties new file mode 100644 index 00000000..fb20eba2 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngest2.properties @@ -0,0 +1,3 @@ +schemaConfig=testConfig.json +nodeDir=bloop/blap +edgeDir=different \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties new file mode 100644 index 00000000..11e5fb47 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestForXMLTest.properties @@ -0,0 +1,3 @@ +schemaConfig=imatest +nodeDir=andIMalittleteapot +edgeDir=meh \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties new file mode 100644 index 00000000..8bff7d4d --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/schemaIngestWiringTest.properties @@ -0,0 +1,3 @@ +schemaConfig=NA +nodeDir=src/test/resources/oxm/ +edgeDir=src/test/resources/edgeRules/ \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml b/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml new file mode 100644 index 00000000..592c2661 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/testContext.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml new file mode 100644 index 00000000..7c3302f0 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/forWiringTests/testUsingPropFileContext.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml new file mode 100644 index 00000000..5ead4178 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_business_v10.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml b/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml new file mode 100644 index 00000000..39a3ca9b --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_business_v11.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml new file mode 100644 index 00000000..e7d77ac9 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_network_v10.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml b/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml new file mode 100644 index 00000000..9ede62d4 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/oxm/test_network_v11.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aai-schema-ingest/src/test/resources/schemaIngest.properties b/aai-schema-ingest/src/test/resources/schemaIngest.properties new file mode 100644 index 00000000..3112c994 --- /dev/null +++ b/aai-schema-ingest/src/test/resources/schemaIngest.properties @@ -0,0 +1,3 @@ +schemaConfig=foo +nodeDir=bar +edgeDir=quux \ No newline at end of file diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v10.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v10.html index 5c6001cc..0fe66c2d 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v10.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v10.html @@ -158258,6 +158258,256 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen +
+
+

hpa-capabilities: + object + + + +

+
+
+
+

Collection of HPA Capabilities

+ +
+ +
+
+
+ hpa-capability: + object[] + + +
+
+ +
+ +
+ hpa-capability + + + +
+ +
+
+
+
+
+
+
+
+
+

hpa-capability: + object + + + +

+
+
+
+

Represents a HPA capability

+ +
    +
  • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
  • +
  • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
  • +
  • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
  • +
  • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
+ +
+ +
+
+
+ hpa-capability-id: + string + + + +
+
+

UUID to uniquely identify a HPA capability

+
+ +
+
+
+ hpa-feature: + string + + + +
+
+

Name of the HPACapability

+
+ +
+
+
+ hpa-version: + string + + +
+
+

HPA schema version

+
+ +
+
+
+ hpa-hw-arch: + string + + +
+
+

Hardware architecture

+
+ +
+
+
+ resource-version: + string + + +
+
+

Used for optimistic concurrency. Must be empty on create, valid on update and delete.

+
+ +
+
+
+ relationship-list: + object[] + + +
+
+ +
+ +
+ relationship + + + +
+ +
+
+
+
+ hpa-feature-attributes: + object[] + + +
+
+ +
+ +
+ hpa-feature-attributes + + + +
+ +
+
+
+
+
+
+
+
+
+

hpa-feature-attributes: + object + + + +

+
+
+
+

HPA Capability Feature attributes

+ +
    +
  • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
+ +
+ +
+
+
+ hpa-attr-key: + string + + +
+
+

name of the specific HPA attribute

+
+ +
+
+
+ hpa-attr-value: + string + + +
+
+

JSON string specifying the value, unit and type of the specific HPA attribute

+
+ +
+
+
+ resource-version: + string + + +
+
+

Used for optimistic concurrency. Must be empty on create, valid on update and delete.

+
+ +
+
+
+ relationship-list: + object[] + + +
+
+ +
+ +
+ relationship + + + +
+ +
+
+
+
+
+
+

image: diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v11.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v11.html index 06cb9d46..7f95ad56 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v11.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v11.html @@ -171163,6 +171163,256 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

+
+
+

hpa-capabilities: + object + + + +

+
+
+
+

Collection of HPA Capabilities

+ +
+ +
+
+
+ hpa-capability: + object[] + + +
+
+ +
+ +
+ hpa-capability + + + +
+ +
+
+
+
+
+
+
+
+
+

hpa-capability: + object + + + +

+
+
+
+

Represents a HPA capability

+ +
    +
  • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
  • +
  • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
  • +
  • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
  • +
  • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
+ +
+ +
+
+
+ hpa-capability-id: + string + + + +
+
+

UUID to uniquely identify a HPA capability

+
+ +
+
+
+ hpa-feature: + string + + + +
+
+

Name of the HPACapability

+
+ +
+
+
+ hpa-version: + string + + +
+
+

HPA schema version

+
+ +
+
+
+ hpa-hw-arch: + string + + +
+
+

Hardware architecture

+
+ +
+
+
+ resource-version: + string + + +
+
+

Used for optimistic concurrency. Must be empty on create, valid on update and delete.

+
+ +
+
+
+ relationship-list: + object[] + + +
+
+ +
+ +
+ relationship + + + +
+ +
+
+
+
+ hpa-feature-attributes: + object[] + + +
+
+ +
+ +
+ hpa-feature-attributes + + + +
+ +
+
+
+
+
+
+
+
+
+

hpa-feature-attributes: + object + + + +

+
+
+
+

HPA Capability Feature attributes

+ +
    +
  • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
+ +
+ +
+
+
+ hpa-attr-key: + string + + +
+
+

name of the specific HPA attribute

+
+ +
+
+
+ hpa-attr-value: + string + + +
+
+

JSON string specifying the value, unit and type of the specific HPA attribute

+
+ +
+
+
+ resource-version: + string + + +
+
+

Used for optimistic concurrency. Must be empty on create, valid on update and delete.

+
+ +
+
+
+ relationship-list: + object[] + + +
+
+ +
+ +
+ relationship + + + +
+ +
+
+
+
+
+
+

image: diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v12.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v12.html index cb7b5f33..056c3248 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v12.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v12.html @@ -197,17 +197,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen - GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute -

returns hpa-feature-attribute

+ GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes +

returns hpa-feature-attributes

- PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

see node definition for valid relationships

- DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

delete an existing relationship

@@ -292,17 +292,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen - GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute -

returns hpa-feature-attribute

+ GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes +

returns hpa-feature-attributes

- PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

see node definition for valid relationships

- DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

delete an existing relationship

@@ -19618,17 +19618,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

- -
+ +
-
returns hpa-feature-attribute
-

GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute

+
returns hpa-feature-attributes
+

GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes

Tags: CloudInfrastructure
-

returns hpa-feature-attribute

+

returns hpa-feature-attributes

@@ -19808,7 +19808,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
@@ -19836,11 +19836,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
- -
+ +
see node definition for valid relationships
-

PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

+

PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

Tags: CloudInfrastructure
@@ -19855,7 +19855,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

-

relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json)

+

relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json)

@@ -19973,11 +19973,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
- -
+ +
delete an existing relationship
-

DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

+

DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

Tags: CloudInfrastructure
@@ -22210,17 +22210,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
- -
+ +
-
returns hpa-feature-attribute
-

GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute

+
returns hpa-feature-attributes
+

GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes

Tags: CloudInfrastructure
-

returns hpa-feature-attribute

+

returns hpa-feature-attributes

@@ -22369,7 +22369,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
@@ -22397,11 +22397,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
- -
+ +
see node definition for valid relationships
-

PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

+

PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

Tags: CloudInfrastructure
@@ -22416,7 +22416,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

-

relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json)

+

relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json)

@@ -22518,11 +22518,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
- -
+ +
delete an existing relationship
-

DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

+

DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

Tags: CloudInfrastructure
@@ -177239,7 +177239,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
  • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
  • -
  • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
+
  • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
  • +
  • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
  • +
  • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
  • @@ -177327,8 +177329,8 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    -
    - hpa-feature-attribute: +
    + hpa-feature-attributes: object[] @@ -177338,7 +177340,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - hpa-feature-attribute + hpa-feature-attributes @@ -177351,9 +177353,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    -
    +
    -

    hpa-feature-attribute: +

    hpa-feature-attributes: object @@ -177363,6 +177365,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    HPA Capability Feature attributes

    + +
      +
    • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v13.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v13.html index 1fe7357c..0441d6c5 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v13.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v13.html @@ -197,17 +197,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen - GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute -

    returns hpa-feature-attribute

    + GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes +

    returns hpa-feature-attributes

    - PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    see node definition for valid relationships

    - DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    delete an existing relationship

    @@ -292,17 +292,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen - GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute -

    returns hpa-feature-attribute

    + GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes +

    returns hpa-feature-attributes

    - PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    see node definition for valid relationships

    - DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship + DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    delete an existing relationship

    @@ -19618,17 +19618,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    - -
    + +
    -
    returns hpa-feature-attribute
    -

    GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute

    +
    returns hpa-feature-attributes
    +

    GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes

    Tags: CloudInfrastructure
    -

    returns hpa-feature-attribute

    +

    returns hpa-feature-attributes

    @@ -19808,7 +19808,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    @@ -19836,11 +19836,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - -
    + +
    see node definition for valid relationships
    -

    PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

    +

    PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    Tags: CloudInfrastructure
    @@ -19855,7 +19855,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    -

    relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json)

    +

    relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json)

    @@ -19973,11 +19973,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - -
    + +
    delete an existing relationship
    -

    DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

    +

    DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    Tags: CloudInfrastructure
    @@ -22210,17 +22210,17 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - -
    + +
    -
    returns hpa-feature-attribute
    -

    GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute

    +
    returns hpa-feature-attributes
    +

    GET /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes

    Tags: CloudInfrastructure
    -

    returns hpa-feature-attribute

    +

    returns hpa-feature-attributes

    @@ -22369,7 +22369,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    @@ -22397,11 +22397,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - -
    + +
    see node definition for valid relationships
    -

    PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

    +

    PUT /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    Tags: CloudInfrastructure
    @@ -22416,7 +22416,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    -

    relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json)

    +

    relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json)

    @@ -22518,11 +22518,11 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - -
    + +
    delete an existing relationship
    -

    DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship

    +

    DELETE /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship

    Tags: CloudInfrastructure
    @@ -177239,7 +177239,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
    • -
    • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
    +
  • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
  • +
  • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
  • +
  • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
  • @@ -177327,8 +177329,8 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    -
    - hpa-feature-attribute: +
    + hpa-feature-attributes: object[] @@ -177338,7 +177340,7 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    - hpa-feature-attribute + hpa-feature-attributes @@ -177351,9 +177353,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen
    -
    +
    -

    hpa-feature-attribute: +

    hpa-feature-attributes: object @@ -177363,6 +177365,9 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    HPA Capability Feature attributes

    + +
      +
    • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v8.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v8.html index be07b77b..ae582f20 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v8.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v8.html @@ -143063,6 +143063,256 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    +
    +
    +

    hpa-capabilities: + object + + + +

    +
    +
    +
    +

    Collection of HPA Capabilities

    + +
    + +
    +
    +
    + hpa-capability: + object[] + + +
    +
    + +
    + +
    + hpa-capability + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    hpa-capability: + object + + + +

    +
    +
    +
    +

    Represents a HPA capability

    + +
      +
    • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
    • +
    • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
    • +
    • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    • +
    • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
    + +
    + +
    +
    +
    + hpa-capability-id: + string + + + +
    +
    +

    UUID to uniquely identify a HPA capability

    +
    + +
    +
    +
    + hpa-feature: + string + + + +
    +
    +

    Name of the HPACapability

    +
    + +
    +
    +
    + hpa-version: + string + + +
    +
    +

    HPA schema version

    +
    + +
    +
    +
    + hpa-hw-arch: + string + + +
    +
    +

    Hardware architecture

    +
    + +
    +
    +
    + resource-version: + string + + +
    +
    +

    Used for optimistic concurrency. Must be empty on create, valid on update and delete.

    +
    + +
    +
    +
    + relationship-list: + object[] + + +
    +
    + +
    + +
    + relationship + + + +
    + +
    +
    +
    +
    + hpa-feature-attributes: + object[] + + +
    +
    + +
    + +
    + hpa-feature-attributes + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    hpa-feature-attributes: + object + + + +

    +
    +
    +
    +

    HPA Capability Feature attributes

    + +
      +
    • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    + +
    + +
    +
    +
    + hpa-attr-key: + string + + +
    +
    +

    name of the specific HPA attribute

    +
    + +
    +
    +
    + hpa-attr-value: + string + + +
    +
    +

    JSON string specifying the value, unit and type of the specific HPA attribute

    +
    + +
    +
    +
    + resource-version: + string + + +
    +
    +

    Used for optimistic concurrency. Must be empty on create, valid on update and delete.

    +
    + +
    +
    +
    + relationship-list: + object[] + + +
    +
    + +
    + +
    + relationship + + + +
    + +
    +
    +
    +
    +
    +
    +

    image: diff --git a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v9.html b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v9.html index e8dae82f..80444e13 100644 --- a/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v9.html +++ b/aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v9.html @@ -155365,6 +155365,256 @@ This document is best viewed with Firefox or Chrome. Nodes can be found by appen

    +
    +
    +

    hpa-capabilities: + object + + + +

    +
    +
    +
    +

    Collection of HPA Capabilities

    + +
    + +
    +
    +
    + hpa-capability: + object[] + + +
    +
    + +
    + +
    + hpa-capability + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    hpa-capability: + object + + + +

    +
    +
    +
    +

    Represents a HPA capability

    + +
      +
    • TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE)
    • +
    • TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE)
    • +
    • FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    • +
    • HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES
    + +
    + +
    +
    +
    + hpa-capability-id: + string + + + +
    +
    +

    UUID to uniquely identify a HPA capability

    +
    + +
    +
    +
    + hpa-feature: + string + + + +
    +
    +

    Name of the HPACapability

    +
    + +
    +
    +
    + hpa-version: + string + + +
    +
    +

    HPA schema version

    +
    + +
    +
    +
    + hpa-hw-arch: + string + + +
    +
    +

    Hardware architecture

    +
    + +
    +
    +
    + resource-version: + string + + +
    +
    +

    Used for optimistic concurrency. Must be empty on create, valid on update and delete.

    +
    + +
    +
    +
    + relationship-list: + object[] + + +
    +
    + +
    + +
    + relationship + + + +
    + +
    +
    +
    +
    + hpa-feature-attributes: + object[] + + +
    +
    + +
    + +
    + hpa-feature-attributes + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    hpa-feature-attributes: + object + + + +

    +
    +
    +
    +

    HPA Capability Feature attributes

    + +
      +
    • TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE)
    + +
    + +
    +
    +
    + hpa-attr-key: + string + + +
    +
    +

    name of the specific HPA attribute

    +
    + +
    +
    +
    + hpa-attr-value: + string + + +
    +
    +

    JSON string specifying the value, unit and type of the specific HPA attribute

    +
    + +
    +
    +
    + resource-version: + string + + +
    +
    +

    Used for optimistic concurrency. Must be empty on create, valid on update and delete.

    +
    + +
    +
    +
    + relationship-list: + object[] + + +
    +
    + +
    + +
    + relationship + + + +
    + +
    +
    +
    +
    +
    +
    +

    image: diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v10.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v10.yaml index aaa008d4..98425494 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v10.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v10.yaml @@ -50007,6 +50007,68 @@ definitions: type: array items: $ref: "#/definitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/definitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" image: description: | Openstack image. @@ -54851,6 +54913,50 @@ patchDefinitions: type: array items: $ref: "#/patchDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/patchDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute image: description: | Openstack image. @@ -59210,6 +59316,68 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/getDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" image: description: | Openstack image. diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v11.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v11.yaml index 5e6105e4..7b6536a6 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v11.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v11.yaml @@ -54037,6 +54037,68 @@ definitions: type: array items: $ref: "#/definitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/definitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" image: description: | Openstack image. @@ -59109,6 +59171,50 @@ patchDefinitions: type: array items: $ref: "#/patchDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/patchDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute image: description: | Openstack image. @@ -63680,6 +63786,68 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/getDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" image: description: | Openstack image. diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v12.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v12.yaml index 85226a40..db6978d7 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v12.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v12.yaml @@ -5362,12 +5362,12 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship: put: tags: - CloudInfrastructure summary: see node definition for valid relationships - operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -5404,7 +5404,7 @@ paths: example: __HPA-CAPABILITY-ID__ - name: body in: body - description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json) + description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json) required: true schema: $ref: "#/definitions/relationship" @@ -5413,7 +5413,7 @@ paths: - CloudInfrastructure summary: delete an existing relationship description: delete an existing relationship - operationId: deleteCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: deleteCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -5448,13 +5448,13 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes: get: tags: - CloudInfrastructure - summary: returns hpa-feature-attribute - description: returns hpa-feature-attribute - operationId: getCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute + summary: returns hpa-feature-attributes + description: returns hpa-feature-attributes + operationId: getCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes produces: - application/json - application/xml @@ -5462,7 +5462,7 @@ paths: "200": description: successful operation schema: - $ref: "#/getDefinitions/hpa-feature-attribute" + $ref: "#/getDefinitions/hpa-feature-attributes" "default": description: Response codes found in [response codes](https://wiki.onap.org/). parameters: @@ -8870,12 +8870,12 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship: put: tags: - CloudInfrastructure summary: see node definition for valid relationships - operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -8906,7 +8906,7 @@ paths: example: __HPA-CAPABILITY-ID__ - name: body in: body - description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json) + description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v12/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json) required: true schema: $ref: "#/definitions/relationship" @@ -8915,7 +8915,7 @@ paths: - CloudInfrastructure summary: delete an existing relationship description: delete an existing relationship - operationId: deleteCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: deleteCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -8944,13 +8944,13 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes: get: tags: - CloudInfrastructure - summary: returns hpa-feature-attribute - description: returns hpa-feature-attribute - operationId: getCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute + summary: returns hpa-feature-attributes + description: returns hpa-feature-attributes + operationId: getCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes produces: - application/json - application/xml @@ -8958,7 +8958,7 @@ paths: "200": description: successful operation schema: - $ref: "#/getDefinitions/hpa-feature-attribute" + $ref: "#/getDefinitions/hpa-feature-attributes" "default": description: Response codes found in [response codes](https://wiki.onap.org/). parameters: @@ -55909,6 +55909,8 @@ definitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -55932,13 +55934,15 @@ definitions: type: array items: $ref: "#/definitions/relationship" - hpa-feature-attribute: + hpa-feature-attributes: type: array items: - $ref: "#/definitions/hpa-feature-attribute" - hpa-feature-attribute: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string @@ -61098,6 +61102,8 @@ patchDefinitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -61114,9 +61120,11 @@ patchDefinitions: hpa-hw-arch: type: string description: Hardware architecture - hpa-feature-attribute: + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string @@ -65776,6 +65784,8 @@ getDefinitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -65799,13 +65809,15 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/relationship" - hpa-feature-attribute: + hpa-feature-attributes: type: array items: - $ref: "#/getDefinitions/hpa-feature-attribute" - hpa-feature-attribute: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v13.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v13.yaml index 45033060..08e7daf6 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v13.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v13.yaml @@ -5362,12 +5362,12 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship: put: tags: - CloudInfrastructure summary: see node definition for valid relationships - operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -5404,7 +5404,7 @@ paths: example: __HPA-CAPABILITY-ID__ - name: body in: body - description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json) + description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json) required: true schema: $ref: "#/definitions/relationship" @@ -5413,7 +5413,7 @@ paths: - CloudInfrastructure summary: delete an existing relationship description: delete an existing relationship - operationId: deleteCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: deleteCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -5448,13 +5448,13 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes: get: tags: - CloudInfrastructure - summary: returns hpa-feature-attribute - description: returns hpa-feature-attribute - operationId: getCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttribute + summary: returns hpa-feature-attributes + description: returns hpa-feature-attributes + operationId: getCloudInfrastructureCloudRegionsCloudRegionFlavorsFlavorHpaCapabilitiesHpaCapabilityHpaFeatureAttributes produces: - application/json - application/xml @@ -5462,7 +5462,7 @@ paths: "200": description: successful operation schema: - $ref: "#/getDefinitions/hpa-feature-attribute" + $ref: "#/getDefinitions/hpa-feature-attributes" "default": description: Response codes found in [response codes](https://wiki.onap.org/). parameters: @@ -8870,12 +8870,12 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute/relationship-list/relationship: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes/relationship-list/relationship: put: tags: - CloudInfrastructure summary: see node definition for valid relationships - operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: createOrUpdateCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -8906,7 +8906,7 @@ paths: example: __HPA-CAPABILITY-ID__ - name: body in: body - description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute.json) + description: relationship object that needs to be created or updated. [Valid relationship examples shown here](apidocs/relations/v13/CloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes.json) required: true schema: $ref: "#/definitions/relationship" @@ -8915,7 +8915,7 @@ paths: - CloudInfrastructure summary: delete an existing relationship description: delete an existing relationship - operationId: deleteCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributeRelationshipListRelationship + operationId: deleteCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributesRelationshipListRelationship consumes: - application/json - application/xml @@ -8944,13 +8944,13 @@ paths: required: true type: string example: __HPA-CAPABILITY-ID__ - /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attribute: + /cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/hpa-capabilities/hpa-capability/{hpa-capability-id}/hpa-feature-attributes: get: tags: - CloudInfrastructure - summary: returns hpa-feature-attribute - description: returns hpa-feature-attribute - operationId: getCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttribute + summary: returns hpa-feature-attributes + description: returns hpa-feature-attributes + operationId: getCloudInfrastructureCloudRegionsCloudRegionHpaCapabilitiesHpaCapabilityHpaFeatureAttributes produces: - application/json - application/xml @@ -8958,7 +8958,7 @@ paths: "200": description: successful operation schema: - $ref: "#/getDefinitions/hpa-feature-attribute" + $ref: "#/getDefinitions/hpa-feature-attributes" "default": description: Response codes found in [response codes](https://wiki.onap.org/). parameters: @@ -55909,6 +55909,8 @@ definitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -55932,13 +55934,15 @@ definitions: type: array items: $ref: "#/definitions/relationship" - hpa-feature-attribute: + hpa-feature-attributes: type: array items: - $ref: "#/definitions/hpa-feature-attribute" - hpa-feature-attribute: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string @@ -61098,6 +61102,8 @@ patchDefinitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -61114,9 +61120,11 @@ patchDefinitions: hpa-hw-arch: type: string description: Hardware architecture - hpa-feature-attribute: + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string @@ -65776,6 +65784,8 @@ getDefinitions: ###### Related Nodes - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES required: - hpa-capability-id - hpa-feature @@ -65799,13 +65809,15 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/relationship" - hpa-feature-attribute: + hpa-feature-attributes: type: array items: - $ref: "#/getDefinitions/hpa-feature-attribute" - hpa-feature-attribute: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: description: | HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) properties: hpa-attr-key: type: string diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v8.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v8.yaml index 38389232..eaf4d791 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v8.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v8.yaml @@ -45117,6 +45117,68 @@ definitions: type: array items: $ref: "#/definitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/definitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" image: description: | Openstack image. @@ -49775,6 +49837,50 @@ patchDefinitions: type: array items: $ref: "#/patchDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/patchDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute image: description: | Openstack image. @@ -53980,6 +54086,68 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/getDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" image: description: | Openstack image. diff --git a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v9.yaml b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v9.yaml index a793e1b2..61d8af69 100644 --- a/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v9.yaml +++ b/aai-schema/src/main/resources/aai_swagger_yaml/aai_swagger_v9.yaml @@ -49074,6 +49074,68 @@ definitions: type: array items: $ref: "#/definitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/definitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/definitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/definitions/relationship" image: description: | Openstack image. @@ -53882,6 +53944,50 @@ patchDefinitions: type: array items: $ref: "#/patchDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/patchDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute image: description: | Openstack image. @@ -58188,6 +58294,68 @@ getDefinitions: type: array items: $ref: "#/getDefinitions/host-route" + hpa-capabilities: + description: | + Collection of HPA Capabilities + properties: + hpa-capability: + type: array + items: + $ref: "#/getDefinitions/hpa-capability" + hpa-capability: + description: | + Represents a HPA capability + ###### Related Nodes + - TO flavor( hpa-capability org.onap.relationships.inventory.BelongsTo flavor, MANY2ONE) + - TO cloud-region( hpa-capability org.onap.relationships.inventory.BelongsTo cloud-region, MANY2ONE) + - FROM hpa-feature-attributes( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + - HPA-CAPABILITY is DELETED when these are DELETED HPA-FEATURE-ATTRIBUTES + required: + - hpa-capability-id + - hpa-feature + properties: + hpa-capability-id: + type: string + description: UUID to uniquely identify a HPA capability + hpa-feature: + type: string + description: Name of the HPACapability + hpa-version: + type: string + description: HPA schema version + hpa-hw-arch: + type: string + description: Hardware architecture + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" + hpa-feature-attributes: + type: array + items: + $ref: "#/getDefinitions/hpa-feature-attributes" + hpa-feature-attributes: + description: | + HPA Capability Feature attributes + ###### Related Nodes + - TO hpa-capability( hpa-feature-attributes org.onap.relationships.inventory.BelongsTo hpa-capability, MANY2ONE) + properties: + hpa-attr-key: + type: string + description: name of the specific HPA attribute + hpa-attr-value: + type: string + description: JSON string specifying the value, unit and type of the specific HPA attribute + resource-version: + type: string + description: Used for optimistic concurrency. Must be empty on create, valid on update and delete. + relationship-list: + type: array + items: + $ref: "#/getDefinitions/relationship" image: description: | Openstack image. diff --git a/pom.xml b/pom.xml index d794c98c..7459026b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ aai-auth aai-utils aai-client-loadbalancer + aai-schema-ingest