From 6b98bb3ec93a0bbfbe0e660cabc69978b53bfee8 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Thu, 18 Jan 2018 00:47:09 -0500 Subject: Sync the latest code changes Issue-ID: AAI-493 Change-Id: I5f39ce9bb19cfb9607b659bed82066cae7569ecc Signed-off-by: Venkata Harish K Kajur --- aai-core/.classpath | 33 +- aai-core/pom.xml | 22 +- .../java/org/onap/aai/audit/ListEndpoints.java | 8 +- .../java/org/onap/aai/db/props/AAIProperties.java | 1 + .../main/java/org/onap/aai/db/schema/AuditOXM.java | 3 +- .../java/org/onap/aai/db/schema/ScriptDriver.java | 20 +- .../main/java/org/onap/aai/dbgen/DataGrooming.java | 516 +- .../onap/aai/dbgen/DynamicPayloadGenerator.java | 498 + .../main/java/org/onap/aai/dbgen/GenTester.java | 18 +- .../java/org/onap/aai/dbgen/SchemaGenerator.java | 3 +- .../src/main/java/org/onap/aai/dbmap/AAIGraph.java | 29 +- .../java/org/onap/aai/dbmap/AAIGraphConfig.java | 107 + .../java/org/onap/aai/dbmap/InMemoryGraph.java | 106 + .../onap/aai/dmaap/AAIDmaapEventJMSConsumer.java | 17 + .../onap/aai/dmaap/AAIDmaapEventJMSProducer.java | 3 +- .../aai/extensions/OrphanLInterfaceHandler.java | 112 + .../org/onap/aai/introspection/Introspector.java | 3 +- .../onap/aai/introspection/IntrospectorWalker.java | 7 +- .../org/onap/aai/introspection/ModelInjestor.java | 2 +- .../org/onap/aai/introspection/MoxyLoader.java | 5 +- .../org/onap/aai/introspection/PojoLoader.java | 3 +- .../onap/aai/introspection/tools/CreateUUID.java | 29 +- .../org/onap/aai/logging/EcompErrorCategory.java | 44 + .../org/onap/aai/logging/EcompPatternLayout.java | 3 + .../org/onap/aai/logging/EcompResponseCode.java | 40 + .../onap/aai/logging/EcompResponseDescription.java | 46 + .../java/org/onap/aai/logging/ErrorLogHelper.java | 31 +- .../java/org/onap/aai/logging/LogFormatTools.java | 76 + .../java/org/onap/aai/logging/LoggingContext.java | 21 +- .../main/java/org/onap/aai/logging/StopWatch.java | 13 +- .../onap/aai/parsers/query/LegacyQueryParser.java | 4 +- .../aai/parsers/uri/URIToExtensionInformation.java | 9 +- .../aai/parsers/uri/URIToRelationshipObject.java | 1 - .../aai/query/builder/GraphTraversalBuilder.java | 55 + .../aai/query/builder/GremlinQueryBuilder.java | 73 +- .../org/onap/aai/query/builder/QueryBuilder.java | 30 + .../java/org/onap/aai/rest/RestHandlerService.java | 46 + .../main/java/org/onap/aai/rest/db/HttpEntry.java | 187 +- .../main/java/org/onap/aai/restcore/RESTAPI.java | 131 +- .../org/onap/aai/restcore/util/EdgeRuleBean.java | 95 + .../onap/aai/restcore/util/GenerateEdgeRules.java | 204 +- .../onap/aai/serialization/db/DBSerializer.java | 373 +- .../onap/aai/serialization/db/EdgeProperty.java | 15 +- .../org/onap/aai/serialization/db/EdgeRule.java | 47 +- .../org/onap/aai/serialization/db/EdgeRules.java | 23 +- .../serialization/db/InMemoryGraphSingleton.java | 60 + .../exceptions/MultipleEdgeRuleFoundException.java | 14 +- .../serialization/engines/InMemoryDBEngine.java | 207 + .../engines/query/GraphTraversalQueryEngine.java | 19 +- .../serialization/engines/query/QueryEngine.java | 6 +- .../serialization/queryformats/FormatFactory.java | 3 - .../serialization/queryformats/FormatMapper.java | 2 +- .../aai/serialization/queryformats/Formatter.java | 29 +- .../java/org/onap/aai/tasks/ScheduledTasks.java | 9 +- .../org/onap/aai/util/AAIApiServerURLBase.java | 3 +- .../src/main/java/org/onap/aai/util/AAIConfig.java | 17 +- .../main/java/org/onap/aai/util/AAIConstants.java | 12 +- .../java/org/onap/aai/util/AAIRSyncUtility.java | 4 +- .../java/org/onap/aai/util/AAISystemExitUtil.java | 34 + .../java/org/onap/aai/util/AutoGenerateHtml.java | 67 + .../main/java/org/onap/aai/util/GenerateXsd.java | 1345 ++- .../java/org/onap/aai/util/HttpsAuthClient.java | 2 +- .../org/onap/aai/util/HttpsAuthExternalClient.java | 150 + .../src/main/java/org/onap/aai/util/Request.java | 7 +- .../java/org/onap/aai/util/RestController.java | 469 + .../org/onap/aai/util/StoreNotificationEvent.java | 12 +- .../org/onap/aai/util/UniquePropertyCheck.java | 30 +- .../org/onap/aai/util/swagger/GenerateSwagger.java | 26 +- .../resources/dbedgerules/DbEdgeRules_v10.json | 1918 ++-- .../resources/dbedgerules/DbEdgeRules_v11.json | 2206 ++-- .../resources/dbedgerules/DbEdgeRules_v12.json | 2980 ++--- .../main/resources/dbedgerules/DbEdgeRules_v8.json | 1592 +-- .../main/resources/dbedgerules/DbEdgeRules_v9.json | 1840 +-- aai-core/src/main/resources/edgeLabelMigration.csv | 212 + aai-core/src/main/resources/edgerulesTemplate.ftlh | 8 + aai-core/src/main/resources/ruleTemplate.ftlh | 12 + .../test/java/org/onap/aai/dbmap/AAIGraphTest.java | 79 + .../onap/aai/introspection/JSONStrategyTest.java | 136 + .../aai/introspection/PropertyPredicatesTest.java | 19 +- .../aai/introspection/sideeffect/DataCopyTest.java | 18 +- .../aai/introspection/sideeffect/DataLinkTest.java | 24 +- .../aai/introspection/tools/CreateUUIDTest.java | 91 + .../validation/IntrospectorValidationTest.java | 6 +- .../onap/aai/logging/EcompErrorCategoryTest.java | 50 + .../onap/aai/logging/EcompResponseCodeTest.java | 49 + .../aai/logging/EcompResponseDescriptionTest.java | 50 + .../org/onap/aai/logging/LoggingContextTest.java | 2 +- .../onap/aai/parsers/query/GraphTraversalTest.java | 46 +- .../onap/aai/parsers/query/UniqueURIQueryTest.java | 2 +- .../relationship/RelationshipToURITest.java | 16 +- .../org/onap/aai/parsers/uri/URIParserTest.java | 2 +- .../parsers/uri/URIToExtensionInformationTest.java | 2 +- .../query/builder/QueryBuilderTestAbstraction.java | 87 +- .../org/onap/aai/query/builder/SimplePathTest.java | 6 +- .../onap/aai/query/builder/TraversalQueryTest.java | 36 +- .../java/org/onap/aai/rest/CloudRegionTest.java | 76 + .../onap/aai/rest/GenericVnfLInterfaceTest.java | 78 + .../test/java/org/onap/aai/rest/TenantTest.java | 93 + .../java/org/onap/aai/rest/db/HttpEntryTest.java | 223 +- .../aai/serialization/db/DbSerializerTest.java | 497 +- .../onap/aai/serialization/db/EdgeRulesTest.java | 94 +- .../query/GraphTraversalQueryEngineTest.java | 13 +- .../serialization/queryformats/ConsoleTest.java | 83 + .../serialization/queryformats/GraphSONTest.java | 80 + .../serialization/queryformats/RawFormatTest.java | 4 +- .../queryformats/SimpleFormatTest.java | 1 - .../java/org/onap/aai/util/AAICSVWriterTest.java | 77 + .../util/AAIConfigCommandLinePropGetterTest.java | 105 + .../org/onap/aai/util/AAIRSyncUtilityTest.java | 55 + .../java/org/onap/aai/util/FileWatcherTest.java | 78 + .../java/org/onap/aai/util/GenerateXsdTest.java | 278 +- .../org/onap/aai/util/HbaseSaltPrefixerTest.java | 72 + .../java/org/onap/aai/util/KeyValueListTest.java | 76 + .../java/org/onap/aai/util/MapperUtilTest.java | 72 + .../test/java/org/onap/aai/util/PojoUtilsTest.java | 107 + .../java/org/onap/aai/util/RestURLEncoderTest.java | 63 + .../onap/aai/util/StoreNotificationEventTest.java | 235 + .../aai/workarounds/LegacyURITransformerTest.java | 104 + .../etc/appprops/aaiconfig.properties | 70 +- .../etc/appprops/error.properties | 8 +- .../bundleconfig-local/etc/oxm/aai_oxm_v10.xml | 11219 +++++++++---------- .../bundleconfig-local/etc/oxm/aai_oxm_v11.xml | 1332 ++- .../bundleconfig-local/etc/oxm/aai_oxm_v12.xml | 743 +- .../bundleconfig-local/etc/oxm/aai_oxm_v2.xml | 1729 --- .../bundleconfig-local/etc/oxm/aai_oxm_v8.xml | 4578 +++++++- .../bundleconfig-local/etc/oxm/aai_oxm_v9.xml | 10760 +++++++++--------- .../etc/relationship/ambiguous-relationship.json | 6 +- .../etc/relationship/both-failv10-successv9.json | 6 +- .../etc/relationship/both-successv10-failv9.json | 4 +- .../etc/relationship/nothing-to-parse.json | 2 +- .../etc/relationship/only-related-link.json | 4 +- .../etc/relationship/only-relationship-data.json | 4 +- .../DbEdgeRules_TraversalQueryTest.json | 36 +- .../resources/dbedgerules/DbEdgeRules_test.json | 65 +- .../dbedgerules/DbEdgeRules_test_broken.json | 9 +- aai-core/src/test/resources/edgeLabelMigration.csv | 212 + aai-core/src/test/resources/logback.xml | 4 +- .../openecomp/aai/introspection/aai_oxm_v10.xml | 5796 ---------- .../org/openecomp/aai/introspection/aai_oxm_v8.xml | 3079 ----- .../org/openecomp/aai/introspection/aai_oxm_v9.xml | 599 - .../expected/generic-vnf-with-lag-interface.json | 27 + .../resource/cloud-region-with-all-children.json | 310 + .../payloads/resource/l-interface-with-ipv6.json | 22 + .../resources/payloads/templates/cloud-region.json | 310 + .../templates/generic-vnf-with-lag-interface.json | 24 + .../test/resources/payloads/templates/tenant.json | 169 + 146 files changed, 30949 insertions(+), 29870 deletions(-) create mode 100644 aai-core/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java create mode 100644 aai-core/src/main/java/org/onap/aai/dbmap/AAIGraphConfig.java create mode 100644 aai-core/src/main/java/org/onap/aai/dbmap/InMemoryGraph.java create mode 100644 aai-core/src/main/java/org/onap/aai/extensions/OrphanLInterfaceHandler.java create mode 100644 aai-core/src/main/java/org/onap/aai/logging/EcompErrorCategory.java create mode 100644 aai-core/src/main/java/org/onap/aai/logging/EcompResponseCode.java create mode 100644 aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java create mode 100644 aai-core/src/main/java/org/onap/aai/rest/RestHandlerService.java create mode 100644 aai-core/src/main/java/org/onap/aai/restcore/util/EdgeRuleBean.java create mode 100644 aai-core/src/main/java/org/onap/aai/serialization/db/InMemoryGraphSingleton.java create mode 100644 aai-core/src/main/java/org/onap/aai/serialization/engines/InMemoryDBEngine.java create mode 100644 aai-core/src/main/java/org/onap/aai/util/AAISystemExitUtil.java create mode 100644 aai-core/src/main/java/org/onap/aai/util/AutoGenerateHtml.java create mode 100644 aai-core/src/main/java/org/onap/aai/util/HttpsAuthExternalClient.java create mode 100644 aai-core/src/main/java/org/onap/aai/util/RestController.java create mode 100644 aai-core/src/main/resources/edgeLabelMigration.csv create mode 100644 aai-core/src/main/resources/edgerulesTemplate.ftlh create mode 100644 aai-core/src/main/resources/ruleTemplate.ftlh create mode 100644 aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/rest/TenantTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java create mode 100644 aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java delete mode 100644 aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml create mode 100644 aai-core/src/test/resources/edgeLabelMigration.csv delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v10.xml delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml delete mode 100644 aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml create mode 100644 aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json create mode 100644 aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json create mode 100644 aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json create mode 100644 aai-core/src/test/resources/payloads/templates/cloud-region.json create mode 100644 aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json create mode 100644 aai-core/src/test/resources/payloads/templates/tenant.json (limited to 'aai-core') diff --git a/aai-core/.classpath b/aai-core/.classpath index 7dcc5272..78a65b57 100644 --- a/aai-core/.classpath +++ b/aai-core/.classpath @@ -1,35 +1,18 @@ - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + - + + diff --git a/aai-core/pom.xml b/aai-core/pom.xml index a93e2e6e..63a5d83b 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -154,6 +154,12 @@ commons-lang 2.6 + + org.apache.commons + commons-text + 1.1 + compile + com.att.eelf eelf-core @@ -454,7 +460,7 @@ 1.4.0 test - + @@ -484,6 +490,19 @@ + + post-unit-test + test + + report + + + + ${project.build.directory}/coverage-reports/jacoco.exec + + ${project.reporting.outputDirectory}/jacoco + + @@ -496,6 +515,7 @@ 2.12.4 -noverify ${argLine} + alphabetical . bundleconfig-local diff --git a/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java b/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java index 5ee973a3..bfa8748c 100644 --- a/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java +++ b/aai-core/src/main/java/org/onap/aai/audit/ListEndpoints.java @@ -40,6 +40,8 @@ import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; import org.onap.aai.introspection.Version; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.logging.LogFormatTools; + import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.common.base.CaseFormat; @@ -121,7 +123,7 @@ public class ListEndpoints { try { endpoints.add(currentUri + obj.getLoader().introspectorFromName(key).getGenericURI()); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping endpoint for " + key + " (Unknown object)", e); + LOGGER.warn("Skipping endpoint for " + key + " (Unknown object) " + LogFormatTools.getStackTop(e)); } } } @@ -147,7 +149,7 @@ public class ListEndpoints { newVisited ); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping nested endpoint for " + propName + " (Unknown Object)", e); + LOGGER.warn("Skipping nested endpoint for " + propName + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } } else if (obj.isComplexType(propName)) { @@ -161,7 +163,7 @@ public class ListEndpoints { visited ); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping nested enpoint for " + propName + " (Unknown Object)", e); + LOGGER.warn("Skipping nested enpoint for " + propName + " (Unknown Object) "+ LogFormatTools.getStackTop(e)); } } } diff --git a/aai-core/src/main/java/org/onap/aai/db/props/AAIProperties.java b/aai-core/src/main/java/org/onap/aai/db/props/AAIProperties.java index 76a13363..e26d930e 100644 --- a/aai-core/src/main/java/org/onap/aai/db/props/AAIProperties.java +++ b/aai-core/src/main/java/org/onap/aai/db/props/AAIProperties.java @@ -36,5 +36,6 @@ public class AAIProperties { public static final Integer MAXIMUM_DEPTH = 10000; public static final String LINKED = "linked"; public static final String DB_ALIAS_SUFFIX = "-local"; + public static final String AAI_UUID = "aai-uuid"; } diff --git a/aai-core/src/main/java/org/onap/aai/db/schema/AuditOXM.java b/aai-core/src/main/java/org/onap/aai/db/schema/AuditOXM.java index e64f3ea3..0a3650fa 100644 --- a/aai-core/src/main/java/org/onap/aai/db/schema/AuditOXM.java +++ b/aai-core/src/main/java/org/onap/aai/db/schema/AuditOXM.java @@ -47,6 +47,7 @@ import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; import org.onap.aai.introspection.Version; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.schema.enums.ObjectMetadata; import org.onap.aai.util.AAIConstants; import com.att.eelf.configuration.EELFLogger; @@ -77,7 +78,7 @@ public class AuditOXM extends Auditor { allObjects.add(temp); this.createDBProperties(temp); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping audit for object " + key + " (Unknown Object)", e); + LOGGER.warn("Skipping audit for object " + key + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } for (Introspector temp : allObjects) { diff --git a/aai-core/src/main/java/org/onap/aai/db/schema/ScriptDriver.java b/aai-core/src/main/java/org/onap/aai/db/schema/ScriptDriver.java index fc494883..968d9ef2 100644 --- a/aai-core/src/main/java/org/onap/aai/db/schema/ScriptDriver.java +++ b/aai-core/src/main/java/org/onap/aai/db/schema/ScriptDriver.java @@ -22,13 +22,17 @@ package org.onap.aai.db.schema; import java.io.IOException; +import java.util.UUID; +import org.apache.commons.configuration.ConfigurationException; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; - +import org.onap.aai.dbmap.AAIGraphConfig; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Version; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import org.onap.aai.util.AAIConfig; import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; @@ -47,9 +51,19 @@ public class ScriptDriver { * @throws JsonMappingException the json mapping exception * @throws IOException Signals that an I/O exception has occurred. */ - public static void main (String[] args) throws AAIException, IOException { + public static void main (String[] args) throws AAIException, IOException, ConfigurationException { CommandLineArgs cArgs = new CommandLineArgs(); + LoggingContext.init(); + LoggingContext.component("DBSchemaScriptDriver"); + LoggingContext.partnerName("NA"); + LoggingContext.targetEntity("AAI"); + LoggingContext.requestId(UUID.randomUUID().toString()); + LoggingContext.serviceName("AAI"); + LoggingContext.targetServiceName("main"); + LoggingContext.statusCode(StatusCode.COMPLETE); + LoggingContext.responseCode(LoggingContext.SUCCESS); + new JCommander(cArgs, args); if (cArgs.help) { @@ -57,7 +71,7 @@ public class ScriptDriver { } String config = cArgs.config; AAIConfig.init(); - try (TitanGraph graph = TitanFactory.open(config)) { + try (TitanGraph graph = TitanFactory.open(new AAIGraphConfig.Builder(config).forService(ScriptDriver.class.getSimpleName()).withGraphType("NA").buildConfiguration())) { if (!("oxm".equals(cArgs.type) || "graph".equals(cArgs.type))) { System.out.println("type: " + cArgs.type + " not recognized."); System.exit(1); diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/DataGrooming.java b/aai-core/src/main/java/org/onap/aai/dbgen/DataGrooming.java index afc7807b..f7b9d866 100644 --- a/aai-core/src/main/java/org/onap/aai/dbgen/DataGrooming.java +++ b/aai-core/src/main/java/org/onap/aai/dbgen/DataGrooming.java @@ -50,6 +50,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.dbmap.AAIGraph; +import org.onap.aai.dbmap.AAIGraphConfig; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; @@ -57,11 +58,13 @@ import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LogFormatTools; +import org.onap.aai.logging.LoggingContext; import org.onap.aai.serialization.db.AAIDirection; import org.onap.aai.serialization.db.EdgeProperty; -import org.onap.aai.util.AAIConfig; -import org.onap.aai.util.AAIConstants; -import org.onap.aai.util.FormatDate; +import org.onap.aai.util.*; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import com.att.eelf.configuration.Configuration; import com.att.eelf.configuration.EELFLogger; @@ -83,8 +86,9 @@ public class DataGrooming { * @param args the arguments */ public static void main(String[] args) { - + // Set the logging file properties to be used by EELFManager + System.setProperty("aai.service.name", DataGrooming.class.getSimpleName()); Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_DATA_GROOMING_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); @@ -102,9 +106,19 @@ public class DataGrooming { Boolean neverUseCache = false; Boolean skipEdgeCheckFlag = false; + LoggingContext.init(); + LoggingContext.partnerName(FROMAPPID); + LoggingContext.serviceName(AAIConstants.AAI_RESOURCES_MS); + LoggingContext.component("dataGrooming"); + LoggingContext.targetEntity(AAIConstants.AAI_RESOURCES_MS); + LoggingContext.targetServiceName("main"); + LoggingContext.requestId(TRANSID); + LoggingContext.statusCode(StatusCode.COMPLETE); + LoggingContext.responseCode(LoggingContext.SUCCESS); + int timeWindowMinutes = 0; // A value of 0 means that we will not have a time-window -- we will look // at all nodes of the passed-in nodeType. - long windowStartTime = 0; // Translation of the window into a starting timestamp + int maxRecordsToFix = AAIConstants.AAI_GROOMING_DEFAULT_MAX_FIX; int sleepMinutes = AAIConstants.AAI_GROOMING_DEFAULT_SLEEP_MINUTES; @@ -127,17 +141,9 @@ public class DataGrooming { dupeGrpsDeleted = 0; FormatDate fd = new FormatDate("yyyyMMddHHmm", "GMT"); String dteStr = fd.getDateTime(); - String groomOutFileName = "dataGrooming." + dteStr + ".out"; - String argString = ""; - for( int x = 0; x < args.length; x++ ) { - argString = argString + " " + args[x]; - } - LOGGER.info(" DataGrooming called with these options: [" + argString + "]"); - if (args.length > 0) { // They passed some arguments in that will affect processing - for (int i = 0; i < args.length; i++) { String thisArg = args[i]; if (thisArg.equals("-edgesOnly")) { @@ -165,76 +171,98 @@ public class DataGrooming { } else if (thisArg.equals("-maxFix")) { i++; if (i >= args.length) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error(" No value passed with -maxFix option. "); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } String nextArg = args[i]; try { maxRecordsToFix = Integer.parseInt(nextArg); } catch (Exception e) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error("Bad value passed with -maxFix option: [" + nextArg + "]"); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } } else if (thisArg.equals("-sleepMinutes")) { i++; if (i >= args.length) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error("No value passed with -sleepMinutes option."); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } String nextArg = args[i]; try { sleepMinutes = Integer.parseInt(nextArg); } catch (Exception e) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error("Bad value passed with -sleepMinutes option: [" + nextArg + "]"); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } } else if (thisArg.equals("-timeWindowMinutes")) { i++; if (i >= args.length) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error("No value passed with -timeWindowMinutes option."); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } String nextArg = args[i]; try { timeWindowMinutes = Integer.parseInt(nextArg); } catch (Exception e) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error("Bad value passed with -timeWindowMinutes option: [" + nextArg + "]"); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } - if( timeWindowMinutes > 0 ){ - // Translate the window value (ie. 30 minutes) into a unix timestamp like - // we use in the db - so we can select data created after that time. - windowStartTime = figureWindowStartTime( timeWindowMinutes ); - } + } else if (thisArg.equals("-f")) { i++; if (i >= args.length) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error(" No value passed with -f option. "); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } prevFileName = args[i]; } else { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error(" Unrecognized argument passed to DataGrooming: [" + thisArg + "]. "); - LOGGER.error(" Valid values are: -f -autoFix -maxFix -edgesOnly -dupeFixOn -donFixOrphans -sleepMinutes -neverUseCache"); - System.exit(0); + LOGGER.error(" Valid values are: -f -autoFix -maxFix -edgesOnly -skipEdgeChecks -dupeFixOn -donFixOrphans -timeWindowMinutes -sleepMinutes -neverUseCache"); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } } } - + String windowTag = "FULL"; + if( timeWindowMinutes > 0 ){ + windowTag = "PARTIAL"; + } + String groomOutFileName = "dataGrooming." + windowTag + "." + dteStr + ".out"; + try { LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); } catch (Exception ex){ - LOGGER.error("ERROR - Could not create loader", ex); - System.exit(1); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); + LOGGER.error("ERROR - Could not create loader " + LogFormatTools.getStackTop(ex)); + AAISystemExitUtil.systemExitCloseAAIGraph(1); } + if (skipHostCheck) { + LOGGER.info(" We will skip the HostCheck as requested. "); + } try { if (!prevFileName.equals("")) { @@ -248,7 +276,7 @@ public class DataGrooming { maxRecordsToFix, groomOutFileName, ver, singleCommits, dupeCheckOff, dupeFixOn, ghost2CheckOff, ghost2FixOn, finalShutdownFlag, cacheDbOkFlag, - skipEdgeCheckFlag, windowStartTime); + skipEdgeCheckFlag, timeWindowMinutes); } else if (doAutoFix) { // They want us to run the processing twice -- first to look for // delete candidates, then after @@ -264,7 +292,7 @@ public class DataGrooming { dontFixOrphansFlag, maxRecordsToFix, groomOutFileName, ver, singleCommits, dupeCheckOff, dupeFixOn, ghost2CheckOff, ghost2FixOn, finalShutdownFlag, cacheDbOkFlag, - skipEdgeCheckFlag, windowStartTime); + skipEdgeCheckFlag, timeWindowMinutes); if (fixCandCount == 0) { LOGGER.info(" No fix-Candidates were found by the first pass, so no second/fix-pass is needed. "); } else { @@ -277,7 +305,7 @@ public class DataGrooming { Thread.sleep(sleepMsec); } catch (InterruptedException ie) { LOGGER.info("\n >>> Sleep Thread has been Interrupted <<< "); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); } dteStr = fd.getDateTime(); @@ -293,7 +321,7 @@ public class DataGrooming { secondGroomOutFileName, ver, singleCommits, dupeCheckOff, dupeFixOn, ghost2CheckOff, ghost2FixOn, finalShutdownFlag, cacheDbOkFlag, - skipEdgeCheckFlag, windowStartTime); + skipEdgeCheckFlag, timeWindowMinutes); } } else { // Do the grooming - plain vanilla (no fix-it-file, no @@ -309,14 +337,16 @@ public class DataGrooming { maxRecordsToFix, groomOutFileName, ver, singleCommits, dupeCheckOff, dupeFixOn, ghost2CheckOff, ghost2FixOn, finalShutdownFlag, cacheDbOkFlag, - skipEdgeCheckFlag, windowStartTime); + skipEdgeCheckFlag, timeWindowMinutes); } } catch (Exception ex) { - LOGGER.error("Exception while grooming data", ex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("Exception while grooming data " + LogFormatTools.getStackTop(ex)); } LOGGER.info(" Done! "); - System.exit(0); + AAISystemExitUtil.systemExitCloseAAIGraph(0); }// End of main() @@ -345,11 +375,12 @@ public class DataGrooming { Boolean dupeCheckOff, Boolean dupeFixOn, Boolean ghost2CheckOff, Boolean ghost2FixOn, Boolean finalShutdownFlag, Boolean cacheDbOkFlag, - Boolean skipEdgeCheckFlag, long windowStartTime) { + Boolean skipEdgeCheckFlag, int timeWindowMinutes) { LOGGER.debug(" Entering doTheGrooming \n"); int cleanupCandidateCount = 0; + long windowStartTime = 0; // Translation of the window into a starting timestamp BufferedWriter bw = null; TitanGraph graph = null; TitanGraph graph2 = null; @@ -360,6 +391,12 @@ public class DataGrooming { Graph g = null; Graph g2 = null; try { + if( timeWindowMinutes > 0 ){ + // Translate the window value (ie. 30 minutes) into a unix timestamp like + // we use in the db - so we can select data created after that time. + windowStartTime = figureWindowStartTime( timeWindowMinutes ); + } + AAIConfig.init(); String targetDir = AAIConstants.AAI_HOME + AAIConstants.AAI_FILESEP + "logs" + AAIConstants.AAI_FILESEP + "data" @@ -375,6 +412,8 @@ public class DataGrooming { } if (deleteCandidateList.size() > maxRecordsToFix) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(" >> WARNING >> Delete candidate list size (" + deleteCandidateList.size() + ") is too big. The maxFix we are using is: " @@ -404,10 +443,10 @@ public class DataGrooming { if( cacheDbOkFlag ){ // Since we're just reading (not deleting/fixing anything), we can use // a cached connection to the DB - graph = TitanFactory.open(AAIConstants.CACHED_DB_CONFIG); + graph = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.CACHED_DB_CONFIG).forService(DataGrooming.class.getSimpleName()).withGraphType("cached").buildConfiguration()); } else { - graph = TitanFactory.open(AAIConstants.REALTIME_DB_CONFIG); + graph = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(DataGrooming.class.getSimpleName()).withGraphType("realtime1").buildConfiguration()); } if (graph == null) { String emsg = "null graph object in DataGrooming\n"; @@ -448,12 +487,16 @@ public class DataGrooming { String nType = entry.getKey(); int thisNtCount = 0; int thisNtDeleteCount = 0; + LOGGER.debug(" > Look at : [" + nType + "] ..."); ntList = ntList + "," + nType; // Get a collection of the names of the key properties for this nodeType to use later - // Determine what the key fields are for this nodeType - Collection keyProps = entry.getValue().getKeys(); + // Determine what the key fields are for this nodeType - use an arrayList so they + // can be gotten out in a consistent order. + Set keyPropsSet = entry.getValue().getKeys(); + ArrayList keyProps = new ArrayList (); + keyProps.addAll(keyPropsSet); // Get the types of nodes that this nodetype depends on for uniqueness (if any) Collection depNodeTypes = loader.introspectorFromName(nType).getDependentOn(); @@ -477,12 +520,13 @@ public class DataGrooming { } Vertex thisVtx = iter.next(); if( windowStartTime > 0 ){ - // We only want nodes that are created after a passed-in timestamp - Object objTimeStamp = thisVtx.property("aai-created-ts").orElse(null); - if( objTimeStamp != null ){ - long thisNodeCreateTime = (long)objTimeStamp; - if( thisNodeCreateTime < windowStartTime ){ - // It is NOT in our window, so we can pass over it + // They are using the time-window, so we only want nodes that are updated after a + // passed-in timestamp OR that have no last-modified-timestamp which means they are suspicious. + Object objModTimeStamp = thisVtx.property("aai-last-mod-ts").orElse(null); + if( objModTimeStamp != null ){ + long thisNodeModTime = (long)objModTimeStamp; + if( thisNodeModTime < windowStartTime ){ + // It has a last modified ts and is NOT in our window, so we can pass over it continue; } } @@ -521,7 +565,9 @@ public class DataGrooming { boolean depNodeOk = true; if( depNodeTypes.isEmpty() ){ // This kind of node is not dependent on any other. - // Make sure we can get it back using it's key properties and that we only get one. + // Make sure we can get it back using it's key properties (that is the + // phantom checking) and that we only get one. Note - we also need + // to collect data for a second type of dupe-checking which is done later. secondGetList = getNodeJustUsingKeyParams( TRANSID, FROMAPPID, source1, nType, propHashWithKeys, version ); } @@ -556,7 +602,9 @@ public class DataGrooming { zeroEdges = true; } } catch (Exception ex) { - LOGGER.warn("WARNING from inside the for-each-vid-loop orphan-edges-check ", ex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.warn("WARNING from inside the for-each-vid-loop orphan-edges-check " + LogFormatTools.getStackTop(ex) ); } if (deleteCandidateList.contains(thisVid)) { @@ -568,7 +616,9 @@ public class DataGrooming { thisNtDeleteCount++; } catch (Exception e) { okFlag = false; - LOGGER.error("ERROR trying to delete missing-dep-node VID = " + thisVid, e); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("ERROR trying to delete missing-dep-node VID = " + thisVid + " " + LogFormatTools.getStackTop(e)); } if (okFlag) { LOGGER.info(" DELETED missing-dep-node VID = " + thisVid); @@ -605,7 +655,7 @@ public class DataGrooming { } } } - } + }// end of -- else this is a dependent node -- piece if( depNodeOk && (secondGetList == null || secondGetList.size() == 0) ){ // We could not get the node back using it's own key info. @@ -618,7 +668,9 @@ public class DataGrooming { thisNtDeleteCount++; } catch (Exception e) { okFlag = false; - LOGGER.error("ERROR trying to delete phantom VID = " + thisVid, e); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("ERROR trying to delete phantom VID = " + thisVid + " " + LogFormatTools.getStackTop(e)); } if (okFlag) { LOGGER.info(" DELETED VID = " + thisVid); @@ -644,21 +696,56 @@ public class DataGrooming { } } catch (AAIException e1) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(" For nodeType = " + nType + " Caught exception", e1); errArr.add(e1.getErrorObject().toString()); } catch (Exception e2) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(" For nodeType = " + nType + " Caught exception", e2); errArr.add(e2.getMessage()); } - }// try block to enclose looping of a single vertex + }// try block to enclose looping over each single vertex catch (Exception exx) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING from inside the while-verts-loop ", exx); } } // while loop for each record of a nodeType + if( depNodeTypes.isEmpty() && !dupeCheckOff ){ + // For this nodeType, we haven't looked at the possibility of a + // non-dependent node where two verts have same key info + ArrayList> nonDependentDupeSets = new ArrayList>(); + nonDependentDupeSets = getDupeSets4NonDepNodes( + TRANSID, FROMAPPID, g, + version, nType, tmpList, + keyProps, loader ); + // For each set found (each set is for a unique instance of key-values), + // process the dupes found + Iterator> dsItr = nonDependentDupeSets.iterator(); + while( dsItr.hasNext() ){ + ArrayList dupeList = dsItr.next(); + LOGGER.info(" - now check Dupes for some non-dependent guys - "); + List tmpDupeGroups = checkAndProcessDupes( + TRANSID, FROMAPPID, g, source1, version, + nType, dupeList, dupeFixOn, + deleteCandidateList, singleCommits, dupeGroups, loader); + Iterator dIter = tmpDupeGroups.iterator(); + while (dIter.hasNext()) { + // Add in any newly found dupes to our running list + String tmpGrp = dIter.next(); + LOGGER.info("Found set of dupes: [" + tmpGrp + "]"); + dupeGroups.add(tmpGrp); + } + } + + }// end of extra dupe check for non-dependent nodes + if ( (thisNtDeleteCount > 0) && singleCommits ) { // NOTE - the singleCommits option is not used in normal processing g.tx().commit(); @@ -669,6 +756,7 @@ public class DataGrooming { LOGGER.info( " Processed " + thisNtCount + " records for [" + nType + "], " + totalNodeCount + " total overall. " ); }// While-loop for each node type + }// end of check to make sure we weren't only supposed to do edges @@ -686,7 +774,7 @@ public class DataGrooming { LOGGER.debug(" ---- DEBUG --- about to open a SECOND graph (takes a little while)--------\n"); // Note - graph2 just reads - but we want it to use a fresh connection to // the database, so we are NOT using the CACHED DB CONFIG here. - graph2 = TitanFactory.open(AAIConstants.REALTIME_DB_CONFIG); + graph2 = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(DataGrooming.class.getSimpleName()).withGraphType("realtime2").buildConfiguration()); if (graph2 == null) { String emsg = "null graph2 object in DataGrooming\n"; throw new AAIException("AAI_6101", emsg); @@ -718,6 +806,8 @@ public class DataGrooming { try { v = vItor2.next(); } catch (Exception vex) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get next vertex on the vItor2 "); continue; } @@ -727,6 +817,8 @@ public class DataGrooming { try { thisVertId = v.id().toString(); } catch (Exception ev) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING when doing getId() on a vertex from our vertex list. "); continue; } @@ -739,12 +831,13 @@ public class DataGrooming { } if( windowStartTime > 0 ){ - // We only want to look at nodes that are created after a passed-in timestamp - Object objTimeStamp = v.property("aai-created-ts").orElse(null); - if( objTimeStamp != null ){ - long thisNodeCreateTime = (long)objTimeStamp; - if( thisNodeCreateTime < windowStartTime ){ - // It is NOT in our window, so we can pass over it + // They are using the time-window, so we only want nodes that are updated after a + // passed-in timestamp OR that have no last-modified-timestamp which means they are suspicious. + Object objModTimeStamp = v.property("aai-last-mod-ts").orElse(null); + if( objModTimeStamp != null ){ + long thisNodeModTime = (long)objModTimeStamp; + if( thisNodeModTime < windowStartTime ){ + // It has a last modified ts and is NOT in our window, so we can pass over it continue; } } @@ -763,6 +856,8 @@ public class DataGrooming { try { e = eItor.next(); } catch (Exception iex) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get next edge on the eItor ", iex); continue; } @@ -770,6 +865,8 @@ public class DataGrooming { try { vIn = e.inVertex(); } catch (Exception err) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get edge's In-vertex ", err); } String vNtI = ""; @@ -795,6 +892,8 @@ public class DataGrooming { if( ! ghost2CheckOff ){ Vertex connectedVert = g2.traversal().V(vIdLong).next(); if( connectedVert == null ) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn( "GHOST2 -- got NULL when doing getVertex for vid = " + vIdLong); cantGetUsingVid = true; @@ -805,6 +904,8 @@ public class DataGrooming { ghost2 = g.traversal().V(vIdLong).next(); } catch( Exception ex){ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn( "GHOST2 -- Could not get the ghost info for a bad edge for vtxId = " + vIdLong, ex); } if( ghost2 != null ){ @@ -814,6 +915,8 @@ public class DataGrooming { }// end of the ghost2 checking } catch (Exception err) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get edge's In-vertex props ", err); } } @@ -841,6 +944,8 @@ public class DataGrooming { deleteCount++; } catch (Exception e1) { okFlag = false; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING when trying to delete bad-edge-connected VERTEX VID = " + vIdI, e1); } @@ -864,6 +969,8 @@ public class DataGrooming { // that this edge has already been // removed okFlag = false; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING when trying to delete edge = " + thisEid); } @@ -883,6 +990,8 @@ public class DataGrooming { try { vOut = e.outVertex(); } catch (Exception err) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get edge's Out-vertex "); } String vNtO = ""; @@ -915,6 +1024,8 @@ public class DataGrooming { ghost2 = g.traversal().V(vIdLong).next(); } catch( Exception ex){ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn( "GHOST2 -- Could not get the ghost info for a bad edge for vtxId = " + vIdLong, ex); } if( ghost2 != null ){ @@ -923,6 +1034,8 @@ public class DataGrooming { } } } catch (Exception err) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(">>> WARNING trying to get edge's Out-vertex props ", err); } } @@ -950,6 +1063,8 @@ public class DataGrooming { deleteCount++; } catch (Exception e1) { okFlag = false; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING when trying to delete bad-edge-connected VID = " + vIdO, e1); } @@ -973,6 +1088,8 @@ public class DataGrooming { // that this edge has already been // removed okFlag = false; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING when trying to delete edge = " + thisEid, ex); } @@ -990,6 +1107,8 @@ public class DataGrooming { } }// End of while-edges-loop } catch (Exception exx) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn("WARNING from in the while-verts-loop ", exx); } }// End of while-vertices-loop (the edge-checking) @@ -1004,7 +1123,9 @@ public class DataGrooming { executeFinalCommit = true; LOGGER.info("Commit was successful "); } catch (Exception excom) { - LOGGER.error(" >>>> ERROR <<<< Could not commit changes. ", excom); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error(" >>>> ERROR <<<< Could not commit changes. " + LogFormatTools.getStackTop(excom)); deleteCount = 0; } } @@ -1018,7 +1139,14 @@ public class DataGrooming { deleteCount = deleteCount + dupeGrpsDeleted; bw.write("\n\n ============ Summary ==============\n"); - bw.write("Ran these nodeTypes: " + ntList + "\n\n"); + if( timeWindowMinutes == 0 ){ + bw.write("Ran FULL data grooming (no time-window). \n"); + } + else { + bw.write("Ran PARTIAL data grooming just looking at data added/updated in the last " + timeWindowMinutes + " minutes. \n"); + } + + bw.write("\nRan these nodeTypes: " + ntList + "\n\n"); bw.write("There were this many delete candidates from previous run = " + deleteCandidateList.size() + "\n"); if (dontFixOrphansFlag) { @@ -1084,7 +1212,9 @@ public class DataGrooming { bw.write(info + "\n"); } } catch (Exception dex) { - LOGGER.error("error trying to print detail info for a ghost-node: ", dex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("error trying to print detail info for a ghost-node: " + LogFormatTools.getStackTop(dex)); } } @@ -1106,7 +1236,9 @@ public class DataGrooming { bw.write(info + "\n"); } } catch (Exception dex) { - LOGGER.error("error trying to print detail info for a Orphan Node /missing dependent edge", dex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("error trying to print detail info for a Orphan Node /missing dependent edge " + LogFormatTools.getStackTop(dex)); } } @@ -1129,7 +1261,10 @@ public class DataGrooming { bw.write(info + "\n"); } } catch (Exception dex) { - LOGGER.error("error trying to print detail info for a node missing its dependent edge but not an orphan", dex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("error trying to print detail info for a node missing its dependent edge but not an orphan " + + LogFormatTools.getStackTop(dex)); } } @@ -1149,7 +1284,9 @@ public class DataGrooming { + propKey.value() + "]\n"); } } catch (Exception pex) { - LOGGER.error("error trying to print empty/bad vertex data: ", pex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("error trying to print empty/bad vertex data: " + LogFormatTools.getStackTop(pex)); } } @@ -1228,7 +1365,9 @@ public class DataGrooming { }// else last entry }// for each vertex in a group } catch (Exception dex) { - LOGGER.error("error trying to print duplicate vertex data", dex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("error trying to print duplicate vertex data " + LogFormatTools.getStackTop(dex)); } }// while - work on each group of dupes @@ -1259,10 +1398,14 @@ public class DataGrooming { + "] and investigate delete candidates. "); } } catch (AAIException e) { - LOGGER.error("Caught AAIException while grooming data", e); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("Caught AAIException while grooming data"); ErrorLogHelper.logException(e); } catch (Exception ex) { - LOGGER.error("Caught exception while grooming data", ex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("Caught exception while grooming data"); ErrorLogHelper.logError("AAI_6128", ex.getMessage() + ", resolve and rerun dataGrooming"); } finally { @@ -1270,6 +1413,8 @@ public class DataGrooming { try { bw.close(); } catch (IOException iox) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); LOGGER.warn("Got an IOException trying to close bufferedWriter() \n", iox); } } @@ -1284,6 +1429,8 @@ public class DataGrooming { g.tx().rollback(); } catch (Exception ex) { // Don't throw anything because Titan sometimes is just saying that the graph is already closed + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); LOGGER.warn("WARNING from final graphTransaction.rollback()", ex); } } @@ -1295,6 +1442,8 @@ public class DataGrooming { g2.tx().rollback(); } catch (Exception ex) { // Don't throw anything because Titan sometimes is just saying that the graph is already closed + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); LOGGER.warn("WARNING from final graphTransaction2.rollback()", ex); } } @@ -1307,6 +1456,8 @@ public class DataGrooming { } } catch (Exception ex) { // Don't throw anything because Titan sometimes is just saying that the graph is already closed{ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); LOGGER.warn("WARNING from final graph.shutdown()", ex); } @@ -1317,6 +1468,8 @@ public class DataGrooming { } } catch (Exception ex) { // Don't throw anything because Titan sometimes is just saying that the graph is already closed{ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); LOGGER.warn("WARNING from final graph2.shutdown()", ex); } } @@ -1549,6 +1702,7 @@ public class DataGrooming { // (We'll check dep-node later) // Determine what the key fields are for this nodeType Collection keyProps = new ArrayList <>(); + HashMap keyPropValsHash = new HashMap (); try { keyProps = loader.introspectorFromName(vtxANodeType).getKeys(); } catch (AAIUnknownObjectException e) { @@ -1576,6 +1730,11 @@ public class DataGrooming { // data - so don't pick one return nullVtx; } + else { + // Keep these around for (potential) use later + keyPropValsHash.put(propName, vtxAKeyPropVal); + } + } // Collect the vid's and aai-node-types of the vertices that each vertex @@ -1618,18 +1777,20 @@ public class DataGrooming { } // 1 - If this kind of node needs a dependent node for uniqueness, then - // verify that they both nodes - // point to the same dependent node (otherwise they're not really - // duplicates) + // verify that they both nodes point to the same dependent + // node (otherwise they're not really duplicates) // Note - there are sometimes more than one dependent node type since - // one nodeType can be used in - // different ways. But for a particular node, it will only have one - // dependent node that it's - // connected to. - Collection depNodeTypes = loader.introspectorFromName(vtxANodeType).getDependentOn(); - + // one nodeType can be used in different ways. But for a + // particular node, it will only have one dependent node that + // it's connected to. + String onlyNodeThatIndexPointsToVidStr = ""; + Collection depNodeTypes = loader.introspectorFromName(vtxANodeType).getDependentOn(); if (depNodeTypes.isEmpty()) { // This kind of node is not dependent on any other. That is ok. + // We need to find out if the unique index info is good or not and + // use that later when deciding if we can delete one. + onlyNodeThatIndexPointsToVidStr = findJustOneUsingIndex( transId, + fromAppId, g, keyPropValsHash, vtxANodeType, vidA, vidB, ver ); } else { String depNodeVtxId4A = ""; String depNodeVtxId4B = ""; @@ -1654,8 +1815,11 @@ public class DataGrooming { } if (vtxIdsConn2A.size() == vtxIdsConn2B.size()) { - // 2 - If they both have edges to all the same vertices, then return - // the one with the lower vertexId. + // 2 - If they both have edges to all the same vertices, + // then return the one that can be reached uniquely via the + // key if that is the case or + // else the one with the lower vertexId + boolean allTheSame = true; Iterator iter = vtxIdsConn2A.iterator(); while (iter.hasNext()) { @@ -1667,7 +1831,19 @@ public class DataGrooming { } if (allTheSame) { - if (vidA < vidB) { + // If everything is the same, but one of the two has a good + // pointer to it, then save that one. Otherwise, take the + // older one. + if( !onlyNodeThatIndexPointsToVidStr.equals("") ){ + // only one is reachable via the index - choose that one. + if( onlyNodeThatIndexPointsToVidStr.equals(vidA.toString()) ){ + preferredVtx = vtxA; + } + else if( onlyNodeThatIndexPointsToVidStr.equals(vidB.toString()) ){ + preferredVtx = vtxB; + } + } + else if (vidA < vidB) { preferredVtx = vtxA; } else { preferredVtx = vtxB; @@ -1675,7 +1851,8 @@ public class DataGrooming { } } else if (vtxIdsConn2A.size() > vtxIdsConn2B.size()) { // 3 - VertexA is connected to more things than vtxB. - // We'll pick VtxA if its edges are a superset of vtxB's edges. + // We'll pick VtxA if its edges are a superset of vtxB's edges + // and it doesn't contradict the check for the index/key pointer. boolean missingOne = false; Iterator iter = vtxIdsConn2B.iterator(); while (iter.hasNext()) { @@ -1686,11 +1863,15 @@ public class DataGrooming { } } if (!missingOne) { - preferredVtx = vtxA; + if( onlyNodeThatIndexPointsToVidStr.equals("") + || onlyNodeThatIndexPointsToVidStr.equals(vidA.toString()) ){ + preferredVtx = vtxA; + } } } else if (vtxIdsConn2B.size() > vtxIdsConn2A.size()) { // 4 - VertexB is connected to more things than vtxA. - // We'll pick VtxB if its edges are a superset of vtxA's edges. + // We'll pick VtxB if its edges are a superset of vtxA's edges + // and it doesn't contradict the check for the index/key pointer. boolean missingOne = false; Iterator iter = vtxIdsConn2A.iterator(); while (iter.hasNext()) { @@ -1701,7 +1882,10 @@ public class DataGrooming { } } if (!missingOne) { - preferredVtx = vtxB; + if( onlyNodeThatIndexPointsToVidStr.equals("") + || onlyNodeThatIndexPointsToVidStr.equals(vidB.toString()) ){ + preferredVtx = vtxB; + } } } else { preferredVtx = nullVtx; @@ -1724,7 +1908,6 @@ public class DataGrooming { * @param deleteCandidateList the delete candidate list * @param singleCommits the single commits * @param alreadyFoundDupeGroups the already found dupe groups - * @param dbMaps the db maps * @return the array list */ private static List checkAndProcessDupes(String transId, @@ -1880,6 +2063,8 @@ public class DataGrooming { } } } catch (Exception e) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.warn(" >>> Threw an error in checkAndProcessDupes - just absorb this error and move on. ", e); } @@ -1896,7 +2081,6 @@ public class DataGrooming { * @param version the version * @param nType the n type * @param passedVertList the passed vert list - * @param dbMaps the db maps * @return the hash map * @throws AAIException the AAI exception */ @@ -2007,6 +2191,8 @@ public class DataGrooming { // like, "KeepVid=12345" String[] prefArr = prefString.split("="); if (prefArr.length != 2 || (!prefArr[0].equals("KeepVid"))) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.error("Bad format. Expecting KeepVid=999999"); return false; } else { @@ -2035,7 +2221,9 @@ public class DataGrooming { } } catch (Exception e) { okFlag = false; - LOGGER.error("ERROR trying to delete VID = " + thisVid, e); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error("ERROR trying to delete VID = " + thisVid + " " + LogFormatTools.getStackTop(e)); } if (okFlag) { LOGGER.info(" DELETED VID = " + thisVid); @@ -2044,6 +2232,8 @@ public class DataGrooming { } } } else { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); LOGGER.error("ERROR - Vertex Id to keep not found in list of dupes. dupeInfoString = [" + dupeInfoString + "]"); return false; @@ -2123,7 +2313,9 @@ public class DataGrooming { } } catch( Exception ex ){ - LOGGER.error( " ERROR trying to get node for: [" + propsAndValuesForMsg + "]", ex); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); + LOGGER.error( " ERROR trying to get node for: [" + propsAndValuesForMsg + "]" + LogFormatTools.getStackTop(ex)); } if( verts != null ){ @@ -2290,7 +2482,7 @@ public class DataGrooming { Vertex parentVtx = null; Iterator vertI = g.V(startVtx).union(__.inE().has(EdgeProperty.CONTAINS.toString(), AAIDirection.OUT.toString()).outV(), __.outE().has(EdgeProperty.CONTAINS.toString(), AAIDirection.IN.toString()).inV()); - + while( vertI != null && vertI.hasNext() ){ // Note - there better only be one! parentVtx = vertI.next(); @@ -2317,4 +2509,146 @@ public class DataGrooming { } // End of figureWindowStartTime() + /** + * Collect Duplicate Sets for nodes that are NOT dependent on parent nodes. + * + * @param transId the trans id + * @param fromAppId the from app id + * @param g the g + * @param version the version + * @param nType the n type + * @param passedVertList the passed vert list + * @return the array list + */ + private static ArrayList> getDupeSets4NonDepNodes( String transId, + String fromAppId, Graph g, String version, String nType, + ArrayList passedVertList, + ArrayList keyPropNamesArr, + Loader loader ) { + + ArrayList> returnList = new ArrayList>(); + + // We've been passed a set of nodes that we want to check. + // They are all NON-DEPENDENT nodes of the same nodeType meaning that they should be + // unique in the DB based on their KEY DATA alone. So, if + // we group them by their key data - if any key has more than one + // vertex mapped to it, those vertices are dupes. + // + // When we find duplicates, we group them in an ArrayList (there can be + // more than one duplicate for one set of key data) + // Then these dupeSets are grouped up and returned. + // + + HashMap > keyVals2VidHash = new HashMap >(); + HashMap vtxHash = new HashMap (); + Iterator pItr = passedVertList.iterator(); + while (pItr.hasNext()) { + try { + Vertex tvx = pItr.next(); + String thisVid = tvx.id().toString(); + vtxHash.put(thisVid, tvx); + + // if there are more than one vertexId mapping to the same keyProps -- they are dupes + // we dont check till later since a set can contain more than 2. + String hKey = getNodeKeyValString( tvx, keyPropNamesArr ); + if( keyVals2VidHash.containsKey(hKey) ){ + // We've already seen this key + ArrayList tmpVL = (ArrayList )keyVals2VidHash.get(hKey); + tmpVL.add(thisVid); + keyVals2VidHash.put(hKey, tmpVL); + } + else { + // First time for this key + ArrayList tmpVL = new ArrayList (); + tmpVL.add(thisVid); + keyVals2VidHash.put(hKey, tmpVL); + } + } + catch (Exception e) { + LOGGER.warn(" >>> Threw an error in getDupeSets4NonDepNodes - just absorb this error and move on. ", e); + } + } + + for( Map.Entry> entry : keyVals2VidHash.entrySet() ){ + ArrayList vidList = entry.getValue(); + try { + if( !vidList.isEmpty() && vidList.size() > 1 ){ + // There are more than one vertex id's using the same key info + ArrayList vertList = new ArrayList (); + for (int i = 0; i < vidList.size(); i++) { + String tmpVid = vidList.get(i); + vertList.add(vtxHash.get(tmpVid)); + } + returnList.add(vertList); + } + } + catch (Exception e) { + LOGGER.warn(" >>> Threw an error in getDupeSets4NonDepNodes - just absorb this error and move on. ", e); + } + + } + return returnList; + + }// End of getDupeSets4NonDepNodes() + + + /** + * Get values of the key properties for a node as a single string + * + * @param tvx the vertex to pull the properties from + * @param keyPropNamesArr collection of key prop names + * @return a String of concatenated values + */ + private static String getNodeKeyValString( Vertex tvx, + ArrayList keyPropNamesArr ) { + + String retString = ""; + Iterator propItr = keyPropNamesArr.iterator(); + while( propItr.hasNext() ){ + String propName = propItr.next(); + if( tvx != null ){ + Object propValObj = tvx.property(propName).orElse(null); + retString = " " + retString + propValObj.toString(); + } + } + return retString; + + }// End of getNodeKeyValString() + + + static private String findJustOneUsingIndex( String transId, String fromAppId, + GraphTraversalSource gts, HashMap keyPropValsHash, + String nType, Long vidAL, Long vidBL, String apiVer){ + + // See if querying by JUST the key params (which should be indexed) brings back + // ONLY one of the two vertices. Ie. the db still has a pointer to one of them + // and the other one is sort of stranded. + String returnVid = ""; + + try { + List tmpVertList = getNodeJustUsingKeyParams( transId, fromAppId, gts, + nType, keyPropValsHash, apiVer ); + if( tmpVertList != null && tmpVertList.size() == 1 ){ + // We got just one - if it matches one of the ones we're looking + // for, then return that VID + Vertex tmpV = tmpVertList.get(0); + String thisVid = tmpV.id().toString(); + if( thisVid.equals(vidAL.toString()) || thisVid.equals(vidBL.toString()) ){ + String msg = " vid = " + thisVid + " is one of two that the DB can retrieve directly ------"; + //System.out.println(msg); + LOGGER.info(msg); + returnVid = thisVid; + } + } + } + catch ( AAIException ae ){ + String emsg = "Error trying to get node just by key " + ae.getMessage(); + //System.out.println(emsg); + LOGGER.error(emsg); + } + + return returnVid; + + }// End of findJustOneUsingIndex() + } diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java b/aai-core/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java new file mode 100644 index 00000000..52fc8f19 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java @@ -0,0 +1,498 @@ +/** + * ============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.dbgen; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Scanner; +import java.util.Set; +import java.util.UUID; + +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; +import org.apache.tinkerpop.gremlin.structure.Element; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.onap.aai.db.props.AAIProperties; +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.dbmap.InMemoryGraph; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.logging.LogFormatTools; +import org.onap.aai.parsers.uri.URIToObject; +import org.onap.aai.serialization.engines.InMemoryDBEngine; +import org.onap.aai.serialization.engines.QueryStyle; +import org.onap.aai.serialization.db.DBSerializer; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +import org.slf4j.MDC; + +import org.codehaus.jackson.JsonNode; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.node.ObjectNode; +import org.codehaus.jackson.type.TypeReference; + +import java.util.Date; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import org.onap.aai.serialization.tinkerpop.TreeBackedVertex; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; + +import com.beust.jcommander.JCommander; +import com.beust.jcommander.Parameter; + +/** + * The Class ListEndpoints. + */ +public class DynamicPayloadGenerator { + + /* + * Create a Dynamic memory graph instance which should not affect the + * AAIGraph + */ + private InMemoryGraph inMemGraph = null; + private InMemoryDBEngine dbEngine; + + /* + * Loader, QueryStyle, ConnectionType for the Serializer + */ + private Loader loader; + private String urlBase; + private BufferedWriter bw = null; + + private CommandLineArgs cArgs; + + private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(DynamicPayloadGenerator.class); + + private static final QueryStyle queryStyle = QueryStyle.TRAVERSAL; + private static final DBConnectionType type = DBConnectionType.CACHED; + private static final ModelType introspectorFactoryType = ModelType.MOXY; + + /* + * Version + */ + private static final Version version = Version.getLatest(); + + /** + * The main method. + * + * @param args + * the arguments + * @throws AAIException + * @throws Exception + */ + public static void main(String[] args) { + + MDC.put("logFilenameAppender", DynamicPayloadGenerator.class.getSimpleName()); + DynamicPayloadGenerator payloadgen = new DynamicPayloadGenerator(); + try { + payloadgen.init(args); + + payloadgen.generatePayloads(); + } catch (AAIException e) { + LOGGER.error("Exception " + LogFormatTools.getStackTop(e)); + } catch (IOException e) { + LOGGER.error("Exception " + LogFormatTools.getStackTop(e)); + } + System.exit(0); + } + + public void init(String[] args) throws AAIException { + cArgs = new CommandLineArgs(); + JCommander jCommander = new JCommander(cArgs, args); + jCommander.setProgramName(DynamicPayloadGenerator.class.getSimpleName()); + LOGGER.info("Snapshot file" + cArgs.dataSnapshot); + //TODO- How to add dynamic.properties + + + LOGGER.info("output file" + cArgs.output); + + + LOGGER.info("format file" + cArgs.format); + LOGGER.info("format file" + cArgs.schemaEnabled); + if(cArgs.config.isEmpty()) + cArgs.config = AAIConstants.AAI_HOME_ETC_APP_PROPERTIES + "dynamic.properties"; + + LOGGER.info("config file" + cArgs.config); + if(cArgs.nodePropertyFile.isEmpty()) + cArgs.nodePropertyFile = AAIConstants.AAI_HOME_ETC_SCRIPT + "/tenant_isolation/nodes.json"; + LOGGER.info("nodePropertyFile file" + cArgs.nodePropertyFile); + AAIConfig.init(); + + urlBase = AAIConfig.get("aai.server.url.base", ""); + + } + + public void generatePayloads() throws AAIException, IOException{ + + List>> nodeFilters = readFile(cArgs.nodePropertyFile); + LOGGER.info("Load the Graph"); + + this.loadGraph(); + LOGGER.info("Generate payload"); + this.generatePayload(nodeFilters); + LOGGER.info("Close graph"); + this.closeGraph(); + + } + + private List>> readFile(String inputFile) throws IOException { + + InputStream is = new FileInputStream(inputFile); + Scanner scanner = new Scanner(is); + String jsonFile = scanner.useDelimiter("\\Z").next(); + scanner.close(); + + List>> allNodes = new ArrayList<>(); + Map> filterCousins = new HashMap<>(); + Map> filterParents = new HashMap<>(); + + ObjectMapper mapper = new ObjectMapper(); + + JsonNode rootNode = mapper.readTree(jsonFile); + + Iterator> nodeFields = rootNode.getFields(); + + while (nodeFields.hasNext()) { + Entry entry = nodeFields.next(); + String nodeType = entry.getKey(); + JsonNode nodeProperty = entry.getValue(); + + JsonNode cousinFilter = nodeProperty.path("cousins"); + JsonNode parentFilter = nodeProperty.path("parents"); + List cousins = new ObjectMapper().readValue(cousinFilter.traverse(), + new TypeReference>() { + }); + + List parents = new ObjectMapper().readValue(parentFilter.traverse(), + new TypeReference>() { + }); + for (String cousin : cousins) { + LOGGER.info("Cousins-Filtered" + cousin); + } + for (String parent : parents) { + LOGGER.info("Parents-Filtered" + parent); + } + filterCousins.put(nodeType, cousins); + filterParents.put(nodeType, parents); + + } + + allNodes.add(filterCousins); + allNodes.add(filterParents); + return allNodes; + + } + + private void loadGraph() throws IOException { + + loadGraphIntoMemory(); + buildDbEngine(); + + } + + private void loadGraphIntoMemory() throws IOException { + + inMemGraph = new InMemoryGraph.Builder().build(cArgs.dataSnapshot, cArgs.config, cArgs.schemaEnabled); + + } + + private void buildDbEngine() { + // TODO : parametrise version + loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); + + dbEngine = new InMemoryDBEngine(queryStyle, type, loader, inMemGraph.getGraph()); + dbEngine.startTransaction(); + } + + private void generatePayload(List>> nodeFilters) throws AAIException, IOException { + + Map> filterCousinsMap = nodeFilters.get(0); + Map> filterParentsMap = nodeFilters.get(1); + + Set nodeTypes = filterCousinsMap.keySet(); + + for (String nodeType : nodeTypes) { + if ("DMAAP-MR".equals(cArgs.format)) { + bw = createFile(nodeType + ".json"); + } + List filterCousins = filterCousinsMap.get(nodeType); + List filterParents = filterParentsMap.get(nodeType); + readVertices(nodeType, filterCousins, filterParents); + bw.close(); + LOGGER.info("All Done-" + nodeType); + } + + } + + private BufferedWriter createFile(String outfileName) throws IOException { + // FileLocation + String fileName = outfileName; + + File outFile = new File(fileName); + LOGGER.info(" Will write to " + outFile); + FileWriter fw = new FileWriter(outFile.getAbsoluteFile()); + return new BufferedWriter(fw); + + } + + private void createDirectory(String dirName) throws IOException { + // FileLocation + Path pathDir = Paths.get(dirName); + Files.createDirectories(pathDir); + + } + + public void readVertices(String nodeType, List filterCousins, List filterParents) + throws AAIException, IOException { + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "sourceOfTruth"); + List nodes = inMemGraph.getGraph().traversal().V().has("aai-node-type", nodeType).toList(); + + LOGGER.info("Number of nodes" + nodes.size()); + String dirName = cArgs.output + AAIConstants.AAI_FILESEP + nodeType + AAIConstants.AAI_FILESEP; + createDirectory( dirName); + // TODO: Formatter + if ("DMAAP-MR".equals(cArgs.format)) { + for (Vertex node : nodes) { + + Introspector nodeObj = serializer.getLatestVersionView(node); + createPayloadForDmaap(node, nodeObj); + + } + } + int counter = 0; + if ("PAYLOAD".equals(cArgs.format)) { + for (Vertex node : nodes) { + + counter++; + String filename = dirName + counter + "-" + nodeType + ".json"; + bw = createFile(filename); + Introspector obj = loader.introspectorFromName(nodeType); + Set seen = new HashSet<>(); + int depth = AAIProperties.MAXIMUM_DEPTH; + boolean nodeOnly = false; + + Tree tree = dbEngine.getQueryEngine().findSubGraph(node, depth, nodeOnly); + TreeBackedVertex treeVertex = new TreeBackedVertex(node, tree); + serializer.dbToObjectWithFilters(obj, treeVertex, seen, depth, nodeOnly, filterCousins, filterParents); + createPayloadForPut(obj); + bw.close(); + + URI uri = serializer.getURIForVertex(node); + String filenameWithUri = dirName + counter + "-" + nodeType + ".txt"; + bw = createFile(filenameWithUri); + bw.write(uri.toString()); + bw.newLine(); + bw.close(); + } + } + + } + + public void createPayloadForPut(Introspector nodeObj) throws IOException { + + String entityJson = nodeObj.marshal(false); + ObjectMapper mapper = new ObjectMapper(); + + ObjectNode rootNode = (ObjectNode) mapper.readTree(entityJson); + rootNode.remove("resource-version"); + + bw.newLine(); + bw.write(rootNode.toString()); + bw.newLine(); + } + + public void createPayloadForDmaap(Vertex node, Introspector nodeObj) + throws AAIException, UnsupportedEncodingException { + + DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, "sourceOfTruth"); + + URI uri = serializer.getURIForVertex(node); + + String sourceOfTruth = ""; + HashMap relatedVertices = new HashMap<>(); + List vertexChain = dbEngine.getQueryEngine().findParents(node); + + for (Vertex vertex : vertexChain) { + try { + + Introspector vertexObj = serializer.getVertexProperties(vertex); + + relatedVertices.put(vertexObj.getObjectId(), vertexObj); + } catch (AAIUnknownObjectException e) { + LOGGER.warn("Unable to get vertex properties, partial list of related vertices returned"); + } + + } + + String transactionId = "TXID"; + createNotificationEvent(transactionId, sourceOfTruth, uri, nodeObj, relatedVertices); + + } + + public void createNotificationEvent(String transactionId, String sourceOfTruth, URI uri, Introspector obj, + Map relatedObjects) throws AAIException, UnsupportedEncodingException { + + String action = "CREATE"; + final Introspector notificationEvent = loader.introspectorFromName("notification-event"); + + try { + Introspector eventHeader = loader.introspectorFromName("notification-event-header"); + URIToObject parser = new URIToObject(loader, uri, (HashMap) relatedObjects); + + String entityLink = urlBase + version + uri; + + notificationEvent.setValue("cambria-partition", "AAI"); + + eventHeader.setValue("entity-link", entityLink); + eventHeader.setValue("action", action); + eventHeader.setValue("entity-type", obj.getDbName()); + eventHeader.setValue("top-entity-type", parser.getTopEntityName()); + eventHeader.setValue("source-name", sourceOfTruth); + eventHeader.setValue("version", version.toString()); + eventHeader.setValue("id", transactionId); + eventHeader.setValue("event-type", "AAI-BASELINE"); + if (eventHeader.getValue("domain") == null) { + eventHeader.setValue("domain", AAIConfig.get("aai.notificationEvent.default.domain", "UNK")); + } + + if (eventHeader.getValue("sequence-number") == null) { + eventHeader.setValue("sequence-number", + AAIConfig.get("aai.notificationEvent.default.sequenceNumber", "UNK")); + } + + if (eventHeader.getValue("severity") == null) { + eventHeader.setValue("severity", AAIConfig.get("aai.notificationEvent.default.severity", "UNK")); + } + + if (eventHeader.getValue("id") == null) { + eventHeader.setValue("id", genDate2() + "-" + UUID.randomUUID().toString()); + + } + + if (eventHeader.getValue("timestamp") == null) { + eventHeader.setValue("timestamp", genDate()); + } + + List parentList = parser.getParentList(); + parentList.clear(); + + if (!parser.getTopEntity().equals(parser.getEntity())) { + Introspector child; + String json = obj.marshal(false); + child = parser.getLoader().unmarshal(parser.getEntity().getName(), json); + parentList.add(child.getUnderlyingObject()); + } + + final Introspector eventObject; + + String json = ""; + if (parser.getTopEntity().equals(parser.getEntity())) { + json = obj.marshal(false); + eventObject = loader.unmarshal(obj.getName(), json); + } else { + json = parser.getTopEntity().marshal(false); + + eventObject = loader.unmarshal(parser.getTopEntity().getName(), json); + } + notificationEvent.setValue("event-header", eventHeader.getUnderlyingObject()); + notificationEvent.setValue("entity", eventObject.getUnderlyingObject()); + + String entityJson = notificationEvent.marshal(false); + + bw.newLine(); + bw.write(entityJson); + + } catch (AAIUnknownObjectException e) { + LOGGER.error("Fatal error - notification-event-header object not found!"); + } catch (Exception e) { + LOGGER.error("Unmarshalling error occurred while generating Notification " + LogFormatTools.getStackTop(e)); + } + } + + private void closeGraph() { + inMemGraph.getGraph().tx().rollback(); + inMemGraph.getGraph().close(); + } + + public static String genDate() { + Date date = new Date(); + DateFormat formatter = new SimpleDateFormat("yyyyMMdd-HH:mm:ss:SSS"); + return formatter.format(date); + } + + public static String genDate2() { + Date date = new Date(); + DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); + return formatter.format(date); + } + +} + +class CommandLineArgs { + + @Parameter(names = "--help", help = true) + public boolean help; + + @Parameter(names = "-d", description = "snapshot file to be loaded") + public String dataSnapshot; + + @Parameter(names = "-s", description = "is schema to be enabled ", arity = 1) + public boolean schemaEnabled = true; + + @Parameter(names = "-c", description = "location of configuration file") + public String config = ""; + + @Parameter(names = "-o", description = "output location") + public String output = ""; + + @Parameter(names = "-f", description = "format of output") + public String format = "PAYLOAD"; + + @Parameter(names = "-n", description = "Node input file") + public String nodePropertyFile = ""; + +} diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/GenTester.java b/aai-core/src/main/java/org/onap/aai/dbgen/GenTester.java index 7b9eb2fc..81672949 100644 --- a/aai-core/src/main/java/org/onap/aai/dbgen/GenTester.java +++ b/aai-core/src/main/java/org/onap/aai/dbgen/GenTester.java @@ -28,10 +28,13 @@ import com.thinkaurelius.titan.core.TitanGraph; import com.thinkaurelius.titan.core.schema.TitanManagement; import org.onap.aai.dbmap.AAIGraph; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import org.onap.aai.util.AAIConfig; import org.onap.aai.util.AAIConstants; import java.util.Properties; +import java.util.UUID; public class GenTester { @@ -46,7 +49,7 @@ public class GenTester { public static void main(String[] args) { TitanGraph graph = null; - + System.setProperty("aai.service.name", GenTester.class.getSimpleName()); // Set the logging file properties to be used by EELFManager Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_CREATE_DB_SCHEMA_LOGBACK_PROPS); @@ -54,7 +57,16 @@ public class GenTester { LOGGER = EELFManager.getInstance().getLogger(GenTester.class); boolean addDefaultCR = true; - try { + LoggingContext.init(); + LoggingContext.component("DBGenTester"); + LoggingContext.partnerName("AAI-TOOLS"); + LoggingContext.targetEntity("AAI"); + LoggingContext.requestId(UUID.randomUUID().toString()); + LoggingContext.serviceName("AAI"); + LoggingContext.targetServiceName("main"); + LoggingContext.statusCode(StatusCode.COMPLETE); + LoggingContext.responseCode(LoggingContext.SUCCESS); + try { AAIConfig.init(); if (args != null && args.length > 0 ){ if( "genDbRulesOnly".equals(args[0]) ){ @@ -88,6 +100,8 @@ public class GenTester { String emsg = "Unrecognized argument passed to GenTester.java: [" + args[0] + "]. "; System.out.println(emsg); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); LOGGER.error(emsg); emsg = "Either pass no argument for normal processing, or use 'GEN_DB_WITH_NO_SCHEMA'."; diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java index 132ad46a..e26ba2c2 100644 --- a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java +++ b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java @@ -34,6 +34,7 @@ import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.schema.enums.PropertyMetadata; import org.onap.aai.serialization.db.EdgeRule; import org.onap.aai.serialization.db.EdgeRules; @@ -80,7 +81,7 @@ public class SchemaGenerator{ AAIConfig.init(); } catch (Exception ex){ - LOGGER.error(" ERROR - Could not run AAIConfig.init(). ", ex); + LOGGER.error(" ERROR - Could not run AAIConfig.init(). " + LogFormatTools.getStackTop(ex)); System.out.println(" ERROR - Could not run AAIConfig.init(). "); System.exit(1); } diff --git a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java index e62e8e7e..5c7abfe2 100644 --- a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java +++ b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java @@ -29,6 +29,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; +import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.io.IoCore; @@ -58,8 +59,9 @@ public class AAIGraph { private static final EELFLogger logger = EELFManager.getInstance().getLogger(AAIGraph.class); protected static final String COMPONENT = "aaidbmap"; protected Map graphs = new HashMap<>(); - private final String REALTIME_DB = "realtime"; - private final String CACHED_DB = "cached"; + private static final String REALTIME_DB = "realtime"; + private static final String CACHED_DB = "cached"; + private static boolean isInit = false; @@ -68,6 +70,7 @@ public class AAIGraph { */ private AAIGraph() { try { + String serviceName = System.getProperty("aai.service.name", "NA"); String rtConfig = System.getProperty("realtime.db.config"); String cachedConfig = System.getProperty("cached.db.config"); if (rtConfig == null) { @@ -76,8 +79,8 @@ public class AAIGraph { if (cachedConfig == null) { cachedConfig = AAIConstants.CACHED_DB_CONFIG; } - this.loadGraph(REALTIME_DB, rtConfig); - this.loadGraph(CACHED_DB, cachedConfig); + this.loadGraph(REALTIME_DB, rtConfig, serviceName); + this.loadGraph(CACHED_DB, cachedConfig, serviceName); } catch (Exception e) { throw new RuntimeException("Failed to instantiate graphs", e); } @@ -93,17 +96,23 @@ public class AAIGraph { * @return single instance of AAIGraph */ public static AAIGraph getInstance() { + isInit = true; return Helper.INSTANCE; } + + public static boolean isInit() { + return isInit; + } - private void loadGraph(String name, String configPath) throws AAIException { + private void loadGraph(String name, String configPath, String serviceName) throws Exception { // Graph being opened by TitanFactory is being placed in hashmap to be used later // These graphs shouldn't be closed until the application shutdown - TitanGraph graph = TitanFactory.open(configPath); - try (InputStream is = new FileInputStream(configPath)) { + try { + PropertiesConfiguration propertiesConfiguration = new AAIGraphConfig.Builder(configPath).forService(serviceName).withGraphType(name).buildConfiguration(); + TitanGraph graph = TitanFactory.open(propertiesConfiguration); Properties graphProps = new Properties(); - graphProps.load(is); + propertiesConfiguration.getKeys().forEachRemaining(k -> graphProps.setProperty(k, propertiesConfiguration.getString(k))); if ("inmemory".equals(graphProps.get("storage.backend"))) { // Load the propertyKeys, indexes and edge-Labels into the DB @@ -155,10 +164,10 @@ public class AAIGraph { } /** - * Graph shutdown. + * Close all of the graph connections made in the instance. */ public void graphShutdown() { - graphs.get(REALTIME_DB).close(); + graphs.values().stream().filter(TitanGraph::isOpen).forEach(TitanGraph::close); } /** diff --git a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraphConfig.java b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraphConfig.java new file mode 100644 index 00000000..e67051f0 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraphConfig.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.dbmap; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.common.base.Preconditions; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.thinkaurelius.titan.diskstorage.configuration.ConfigElement; +import com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.lang.StringUtils; + +import java.io.File; +import java.io.FileNotFoundException; +import java.lang.management.ManagementFactory; +import java.util.Iterator; +import java.util.Objects; +import java.util.regex.Pattern; + +import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.*; + +/** + * For building a config that TitanFactory.open can use with an identifiable graph.unique-instance-id + */ +public class AAIGraphConfig { + + private static final EELFLogger logger = EELFManager.getInstance().getLogger(AAIGraphConfig.class); + + private AAIGraphConfig(){}; + + public PropertiesConfiguration getCc(String configPath, String graphType, String service) throws ConfigurationException, FileNotFoundException { + + PropertiesConfiguration cc = this.loadTitanPropFile(configPath); + + String uid = ManagementFactory.getRuntimeMXBean().getName() + "_" + service + "_" + graphType + "_" + System.currentTimeMillis(); + for (char c : ConfigElement.ILLEGAL_CHARS) { + uid = StringUtils.replaceChars(uid, c,'_'); + } + + cc.addProperty("graph.unique-instance-id", uid); + + return cc; + } + + + private PropertiesConfiguration loadTitanPropFile(String shortcutOrFile) throws ConfigurationException, FileNotFoundException { + File file = new File(shortcutOrFile); + if (file.exists()) { + PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration(); + propertiesConfiguration.setAutoSave(false); + propertiesConfiguration.load(shortcutOrFile); + return propertiesConfiguration; + } else { + throw new FileNotFoundException(shortcutOrFile); + } + } + + public static class Builder { + private String configPath; + private String graphType; + private String service; + + public Builder(String configPath) { + this.configPath = configPath; + } + + public Builder withGraphType(String graphType) { + this.graphType = Objects.toString(graphType, "NA"); + return this; + } + + public Builder forService(String service) { + this.service = Objects.toString(service, "NA"); + return this; + } + + public PropertiesConfiguration buildConfiguration() throws ConfigurationException, FileNotFoundException { + return new AAIGraphConfig().getCc(this.configPath, this.graphType, this.service); + } + + } + + +} diff --git a/aai-core/src/main/java/org/onap/aai/dbmap/InMemoryGraph.java b/aai-core/src/main/java/org/onap/aai/dbmap/InMemoryGraph.java new file mode 100644 index 00000000..61b4e36e --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/dbmap/InMemoryGraph.java @@ -0,0 +1,106 @@ +/** + * ============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.dbmap; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +import java.util.Properties; + +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.structure.io.IoCore; +import org.onap.aai.dbgen.SchemaGenerator; +import org.onap.aai.logging.LogFormatTools; + +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanTransaction; +import com.thinkaurelius.titan.core.schema.TitanManagement; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +public class InMemoryGraph { + + private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(InMemoryGraph.class); + private TitanGraph graph = null; + + + public InMemoryGraph(Builder builder) throws IOException { + /* + * Create a In-memory graph + */ + InputStream is = new FileInputStream(builder.propertyFile); + try { + graph = TitanFactory.open(builder.propertyFile); + + Properties graphProps = new Properties(); + graphProps.load(is); + TitanManagement graphMgt = graph.openManagement(); + if(builder.isSchemaEnabled){ + LOGGER.info("Schema Enabled"); + SchemaGenerator.loadSchemaIntoTitan(graph, graphMgt); + } + TitanTransaction transaction = graph.newTransaction(); + LOGGER.info("Loading snapshot"); + transaction.io(IoCore.graphson()).readGraph(builder.graphsonLocation); + transaction.commit(); + + } catch (Exception e) { + // TODO : Changesysout to logger + LOGGER.error( + "ERROR: Could not load datasnapshot to in memory graph. \n" + LogFormatTools.getStackTop(e)); + throw new IllegalStateException("Could not load datasnapshot to in memory graph"); + + } + finally{ + is.close(); + } + + } + + public static class Builder { + private String graphsonLocation = ""; + private String propertyFile = ""; + private boolean isSchemaEnabled = false; + + /* + * Builder constructor doesnt do anything + */ + public Builder() { + //Do nothing + } + + public InMemoryGraph build(String graphsonFile, String propertyFile, boolean isSchemaEnabled) throws IOException { + this.graphsonLocation = graphsonFile; + this.propertyFile = propertyFile; + this.isSchemaEnabled = isSchemaEnabled; + return new InMemoryGraph(this); + } + } + + public TitanGraph getGraph() { + return graph; + } + +} diff --git a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java index d5389981..e52cc3ed 100644 --- a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java +++ b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java @@ -104,7 +104,16 @@ public class AAIDmaapEventJMSConsumer implements MessageListener { eventName = jo.getString("event-topic"); } + MDC.put ("targetEntity", "DMAAP"); + if (jo.getString("event-topic") != null) { + eventName = jo.getString("event-topic"); + MDC.put ("targetServiceName", eventName); + } + MDC.put ("serviceName", "AAI"); + MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.COMPLETE.toString()); + MDC.put(LoggingField.RESPONSE_CODE.toString(), "0"); LOGGER.info(eventName + "|" + aaiEvent); + if ("AAI-EVENT".equals(eventName)) { this.sentWithHttp(this.httpClient, this.aaiEventUrl, aaiEvent); } else { @@ -113,13 +122,21 @@ public class AAIDmaapEventJMSConsumer implements MessageListener { } } catch (java.net.SocketException e) { if (!e.getMessage().contains("Connection reset")) { + MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString()); + MDC.put(LoggingField.RESPONSE_CODE.toString(), "200"); LOGGER.error("AAI_7304 Error reaching DMaaP to send event. " + aaiEvent, e); } } catch (IOException e) { + MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString()); + MDC.put(LoggingField.RESPONSE_CODE.toString(), "200"); LOGGER.error("AAI_7304 Error reaching DMaaP to send event. " + aaiEvent, e); } catch (JMSException | JSONException e) { + MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString()); + MDC.put(LoggingField.RESPONSE_CODE.toString(), "200"); LOGGER.error("AAI_7350 Error parsing aaievent jsm message for sending to dmaap. " + jsmMessageTxt, e); } catch (Exception e) { + MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString()); + MDC.put(LoggingField.RESPONSE_CODE.toString(), "200"); LOGGER.error("AAI_7350 Error sending message to dmaap. " + jsmMessageTxt, e); } } diff --git a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSProducer.java b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSProducer.java index d41f4768..914042d4 100644 --- a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSProducer.java +++ b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSProducer.java @@ -35,7 +35,8 @@ public class AAIDmaapEventJMSProducer { public AAIDmaapEventJMSProducer() { if(AAIConfig.get("aai.jms.enable", "true").equals("true")){ this.jmsTemplate = new JmsTemplate(); - this.jmsTemplate.setConnectionFactory(new CachingConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61447"))); + String activeMqTcpUrl = System.getProperty("activemq.tcp.url", "tcp://localhost:61447"); + this.jmsTemplate.setConnectionFactory(new CachingConnectionFactory(new ActiveMQConnectionFactory(activeMqTcpUrl))); this.jmsTemplate.setDefaultDestination(new ActiveMQQueue("IN_QUEUE")); } } diff --git a/aai-core/src/main/java/org/onap/aai/extensions/OrphanLInterfaceHandler.java b/aai-core/src/main/java/org/onap/aai/extensions/OrphanLInterfaceHandler.java new file mode 100644 index 00000000..3da4e227 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/extensions/OrphanLInterfaceHandler.java @@ -0,0 +1,112 @@ +/** + * ============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.extensions; + +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.parsers.query.QueryParser; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.rest.db.DBRequest; +import org.onap.aai.restcore.HttpMethod; +import org.onap.aai.serialization.db.EdgeType; + +public class OrphanLInterfaceHandler { + + private QueryBuilder createLInterfaceQuery(AAIExtensionMap aaiReqMap, Introspector newvceObj) throws AAIException { + Introspector uplinkLInterfaceTraversalIntro = aaiReqMap.getLoader().introspectorFromName("l-interface"); + + Introspector customerUplinkLInterfaceTraversalIntro = aaiReqMap.getLoader().introspectorFromName("l-interface"); + + Introspector logLinkIntroForTraversal = aaiReqMap.getLoader().introspectorFromName("logical-link"); + + QueryBuilder query = aaiReqMap.getTransactionalGraphEngine().getQueryBuilder() + .exactMatchQuery(newvceObj) + .createEdgeTraversal(EdgeType.TREE, newvceObj, uplinkLInterfaceTraversalIntro) + .getVerticesByProperty("interface-role", "UPLINK") + .createEdgeTraversal(EdgeType.COUSIN, uplinkLInterfaceTraversalIntro, logLinkIntroForTraversal) + .createEdgeTraversal(EdgeType.COUSIN, logLinkIntroForTraversal, customerUplinkLInterfaceTraversalIntro) + .getVerticesByProperty("interface-role", "CUSTOMER-UPLINK").dedup(); + return query; + } + + private URI buildLInterfaceURI(Vertex linterface, AAIExtensionMap aaiReqMap) throws UnsupportedEncodingException, AAIException, URISyntaxException { + Loader loader = aaiReqMap.getLoader(); + Introspector lint = loader.introspectorFromName("l-interface"); + lint.setValue("interface-name", (String)linterface.property("interface-name").value()); + String lintSegment = lint.getURI(); + + Introspector lagInterfaceForTrav = loader.introspectorFromName("lag-interface"); + QueryBuilder lagIntQuery = aaiReqMap.getTransactionalGraphEngine().getQueryBuilder() + .exactMatchQuery(lint) + .createEdgeTraversal(EdgeType.TREE, linterface, lagInterfaceForTrav).dedup(); + List lagInterfaces = lagIntQuery.toList(); + if (lagInterfaces.isEmpty()) { + throw new AAIException("AAI_6114"); + } else if (lagInterfaces.size() > 1) { + throw new AAIException("AAI_6140"); + } + Vertex lagInt = lagInterfaces.get(0); + lagInterfaceForTrav.setValue("interface-name", (String)lagInt.property("interface-name").value()); + String lagSegment = lagInterfaceForTrav.getURI(); + + Introspector gvVPEforTrav = loader.introspectorFromName("generic-vnf"); + QueryBuilder gvVPEquery = aaiReqMap.getTransactionalGraphEngine().getQueryBuilder() + .exactMatchQuery(lagInterfaceForTrav) + .createEdgeTraversal(EdgeType.TREE, lagInterfaceForTrav, gvVPEforTrav).dedup(); + List genvnfs = gvVPEquery.toList(); + if (genvnfs.isEmpty()) { + throw new AAIException("AAI_6114"); + } else if (genvnfs.size() > 1) { + throw new AAIException("AAI_6140"); + } + Vertex genvnf = genvnfs.get(0); + gvVPEforTrav.setValue("vnf-id", (String)genvnf.property("vnf-id").value()); + String gvSegment = gvVPEforTrav.getURI(); + + return new URI(gvSegment + lagSegment + lintSegment); + } + + public List createOrphanLInterfaceDelRequests(AAIExtensionMap aaiReqMap, Introspector newvce) throws AAIException, UnsupportedEncodingException, URISyntaxException{ + List requests = new ArrayList<>(); + QueryBuilder query = createLInterfaceQuery(aaiReqMap, newvce); + List linterfaces = query.toList(); + + for (Vertex lint : linterfaces) { + URI lintURI = buildLInterfaceURI(lint, aaiReqMap); + QueryParser parser = createLInterfaceQuery(aaiReqMap, newvce).createQueryFromObjectName("l-interface"); + DBRequest originalDbRequest = aaiReqMap.getDbRequest(); + DBRequest request = new DBRequest.Builder(HttpMethod.DELETE, lintURI, parser, newvce, originalDbRequest.getHeaders(), originalDbRequest.getInfo(), originalDbRequest.getTransactionId()).build(); + requests.add(request); + } + + return requests; + } +} diff --git a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java index f6609bff..fa8be863 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java @@ -28,6 +28,7 @@ import org.apache.commons.lang.ClassUtils; import org.eclipse.persistence.exceptions.DynamicException; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.restcore.MediaType; import org.onap.aai.schema.enums.ObjectMetadata; import org.onap.aai.schema.enums.PropertyMetadata; @@ -465,7 +466,7 @@ public abstract class Introspector implements Cloneable { break; } } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping inheritor " + inheritor + " (Unknown Object)", e); + LOGGER.warn("Skipping inheritor " + inheritor + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } } else { diff --git a/aai-core/src/main/java/org/onap/aai/introspection/IntrospectorWalker.java b/aai-core/src/main/java/org/onap/aai/introspection/IntrospectorWalker.java index 09dcec64..e939b6d9 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/IntrospectorWalker.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/IntrospectorWalker.java @@ -25,6 +25,7 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.logging.LogFormatTools; import java.util.HashSet; import java.util.LinkedHashSet; @@ -141,7 +142,7 @@ public class IntrospectorWalker { walk(child, parent, localVisited); } } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping property " + prop + " (Unknown Object)", e); + LOGGER.warn("Skipping property " + prop + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } else { w.processPrimitiveList(prop, obj); @@ -159,7 +160,7 @@ public class IntrospectorWalker { obj.setValue(prop, listReference); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping property " + prop + " (Unknown Object)", e); + LOGGER.warn("Skipping property " + prop + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } else if (!isComplexType){ w.processPrimitiveList(prop, obj); @@ -176,7 +177,7 @@ public class IntrospectorWalker { child = obj.newIntrospectorInstanceOfProperty(prop); obj.setValue(prop, child.getUnderlyingObject()); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping property " + prop + " (Unknown Object)", e); + LOGGER.warn("Skipping property " + prop + " (Unknown Object) " + LogFormatTools.getStackTop(e)); } } } diff --git a/aai-core/src/main/java/org/onap/aai/introspection/ModelInjestor.java b/aai-core/src/main/java/org/onap/aai/introspection/ModelInjestor.java index 4cdfc634..c670e946 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/ModelInjestor.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/ModelInjestor.java @@ -105,7 +105,7 @@ public class ModelInjestor { */ public Version getVersionFromClassName (String classname) { Matcher m = classNamePattern.matcher(classname); - String version = "v2"; //for the OXM, only the v2 ones don't include a model name, hence this default + String version = "v12"; if (m.find()) { version = m.group(1); } diff --git a/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java b/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java index cf81349c..56ad2dc2 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/MoxyLoader.java @@ -32,6 +32,7 @@ import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.introspection.exceptions.AAIUnmarshallingException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.restcore.MediaType; import org.onap.aai.workarounds.NamingExceptions; import org.w3c.dom.Document; @@ -157,7 +158,7 @@ public class MoxyLoader extends Loader { Introspector introspector = this.introspectorFromName(objName); map.put(introspector.getDbName(), introspector); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Unexpected AAIUnknownObjectException while running getAllObjects()", e); + LOGGER.warn("Unexpected AAIUnknownObjectException while running getAllObjects() " + LogFormatTools.getStackTop(e)); } } allObjs = map.build(); @@ -182,7 +183,7 @@ public class MoxyLoader extends Loader { result.add(list.item(i).getAttributes().getNamedItem("name").getNodeValue()); } } catch (ParserConfigurationException | SAXException | IOException e) { - LOGGER.warn("Exception while enumerating objects for API version " + getVersion() + " (returning partial results)", e); + LOGGER.warn("Exception while enumerating objects for API version " + getVersion() + " (returning partial results) " + LogFormatTools.getStackTop(e)); } //result.remove("EdgePropNames"); diff --git a/aai-core/src/main/java/org/onap/aai/introspection/PojoLoader.java b/aai-core/src/main/java/org/onap/aai/introspection/PojoLoader.java index 62a7dc0e..88411476 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/PojoLoader.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/PojoLoader.java @@ -30,6 +30,7 @@ import org.onap.aai.db.props.AAIProperties; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.introspection.exceptions.AAIUnmarshallingException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.restcore.MediaType; import org.onap.aai.workarounds.NamingExceptions; @@ -60,7 +61,7 @@ public class PojoLoader extends Loader { try { context = JAXBContextFactory.createContext(pojoPackageName, this.getClass().getClassLoader()); } catch (JAXBException e) { - LOGGER.error("JAXBException while instantiation contect for PojoLoader", e); + LOGGER.error("JAXBException while instantiation contect for PojoLoader " + LogFormatTools.getStackTop(e)); } } diff --git a/aai-core/src/main/java/org/onap/aai/introspection/tools/CreateUUID.java b/aai-core/src/main/java/org/onap/aai/introspection/tools/CreateUUID.java index b049c5c5..a061ad6f 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/tools/CreateUUID.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/tools/CreateUUID.java @@ -27,10 +27,37 @@ import org.onap.aai.schema.enums.PropertyMetadata; import java.util.Map; import java.util.UUID; +/** + * CreateUUID is an issue resolver that is responsible + * for looking to check if the property that is missing has + * the metadata autoGenerateUuid associated to it in the oxm + * As if that is found, then it will automatically resolve the + * issue by generating a uuid and setting that value to that property + * + * If this is needed for a specific property that you need + * then you need to add the following xml code in the oxm + * + *
+ *     {@code
+ *      
+ *      
+ *          
+ *      
+ *     }
+ * 
+ */ public class CreateUUID implements IssueResolver { /** - * {@inheritDoc} + * Resolves the issue by checking if the issue type is missing key prop + * and if it is it will retrieve the introspector associated with the issue + * then gets the metadata associated to that specific property + * and if it contains the auto generate meta property and if it does + * then it will fix it by setting that property value to generated uuid + * + * @param issue the issue with the details associated to the problem + * @return true if the issue has been successfully resolved + * false otherwise */ @Override public boolean resolveIssue(Issue issue) { diff --git a/aai-core/src/main/java/org/onap/aai/logging/EcompErrorCategory.java b/aai-core/src/main/java/org/onap/aai/logging/EcompErrorCategory.java new file mode 100644 index 00000000..9bf4056e --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/logging/EcompErrorCategory.java @@ -0,0 +1,44 @@ +/** + * ============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.logging; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.Level; + +public class EcompErrorCategory extends ClassicConverter { + + @Override + public String convert(ILoggingEvent event) { + + final Level lev = event.getLevel(); + final String defaultCategory = "WARN"; + + if ((Level.WARN).equals(lev)) { + return (defaultCategory); + } + else if ((Level.ERROR).equals(lev)) { + return ("ERROR"); + } + return (defaultCategory); + } +} diff --git a/aai-core/src/main/java/org/onap/aai/logging/EcompPatternLayout.java b/aai-core/src/main/java/org/onap/aai/logging/EcompPatternLayout.java index a08c021f..b0eba743 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/EcompPatternLayout.java +++ b/aai-core/src/main/java/org/onap/aai/logging/EcompPatternLayout.java @@ -28,5 +28,8 @@ public class EcompPatternLayout extends PatternLayout { PatternLayout.defaultConverterMap.put("ecompStartTime", EcompStartTime.class.getName()); PatternLayout.defaultConverterMap.put("ecompElapsedTime", EcompElapsedTime.class.getName()); PatternLayout.defaultConverterMap.put("eelfClassOfCaller", EelfClassOfCaller.class.getName()); + PatternLayout.defaultConverterMap.put("ecompErrorCategory", EcompErrorCategory.class.getName()); + PatternLayout.defaultConverterMap.put("ecompResponseCode", EcompResponseCode.class.getName()); + PatternLayout.defaultConverterMap.put("ecompResponseDescription", EcompResponseDescription.class.getName()); } } diff --git a/aai-core/src/main/java/org/onap/aai/logging/EcompResponseCode.java b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseCode.java new file mode 100644 index 00000000..af3fdb71 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseCode.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.logging; + +import org.onap.aai.logging.LoggingContext.LoggingField; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class EcompResponseCode extends ClassicConverter { + + @Override + public String convert(ILoggingEvent event) { + + if (!event.getMDCPropertyMap().containsKey(LoggingField.RESPONSE_CODE.toString())) { + // if response code is not set, return "unknown" (900) + return LoggingContext.UNKNOWN_ERROR; + } + return event.getMDCPropertyMap().get(LoggingField.RESPONSE_CODE.toString()); + } +} diff --git a/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.java new file mode 100644 index 00000000..6ef4b758 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/logging/EcompResponseDescription.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.logging; + +import org.onap.aai.logging.LoggingContext.LoggingField; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class EcompResponseDescription extends ClassicConverter { + public final static String DefaultDescription = "Unknown response/error description"; + @Override + public String convert(ILoggingEvent event) { + + if (!event.getMDCPropertyMap().containsKey(LoggingField.RESPONSE_DESCRIPTION.toString())) { + return (DefaultDescription); + } + // Replace pipes and new lines + String currentDesc = event.getMDCPropertyMap().get(LoggingField.RESPONSE_DESCRIPTION.toString()); + if ( (currentDesc == null) || (currentDesc.length() == 0) ) { + return (DefaultDescription); + } + currentDesc = currentDesc.replaceAll("|", "!"); + currentDesc = currentDesc.replaceAll("[\\r\\n]+", "^"); + return event.getMDCPropertyMap().get(LoggingField.RESPONSE_DESCRIPTION.toString()); + } +} diff --git a/aai-core/src/main/java/org/onap/aai/logging/ErrorLogHelper.java b/aai-core/src/main/java/org/onap/aai/logging/ErrorLogHelper.java index 1c3ab853..a585a4a9 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/ErrorLogHelper.java +++ b/aai-core/src/main/java/org/onap/aai/logging/ErrorLogHelper.java @@ -291,7 +291,7 @@ public class ErrorLogHelper { } } catch (Exception ex) { - LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex); + LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage()); } } else { @@ -319,7 +319,7 @@ public class ErrorLogHelper { response = (MapperUtil.writeAsJSONString((Object) restresp)); } } catch (AAIException ex) { - LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex); + LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage()); } } } @@ -343,7 +343,7 @@ public class ErrorLogHelper { public static String getRESTAPIErrorResponseWithLogging(List acceptHeadersOrig, AAIException are, ArrayList variables) { String response = ErrorLogHelper.getRESTAPIErrorResponse(acceptHeadersOrig, are, variables); - LOGGER.error(are.getMessage(), are); + LOGGER.error(are.getMessage() + " " + LogFormatTools.getStackTop(are)); return response; } @@ -427,7 +427,7 @@ public class ErrorLogHelper { responseMessages.getResponseMessage().add(responseMessage); } catch (Exception ex) { - LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex); + LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage()); } } @@ -553,7 +553,7 @@ public class ErrorLogHelper { } } catch (Exception ex) { - LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex); + LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error "+ ex.getMessage()); } return response; } @@ -571,7 +571,13 @@ public class ErrorLogHelper { LoggingContext.severity(sevCode); } } - + String stackTrace = ""; + try { + stackTrace = LogFormatTools.getStackTop(e); + } + catch (Exception a) { + //ignore + } final String errorMessage = new StringBuilder() .append(errorObject.getErrorText()) .append(":") @@ -586,14 +592,19 @@ public class ErrorLogHelper { LoggingContext.responseDescription(errorMessage); LoggingContext.statusCode(StatusCode.ERROR); + final String details = new StringBuilder().append(errorObject.getErrorCodeString()) + .append(" ") + .append(stackTrace) + .toString(); + if (errorObject.getSeverity().equalsIgnoreCase("WARN")) - LOGGER.warn(errorMessage, e); + LOGGER.warn(details); else if (errorObject.getSeverity().equalsIgnoreCase("ERROR")) - LOGGER.error(errorMessage, e); + LOGGER.error(details); else if (errorObject.getSeverity().equalsIgnoreCase("FATAL")) - LOGGER.error(errorMessage, e); + LOGGER.error(details); else if (errorObject.getSeverity().equals("INFO")) - LOGGER.info(errorMessage + ", " + e.getMessage()); + LOGGER.info(details); } public static void logError(String code) { diff --git a/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java b/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java index 702741b1..19650b65 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java +++ b/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java @@ -25,6 +25,10 @@ import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import org.onap.aai.util.AAIConfig; +import org.onap.aai.util.AAIConstants; +import org.onap.aai.exceptions.AAIException; +import org.apache.commons.lang.exception.ExceptionUtils; public class LogFormatTools { @@ -43,4 +47,76 @@ public class LogFormatTools { public static long toTimestamp(String date) { return ZonedDateTime.parse(date, DTF).toInstant().toEpochMilli(); } + /** + * Gets the stack top. + * + * @param e the e + * @return the stack top + * @throws NumberFormatException the number format exception + * @throws AAIException the AAI exception + */ + public static String getStackTop(Throwable e) { + StringBuffer stackMessage = new StringBuffer(); + int maxStackTraceEntries = 10; + try { + maxStackTraceEntries = Integer.valueOf(AAIConfig.get(AAIConstants.LOGGING_MAX_STACK_TRACE_ENTRIES)); + } + catch (AAIException a) { + //ignore, use default + } + catch (NumberFormatException n) { + //ignore, use default + } + if (e != null) { + Throwable rootCause = ExceptionUtils.getRootCause(e); + if (rootCause != null) { + stackMessage.append("root cause=" + ExceptionUtils.getRootCause(e)); + StackTraceElement[] elements = rootCause.getStackTrace(); + int i = 0; + for (StackTraceElement element : elements) { + if (i < maxStackTraceEntries) { + stackMessage.append(" ClassName- "); + stackMessage.append(element.getClassName()); + stackMessage.append(" :LineNumber- "); + stackMessage.append(element.getLineNumber()); + stackMessage.append(" :MethodName- "); + stackMessage.append(element.getMethodName()); + } + i++; + } + } else if (e.getCause() != null) { + stackMessage.append("cause=" + e.getCause()); + StackTraceElement[] elements = e.getCause().getStackTrace(); + int i = 0; + for (StackTraceElement element : elements) { + if (i < maxStackTraceEntries) { + stackMessage.append(" ClassName- "); + stackMessage.append(element.getClassName()); + stackMessage.append(" :LineNumber- "); + stackMessage.append(element.getLineNumber()); + stackMessage.append(" :MethodName- "); + stackMessage.append(element.getMethodName()); + } + i++; + } + } else if (e.getStackTrace() != null) { + stackMessage.append("ex=" + e.toString()); + StackTraceElement[] elements = e.getStackTrace(); + int i = 0; + for (StackTraceElement element : elements) { + if (i < maxStackTraceEntries) { + stackMessage.append(" ClassName- "); + stackMessage.append(element.getClassName()); + stackMessage.append(" :LineNumber- "); + stackMessage.append(element.getLineNumber()); + stackMessage.append(" :MethodName- "); + stackMessage.append(element.getMethodName()); + } + i++; + } + } + } + return stackMessage.toString(); + } + } diff --git a/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java b/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java index 7d9dcce5..cb31bdde 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java +++ b/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java @@ -58,6 +58,12 @@ public class LoggingContext { public static final String BUSINESS_PROCESS_ERROR = "500"; public static final String UNKNOWN_ERROR = "900"; + public static final Map responseMap = new HashMap(); + + static { + responseMap.put(SUCCESS, "Success"); + responseMap.put(UNKNOWN_ERROR, "Unknown error"); + } //ECOMP Specific Log Event Fields public static enum LoggingField { START_TIME("startTime"), @@ -126,9 +132,6 @@ public class LoggingContext { public static void requestId(String requestId) { try { - if(requestId == null){ - throw new IllegalArgumentException(); - } if (requestId.contains(":")) { String[] uuidParts = requestId.split(":"); requestId = uuidParts[0]; @@ -138,12 +141,13 @@ public class LoggingContext { final UUID generatedRequestUuid = UUID.randomUUID(); MDC.put(LoggingField.REQUEST_ID.toString(), generatedRequestUuid.toString()); LoggingContext.save(); - AAIException ex = new AAIException("AAI_7405", e); - String responseCode = Integer.toString(ex.getErrorObject().getHTTPResponseCode().getStatusCode()); + // set response code to 0 since we don't know what the outcome of this request is yet + String responseCode = LoggingContext.DATA_ERROR; LoggingContext.responseCode(responseCode); - - LOGGER.warn("Unable to use UUID " + requestId + " (Not formatted properly). Using generated UUID=" - + generatedRequestUuid); + LoggingContext.responseDescription("Unable to use UUID " + requestId + " (Not formatted properly) "); + LoggingContext.statusCode(StatusCode.ERROR); + + LOGGER.warn("Using generated UUID=" + generatedRequestUuid); LoggingContext.restore(); } @@ -196,6 +200,7 @@ public class LoggingContext { public static void successStatusFields() { responseCode(SUCCESS); statusCode(LoggingContext.StatusCode.COMPLETE); + responseDescription("Success"); } private static void serverIpAddress() { try { diff --git a/aai-core/src/main/java/org/onap/aai/logging/StopWatch.java b/aai-core/src/main/java/org/onap/aai/logging/StopWatch.java index b57387d5..4b05f1a6 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/StopWatch.java +++ b/aai-core/src/main/java/org/onap/aai/logging/StopWatch.java @@ -34,7 +34,18 @@ public final class StopWatch { public static double stop() { return LoggingContext.stopWatchStop(); } - + public static void conditionalStart() { + if ( LoggingContext.isStopWatchStarted() ) { + return; + } + start(); + } + public static double stopIfStarted() { + if ( LoggingContext.isStopWatchStarted() ) { + return (stop()); + } + return (0); + } public static void clear() { LoggingContext.remove(LoggingField.STOP_WATCH_START.toString()); LoggingContext.remove(LoggingField.ELAPSED_TIME.toString()); diff --git a/aai-core/src/main/java/org/onap/aai/parsers/query/LegacyQueryParser.java b/aai-core/src/main/java/org/onap/aai/parsers/query/LegacyQueryParser.java index 9251be6b..10530d19 100644 --- a/aai-core/src/main/java/org/onap/aai/parsers/query/LegacyQueryParser.java +++ b/aai-core/src/main/java/org/onap/aai/parsers/query/LegacyQueryParser.java @@ -27,6 +27,7 @@ import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.parsers.uri.Parsable; import org.onap.aai.parsers.uri.URIParser; import org.onap.aai.parsers.uri.URIToObject; @@ -134,7 +135,8 @@ public class LegacyQueryParser extends QueryParser implements Parsable { Introspector child = obj.newIntrospectorInstanceOfNestedProperty(obj.getChildName()); this.handleUriKeys(child, uriKeys); } catch (AAIUnknownObjectException e) { - LOGGER.warn("Skipping container child " + obj.getChildName() + " (Unknown Object)", e); + LOGGER.warn("Skipping container child " + obj.getChildName() + " (Unknown Object) " + + LogFormatTools.getStackTop(e)); } } diff --git a/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToExtensionInformation.java b/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToExtensionInformation.java index 0b34a45f..868a7427 100644 --- a/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToExtensionInformation.java +++ b/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToExtensionInformation.java @@ -118,8 +118,15 @@ public class URIToExtensionInformation implements Parsable { */ public String getMethodName(HttpMethod httpMethod, boolean isPreprocess) { String result = "Dynamic"; - if (httpMethod.equals(HttpMethod.PUT)) { + /* + if (httpMethod.equals(HttpMethod.PUT) || httpMethod.equals(HttpMethod.PUT_EDGE)) { result += "Add"; + } + */ + if (httpMethod.equals(HttpMethod.PUT) ) { + result += "Add"; + } else if (httpMethod.equals(HttpMethod.PUT_EDGE)) { + result += "AddEdge"; } else if (httpMethod.equals(HttpMethod.DELETE)) { result += "Del"; } else { diff --git a/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToRelationshipObject.java b/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToRelationshipObject.java index cec55bc3..48a6324e 100644 --- a/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToRelationshipObject.java +++ b/aai-core/src/main/java/org/onap/aai/parsers/uri/URIToRelationshipObject.java @@ -134,7 +134,6 @@ public class URIToRelationshipObject implements Parsable { URI originalUri = parser.getOriginalURI(); URI relatedLink = new URI(this.baseURL + this.originalVersion + "/" + originalUri); - this.relationship.setValue("related-link", relatedLink); if (this.originalVersion.compareTo(Version.v10) >= 0) { //only return the path section of the URI past v10 relatedLink = new URI(relatedLink.getRawPath()); diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java index 82079ad7..8156dd09 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java @@ -141,6 +141,37 @@ public abstract class GraphTraversalBuilder extends QueryBuilder { stepIndex++; return (QueryBuilder) this; } + + /** + * @{inheritDoc} + */ + @Override + public QueryBuilder getVerticesExcludeByProperty(String key, Object value) { + + // correct value call because the index is registered as an Integer + traversal.has(key, P.neq(this.correctObjectType(value))); + + stepIndex++; + return (QueryBuilder) this; + } + + /** + * @{inheritDoc} + */ + @Override + public QueryBuilder getVerticesExcludeByProperty(final String key, final List values) { + + //this is because the index is registered as an Integer + List correctedValues = new ArrayList<>(); + for (Object item : values) { + correctedValues.add(this.correctObjectType(item)); + } + + traversal.has(key, P.without(correctedValues)); + + stepIndex++; + return (QueryBuilder) this; + } /** * @{inheritDoc} @@ -414,6 +445,30 @@ public abstract class GraphTraversalBuilder extends QueryBuilder { return this; } + @Override + public QueryBuilder groupCount() { + this.traversal.groupCount(); + stepIndex++; + + return this; + } + + @Override + public QueryBuilder both() { + this.traversal.both(); + stepIndex++; + + return this; + } + + @Override + public QueryBuilder by(String name) { + this.traversal.by(name); + stepIndex++; + + return this; + } + /** * {@inheritDoc} */ diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java index f2eaa91f..d87dac48 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java @@ -153,6 +153,47 @@ public abstract class GremlinQueryBuilder extends QueryBuilder { return (QueryBuilder) this; } + /** + * @{inheritDoc} + */ + @Override + public QueryBuilder getVerticesExcludeByProperty(String key, Object value) { + + String term = ""; + String predicate = "P.neq(#!#argument#!#)"; + if (value != null && !(value instanceof String) ) { + term = value.toString(); + } else { + term = "'" + value + "'"; + } + predicate = predicate.replace("#!#argument#!#", term); + list.add(".has('" + key + "', " + predicate + ")"); + stepIndex++; + return (QueryBuilder) this; + } + + /** + * @{inheritDoc} + */ + @Override + public QueryBuilder getVerticesExcludeByProperty(String key, List values) { + + String term = ""; + String predicate = "P.without(#!#argument#!#)"; + List arguments = new ArrayList<>(); + for (Object item : values) { + if (item != null && !(item instanceof String)) { + arguments.add(item.toString()); + } else { + arguments.add("'" + item + "'"); + } + } + String argument = Joiner.on(",").join(arguments); + predicate = predicate.replace("#!#argument#!#", argument); + list.add(".has('" + key + "', " + predicate + ")"); + stepIndex++; + return (QueryBuilder) this; + } /** * @{inheritDoc} @@ -274,7 +315,9 @@ public abstract class GremlinQueryBuilder extends QueryBuilder { } }); - if (inLabels.isEmpty() && !outLabels.isEmpty()) { + if(inLabels.isEmpty() && outLabels.isEmpty()) { + throw new NoEdgeRuleFoundException("no " + type.toString() + " edge rule between " + outType + " and " + inType ); + } else if (inLabels.isEmpty() && !outLabels.isEmpty()) { list.add(".out('" + String.join("','", outLabels) + "')"); } else if (outLabels.isEmpty() && !inLabels.isEmpty()) { list.add(".in('" + String.join("','", inLabels) + "')"); @@ -319,7 +362,9 @@ public abstract class GremlinQueryBuilder extends QueryBuilder { } }); - if (inLabels.isEmpty() && !outLabels.isEmpty()) { + if(inLabels.isEmpty() && outLabels.isEmpty()) { + throw new NoEdgeRuleFoundException("no " + type.toString() + " edge rule between " + outType + " and " + inType ); + } else if (inLabels.isEmpty() && !outLabels.isEmpty()) { list.add(".outE('" + String.join("','", outLabels) + "')"); } else if (outLabels.isEmpty() && !inLabels.isEmpty()) { list.add(".inE('" + String.join("','", inLabels) + "')"); @@ -449,6 +494,30 @@ public abstract class GremlinQueryBuilder extends QueryBuilder { return this; } + @Override + public QueryBuilder groupCount() { + this.list.add(".groupCount()"); + stepIndex++; + + return this; + } + + @Override + public QueryBuilder both() { + this.list.add(".both()"); + stepIndex++; + + return this; + } + + @Override + public QueryBuilder by(String name) { + this.list.add(".by('"+ name + "')"); + stepIndex++; + + return this; + } + /** * {@inheritDoc} */ diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java index f5d47871..a51f592a 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java @@ -111,6 +111,33 @@ public abstract class QueryBuilder implements Iterator { */ public abstract QueryBuilder getVerticesByProperty(String key, List values); + /** + * Gets the vertices that are excluded by property. + * + * @param key the key + * @param value the value + * @return the vertices by property + */ + public abstract QueryBuilder getVerticesExcludeByProperty(String key, Object value); + + /** + * filters by all the values for this property and excludes the vertices + * @param key + * @param values + * @return vertices that match these values + */ + public QueryBuilder getVerticesExcludeByIndexedProperty(String key, List values) { + return this.getVerticesExcludeByProperty(key, values); + } + + /** + * filters by all the values for this property and excludes the vertices + * @param key + * @param values + * @return vertices that match these values + */ + public abstract QueryBuilder getVerticesExcludeByProperty(String key, List values); + /** * Gets the child vertices from parent. * @@ -369,6 +396,9 @@ public abstract class QueryBuilder implements Iterator { public abstract QueryBuilder as(String name); public abstract QueryBuilder select(String name); public abstract QueryBuilder until(QueryBuilder builder); + public abstract QueryBuilder groupCount(); + public abstract QueryBuilder by(String name); + public abstract QueryBuilder both(); /** * Used to prevent the traversal from repeating its path through the graph. diff --git a/aai-core/src/main/java/org/onap/aai/rest/RestHandlerService.java b/aai-core/src/main/java/org/onap/aai/rest/RestHandlerService.java new file mode 100644 index 00000000..9c037b30 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/rest/RestHandlerService.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.rest; + +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadPoolExecutor; + +public class RestHandlerService { + private static RestHandlerService single_instance = null; + public ThreadPoolExecutor executor; + // private constructor restricted to this class itself + private RestHandlerService() + { + executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(50); + } + /** + * Gets the single instance of RestHandlerService. + * + * @return single instance of RestHandlerService + */ + public static RestHandlerService getInstance() { + if (single_instance == null) { + single_instance = new RestHandlerService(); + } + return single_instance; + } +} diff --git a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java index 0d89a74c..d6bf3625 100644 --- a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java +++ b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java @@ -30,7 +30,10 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -48,6 +51,8 @@ import org.onap.aai.dbmap.DBConnectionType; import org.onap.aai.domain.responseMessage.AAIResponseMessage; import org.onap.aai.domain.responseMessage.AAIResponseMessageDatum; import org.onap.aai.exceptions.AAIException; +import org.onap.aai.extensions.AAIExtensionMap; +import org.onap.aai.extensions.ExtensionController; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; @@ -57,6 +62,7 @@ import org.onap.aai.introspection.ModelType; import org.onap.aai.introspection.Version; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LoggingContext; import org.onap.aai.parsers.query.QueryParser; import org.onap.aai.parsers.uri.URIToExtensionInformation; import org.onap.aai.rest.ueb.UEBNotification; @@ -82,6 +88,7 @@ import com.thinkaurelius.titan.core.TitanException; public class HttpEntry { private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(HttpEntry.class); + private static final String TARGET_ENTITY = "DB"; private final ModelType introspectorFactoryType; @@ -175,6 +182,7 @@ public class HttpEntry { */ public Pair>> process (List requests, String sourceOfTruth, boolean enableResourceVersion) throws AAIException { DBSerializer serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, sourceOfTruth); + String methodName = "process"; Response response = null; Status status = Status.NOT_FOUND; Introspector obj = null; @@ -191,16 +199,25 @@ public class HttpEntry { QueryEngine queryEngine = dbEngine.getQueryEngine(); int maxRetries = 10; int retry = 0; + + LoggingContext.save(); for (DBRequest request : requests) { try { for (retry = 0; retry < maxRetries; ++retry) { try { method = request.getMethod(); + + LoggingContext.targetEntity(TARGET_ENTITY); + LoggingContext.targetServiceName(methodName + " " + method); + obj = request.getIntrospector(); query = request.getParser(); transactionId = request.getTransactionId(); uriTemp = request.getUri().getRawPath().replaceFirst("^v\\d+/", ""); uri = UriBuilder.fromPath(uriTemp).build(); + + LoggingContext.startTime(); + List vertices = query.getQueryBuilder().toList(); boolean isNewVertex = false; String outputMediaType = getMediaType(request.getHeaders().getAcceptableMediaTypes()); @@ -219,8 +236,10 @@ public class HttpEntry { } if (vertices.size() > 1 && processSingle && !method.equals(HttpMethod.GET)) { if (method.equals(HttpMethod.DELETE)) { + LoggingContext.restoreIfPossible(); throw new AAIException("AAI_6138"); } else { + LoggingContext.restoreIfPossible(); throw new AAIException("AAI_6137"); } } @@ -254,8 +273,12 @@ public class HttpEntry { case GET: String nodeOnly = params.getFirst("nodes-only"); boolean isNodeOnly = nodeOnly != null; - obj = this.getObjectFromDb(vertices, serializer, query, obj, request.getUri(), depth, isNodeOnly, cleanUp); + + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs(),TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); + if (obj != null) { status = Status.OK; MarshallerProperties properties; @@ -282,11 +305,20 @@ public class HttpEntry { if (query.isDependent()) { relatedObjects = this.getRelatedObjects(serializer, queryEngine, v); } + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() + + (long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, obj, relatedObjects); + break; case PUT_EDGE: serializer.touchStandardVertexProperties(v, false); serializer.createEdge(obj, v); + + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs(),TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); status = Status.OK; break; case MERGE_PATCH: @@ -319,8 +351,15 @@ public class HttpEntry { if (query.isDependent()) { relatedObjects = this.getRelatedObjects(serializer, queryEngine, v); } + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() + + (long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, patchedObj, relatedObjects); } catch (IOException | JsonPatchException e) { + + LOGGER.info ("Caught exception: " + e.getMessage()); + LoggingContext.restoreIfPossible(); throw new AAIException("AAI_3000", "could not perform patch operation"); } break; @@ -330,13 +369,58 @@ public class HttpEntry { if (query.isDependent()) { relatedObjects = this.getRelatedObjects(serializer, queryEngine, v); } + /* + * Find all Delete-other-vertex vertices and create structure for notify + * findDeleatble also returns the startVertex v and we dont want to create + * duplicate notification events for the same + * So remove the startvertex first + */ + + List deletableVertices = dbEngine.getQueryEngine().findDeletable(v); + Long vId = (Long) v.id(); + + /* + * I am assuming vertexId cant be null + */ + deletableVertices.removeIf(s -> vId.equals(s.id())); + boolean isDelVerticesPresent = !deletableVertices.isEmpty(); + Map deleteObjects = new HashMap<>(); + Map uriMap = new HashMap<>(); + Map> deleteRelatedObjects = new HashMap<>(); + + if(isDelVerticesPresent){ + deleteObjects = this.buildIntrospectorObjects(serializer, deletableVertices); + + uriMap = this.buildURIMap(serializer, deleteObjects); + deleteRelatedObjects = this.buildRelatedObjects(serializer, queryEngine, deleteObjects); + } + serializer.delete(v, resourceVersion, enableResourceVersion); + + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs() + + (long)queryEngine.getDBTimeMsecs(), TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); status = Status.NO_CONTENT; notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, obj, relatedObjects); + + /* + * Notify delete-other-v candidates + */ + + if(isDelVerticesPresent){ + this.buildNotificationEvent(sourceOfTruth, status, transactionId, notification, deleteObjects, + uriMap, deleteRelatedObjects); + } + break; case DELETE_EDGE: serializer.touchStandardVertexProperties(v, false); serializer.deleteEdge(obj, v); + + LoggingContext.elapsedTime((long)serializer.getDBTimeMsecs(),TimeUnit.MILLISECONDS); + LOGGER.info ("Completed"); + LoggingContext.restoreIfPossible(); status = Status.NO_CONTENT; break; default: @@ -370,25 +454,27 @@ public class HttpEntry { break; } catch (TitanException e) { this.dbEngine.rollback(); + + LOGGER.info ("Caught exception: " + e.getMessage()); + LoggingContext.restoreIfPossible(); AAIException ex = new AAIException("AAI_6142", e); ErrorLogHelper.logException(ex); - Thread.sleep((retry + 1) * 20); + Thread.sleep((retry + 1) * 20L); this.dbEngine.startTransaction(); queryEngine = dbEngine.getQueryEngine(); serializer = new DBSerializer(version, dbEngine, introspectorFactoryType, sourceOfTruth); } - if (retry == maxRetries) { throw new AAIException("AAI_6134"); } } } catch (AAIException e) { success = false; - ArrayList templateVars = new ArrayList(); + ArrayList templateVars = new ArrayList<>(); templateVars.add(request.getMethod().toString()); //GET, PUT, etc - templateVars.add(request.getUri().getPath().toString()); + templateVars.add(request.getUri().getPath()); templateVars.addAll(e.getTemplateVars()); - + ErrorLogHelper.logException(e); response = Response .status(e.getErrorObject().getHTTPResponseCode()) .entity(ErrorLogHelper.getRESTAPIErrorResponse(request.getHeaders().getAcceptableMediaTypes(), e, templateVars)) @@ -403,7 +489,7 @@ public class HttpEntry { ArrayList templateVars = new ArrayList(); templateVars.add(request.getMethod().toString()); //GET, PUT, etc templateVars.add(request.getUri().getPath().toString()); - + ErrorLogHelper.logException(ex); response = Response .status(ex.getErrorObject().getHTTPResponseCode()) .entity(ErrorLogHelper.getRESTAPIErrorResponse(request.getHeaders().getAcceptableMediaTypes(), ex, templateVars)) @@ -415,10 +501,10 @@ public class HttpEntry { } notification.triggerEvents(); - Pair>> tuple = Pair.with(success, responses); - return tuple; + return Pair.with(success, responses); } + /** * Gets the media type. * @@ -562,5 +648,88 @@ public class HttpEntry { return relatedVertices; } + + private Map buildIntrospectorObjects(DBSerializer serializer, Iterable vertices) { + Map deleteObjectMap = new HashMap<>(); + for (Vertex vertex : vertices) { + try { + // deleteObjectMap.computeIfAbsent(vertex, s -> + // serializer.getLatestVersionView(vertex)); + Introspector deleteObj = serializer.getLatestVersionView(vertex); + deleteObjectMap.put(vertex, deleteObj); + } catch (UnsupportedEncodingException | AAIException e) { + LOGGER.warn("Unable to get Introspctor Objects, Just continue"); + continue; + } + + } + + return deleteObjectMap; + + } + + private Map buildURIMap(DBSerializer serializer, Map introSpector) { + Map uriMap = new HashMap<>(); + for (Map.Entry entry : introSpector.entrySet()) { + URI uri; + try { + uri = serializer.getURIForVertex(entry.getKey()); + if (null != entry.getValue()) + uriMap.put(entry.getValue().getObjectId(), uri); + } catch (UnsupportedEncodingException e) { + LOGGER.warn("Unable to get URIs, Just continue"); + continue; + } + + } + + return uriMap; + + } + + private Map> buildRelatedObjects(DBSerializer serializer, + QueryEngine queryEngine, Map introSpector) { + + Map> relatedObjectsMap = new HashMap<>(); + for (Map.Entry entry : introSpector.entrySet()) { + try { + HashMap relatedObjects = this.getRelatedObjects(serializer, queryEngine, + entry.getKey()); + if (null != entry.getValue()) + relatedObjectsMap.put(entry.getValue().getObjectId(), relatedObjects); + } catch (IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException | InstantiationException | NoSuchMethodException + | UnsupportedEncodingException | AAIException | URISyntaxException e) { + LOGGER.warn("Unable to get realted Objects, Just continue"); + continue; + } + + } + + return relatedObjectsMap; + + } + + private void buildNotificationEvent(String sourceOfTruth, Status status, String transactionId, + UEBNotification notification, Map deleteObjects, Map uriMap, + Map> deleteRelatedObjects) { + for (Map.Entry entry : deleteObjects.entrySet()) { + try { + String vertexObjectId = ""; + + if (null != entry.getValue()) { + vertexObjectId = entry.getValue().getObjectId(); + + if (uriMap.containsKey(vertexObjectId) && deleteRelatedObjects.containsKey(vertexObjectId)) + notification.createNotificationEvent(transactionId, sourceOfTruth, status, + uriMap.get(vertexObjectId), entry.getValue(), deleteRelatedObjects.get(vertexObjectId)); + } + } catch (UnsupportedEncodingException | AAIException e) { + + LOGGER.warn("Error in sending otification"); + } + } + } + } diff --git a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java index f26ac197..9f13096b 100644 --- a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java +++ b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java @@ -25,6 +25,14 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.HashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeoutException; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -77,7 +85,6 @@ public class RESTAPI { * Gets the from app id. * * @param headers the headers - * @param logline the logline * @return the from app id * @throws AAIException the AAI exception */ @@ -105,7 +112,6 @@ public class RESTAPI { * Gets the trans id. * * @param headers the headers - * @param logline the logline * @return the trans id * @throws AAIException the AAI exception */ @@ -194,6 +200,7 @@ public class RESTAPI { templateVars.add(info.getPath().toString()); templateVars.addAll(e.getTemplateVars()); + ErrorLogHelper.logException(e); return Response .status(e.getErrorObject().getHTTPResponseCode()) .entity(ErrorLogHelper.getRESTAPIErrorResponseWithLogging(headers.getAcceptableMediaTypes(), e, templateVars)) @@ -206,7 +213,6 @@ public class RESTAPI { * @param obj the obj * @param loader the loader * @param uri the uri - * @param validateRequired the validate required * @throws AAIException the AAI exception * @throws UnsupportedEncodingException the unsupported encoding exception */ @@ -255,12 +261,15 @@ public class RESTAPI { throw new AAIException("AAI_4009", "X-FromAppId is not set"); } + DBConnectionType type = DBConnectionType.REALTIME; boolean isRealTimeClient = AAIConfig.get("aai.realtime.clients", "").contains(fromAppId); if (isRealTimeClient || realTime != null) { - return DBConnectionType.REALTIME; + type = DBConnectionType.REALTIME; } else { - return DBConnectionType.CACHED; + type = DBConnectionType.CACHED; } + + return type; } /** @@ -276,4 +285,116 @@ public class RESTAPI { } + /** + * Returns the app specific timeout in milliseconds, -1 overrides the timeout for an app + * + * @param sot + * @param appTimeouts + * @param defaultTimeout + * @return integer timeout in or -1 to bypass + * @throws AAIException + */ + + public int getTimeoutLimit(String sot, String appTimeouts, String defaultTimeout) throws AAIException{ + String[] ignoreAppIds = (appTimeouts).split("\\|"); + int appLimit = Integer.parseInt(defaultTimeout); + final Map m = new HashMap(); + if(ignoreAppIds != null) { + for (int i = 0; i < ignoreAppIds.length; i++) { + String[] vals = ignoreAppIds[i].split(","); + m.put(vals[0], Integer.parseInt(vals[1])); + } + if (m.get(sot) != null) { + appLimit = m.get(sot); + } + } + return appLimit; + } + + /** + * Returns whether time out is enabled + * @param sot + * @param isEnabled + * @param appTimeouts + * @param defaultTimeout + * @return boolean of whether the timeout is enabled + * @throws AAIException + */ + public boolean isTimeoutEnabled(String sot, String isEnabled, String appTimeouts, String defaultTimeout) throws AAIException{ + Boolean isTimeoutEnabled = Boolean.parseBoolean(isEnabled); + int ata = -1; + if(isTimeoutEnabled) { + ata = getTimeoutLimit(sot, appTimeouts, defaultTimeout); + } + return isTimeoutEnabled && (ata > -1); + } + + /** + * Executes the process thread and watches the future for the timeout + * @param handler + * @param sourceOfTruth + * @param appTimeoutLimit + * @param defaultTimeoutLimit + * @param method + * @param headers + * @param info + * @return the response + */ + + public Response executeProcess(Future handler, String sourceOfTruth, String appTimeoutLimit, String defaultTimeoutLimit, HttpMethod method, HttpHeaders headers, UriInfo info){ + Response response = null; + int timeoutLimit = 0; + try { + timeoutLimit = getTimeoutLimit(sourceOfTruth, appTimeoutLimit, defaultTimeoutLimit); + response = handler.get(timeoutLimit, TimeUnit.MILLISECONDS); + } catch (TimeoutException e) { + AAIException ex = new AAIException("AAI_7406", String.format("Timeout limit of %s seconds reached.", timeoutLimit/1000)); + response = consumerExceptionResponseGenerator(headers, info, method, ex); + handler.cancel(true); + } catch (Exception e) { + AAIException ex = new AAIException("AAI_4000", e); + response = consumerExceptionResponseGenerator(headers, info, method, ex); + } + return response; + } + + /** + * runner sets up the timer logic and invokes it + * @param toe + * @param tba + * @param tdl + * @param headers + * @param info + * @param httpMethod + * @param c + * @return the response + */ + public Response runner(String toe, String tba, String tdl, HttpHeaders headers, UriInfo info, HttpMethod httpMethod, Callable c){ + Response response = null; + Future handler = null; + ExecutorService executor = null; + try { + String timeoutEnabled = AAIConfig.get(toe); + String timeoutByApp = AAIConfig.get(tba); + String timeoutDefaultLimit = AAIConfig.get(tdl); + String sourceOfTruth = headers.getRequestHeaders().getFirst("X-FromAppId"); + if (isTimeoutEnabled(sourceOfTruth, timeoutEnabled, timeoutByApp, timeoutDefaultLimit)) { + executor = Executors.newSingleThreadExecutor(); + handler = executor.submit(c); + response = executeProcess(handler, sourceOfTruth, timeoutByApp, timeoutDefaultLimit, httpMethod, headers, info); + } else { + response = (Response) c.call(); + } + }catch(Exception e){ + AAIException ex = new AAIException("AAI_4000", e); + response = consumerExceptionResponseGenerator(headers, info, httpMethod, ex); + }finally{ + if(executor != null && handler != null){ + executor.shutdownNow(); + } + } + return response; + } + } + diff --git a/aai-core/src/main/java/org/onap/aai/restcore/util/EdgeRuleBean.java b/aai-core/src/main/java/org/onap/aai/restcore/util/EdgeRuleBean.java new file mode 100644 index 00000000..cd175e38 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/restcore/util/EdgeRuleBean.java @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 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========================================================= + */ + +package org.onap.aai.restcore.util; + +public class EdgeRuleBean { + private String from; + private String to; + private String label; + private String direction; + private String multiplicity; + private String lineage; + private String preventDelete; + private String deleteOtherV; + private String svcInfra; + private String defaultVal; + + public String getFrom() { + return from; + } + public void setFrom(String from) { + this.from = from; + } + public String getTo() { + return to; + } + public void setTo(String to) { + this.to = to; + } + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + public String getDirection() { + return direction; + } + public void setDirection(String direction) { + this.direction = direction; + } + public String getMultiplicity() { + return multiplicity; + } + public void setMultiplicity(String multiplicity) { + this.multiplicity = multiplicity; + } + public String getDeleteOtherV() { + return deleteOtherV; + } + public void setDeleteOtherV(String deleteOtherV) { + this.deleteOtherV = deleteOtherV; + } + public String getPreventDelete() { + return preventDelete; + } + public void setPreventDelete(String preventDelete) { + this.preventDelete = preventDelete; + } + public String getSvcInfra() { + return svcInfra; + } + public void setSvcInfra(String svcInfra) { + this.svcInfra = svcInfra; + } + public String getLineage() { + return lineage; + } + public void setLineage(String lineage) { + this.lineage = lineage; + } + public String getDefault() { + return defaultVal; + } + public void setDefault(String defaultVal) { + this.defaultVal = defaultVal; + } +} diff --git a/aai-core/src/main/java/org/onap/aai/restcore/util/GenerateEdgeRules.java b/aai-core/src/main/java/org/onap/aai/restcore/util/GenerateEdgeRules.java index 1b854667..e1660ab3 100644 --- a/aai-core/src/main/java/org/onap/aai/restcore/util/GenerateEdgeRules.java +++ b/aai-core/src/main/java/org/onap/aai/restcore/util/GenerateEdgeRules.java @@ -21,8 +21,6 @@ */ package org.onap.aai.restcore.util; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; @@ -30,108 +28,162 @@ import freemarker.template.TemplateException; import java.io.*; import java.util.*; -public class GenerateEdgeRules { +import org.onap.aai.serialization.db.EdgeRules; +import org.onap.aai.introspection.Version; - private static final EELFLogger LOG = EELFManager.getInstance().getLogger(GenerateEdgeRules.class); +public class GenerateEdgeRules { public static void main(String[] args) throws IOException, TemplateException { - String filename = "/AAI8032.csv"; + String filename = "/edgeLabelMigration.csv"; InputStream inputStream = GenerateEdgeRules.class.getResourceAsStream(filename); Map headers = new HashMap<>(); - Map edgeRulesMap = new TreeMap(); - List> edgeRules = new ArrayList<>(); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + List rulesToWriteV12 = new ArrayList<>(); + List rulesToWriteV7 = new ArrayList<>(); + List rulesToWriteV8 = new ArrayList<>(); + List rulesToWriteV9 = new ArrayList<>(); + List rulesToWriteV10 = new ArrayList<>(); + List rulesToWriteV11 = new ArrayList<>(); - String line = null; + ArrayList rulesWeAlreadyHave = new ArrayList (); - int rowNum = 0; + EdgeRules rulesV8 = EdgeRules.getInstance(Version.v8); + EdgeRules rulesV9 = EdgeRules.getInstance(Version.v9); + EdgeRules rulesV10 = EdgeRules.getInstance(Version.v10); + EdgeRules rulesV11 = EdgeRules.getInstance(Version.v11); - // Retrieve the header line to map the indexes to their column names + try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + String line = null; + int rowNum = 0; while ((line = reader.readLine()) != null) { - - if (rowNum == 0) { + if (rowNum == 0) { headers = retrieveHeaderMap(line); - } else { - String[] columns = line.split(","); - - String originalNode = columns[headers.get("Orig NodeA|NodeB")]; - String finalNode = columns[headers.get("Final NodeA|NodeB")]; - String originalEdge = columns[headers.get("Orig EdgeLabel")]; - String finalEdge = columns[headers.get("Final EdgeLabel")]; - - String lineage = columns[headers.get("Final Lineage")]; - String originalParent = columns[headers.get("Orig ParentOf")]; - String usesResource = columns[headers.get("Revised UsesResource")]; - String hasDelTarget = columns[headers.get("Revised hasDelTarget")]; - String svcInfra = columns[headers.get("Final SVC-INFRA")]; - String svcInfraRev = ""; - - if(usesResource.equals("T")) - usesResource = "true"; - else if(usesResource.equals("F")) - usesResource = "false"; - - if (hasDelTarget.equals("T") || hasDelTarget.equals("AB")) { - hasDelTarget = "true"; - } else if (hasDelTarget.equals("F")) { - hasDelTarget = "false"; + } + else { + EdgeRuleBean data = new EdgeRuleBean(); + String[] columns = line.split(","); + String oldNodeA = columns[headers.get("from")]; + String oldNodeB = columns[headers.get("to")]; + String oldEdgeLabel = columns[headers.get("label")]; + + String nodeA = columns[headers.get("new from")]; + data.setFrom(nodeA); + String nodeB = columns[headers.get("new to")]; + data.setTo(nodeB); + + String edgeLabel = columns[headers.get("new label")]; + data.setLabel( edgeLabel ); + + + // Note: it is assumed that if we know the two NodeTypes and the edgeLabel, we can + // uniquely identify an edgeRule -- so if that key is found twice, it is a + // problem with our CSV file. Note -we check with the nodeTypes in both directions. + String key1 = nodeA + "|" + nodeB + "|" + edgeLabel; + String key2 = nodeB + "|" + nodeA + "|" + edgeLabel; + if( rulesWeAlreadyHave.contains(key1) ){ + throw new Exception ("Duplicate rule found for [" + key1 + "] -- please fix the CSV file. "); } - - if (svcInfra.equals("T")) { - svcInfra = "true"; - } else if (svcInfra.equals("F")) { - svcInfra = "false"; - } else if (svcInfra.equals("R")) { - svcInfra = "reverse"; + else if( rulesWeAlreadyHave.contains(key2) ){ + throw new Exception ("Duplicate rule found for [" + key2 + "] -- please fix the CSV file. "); } + else { + rulesWeAlreadyHave.add(key1); + rulesWeAlreadyHave.add(key2); + } + + String direction = columns[headers.get("new direction")]; + data.setDirection(direction); + + String multiplicity = columns[headers.get("new multiplicity")]; + data.setMultiplicity(multiplicity); - if (originalParent.equals("T")) { - if (lineage.trim().equalsIgnoreCase("CHILD")) { - lineage = "true"; - } else if (lineage.trim().equalsIgnoreCase("PARENT")) { - lineage = "reverse"; - } - } else { - lineage = "false"; + String lineage = columns[headers.get("new contains-other-v")]; + data.setLineage(lineage); + + String deleteOtherV = columns[headers.get("new delete-other-v")]; + data.setDeleteOtherV(deleteOtherV); + + String svcInfra = columns[headers.get("new SVC-INFRA")]; + data.setSvcInfra(svcInfra); + + String prevDel = columns[headers.get("new prevent-delete")]; + data.setPreventDelete(prevDel); + + String defaultVal = columns[headers.get("new default")]; + if( defaultVal.equals("T") ){ + data.setDefault("true"); } + else if( defaultVal.equals("F") ){ + data.setDefault("false"); + } + + rulesToWriteV12.add(data); - Map edgeMap = new HashMap(); + if( rulesV8.hasEdgeRule(oldNodeA, oldNodeB, oldEdgeLabel) ){ + rulesToWriteV8.add(data); + } - edgeMap.put("lineage", lineage); - edgeMap.put("usesResource", usesResource); - edgeMap.put("hasDelTarget", hasDelTarget); - edgeMap.put("SVC-INFRA", svcInfra); - edgeMap.put("SVC-INFRA-REV", svcInfraRev); - edgeMap.put("nodes", finalNode); - edgeMap.put("edge", finalEdge); - edgeMap.put("direction", columns[headers.get("Orig Direction")]); - edgeMap.put("multiplicity", columns[headers.get("Revised Multiplicity")]); + if( rulesV9.hasEdgeRule(oldNodeA, oldNodeB, oldEdgeLabel) ){ + rulesToWriteV9.add(data); + } - edgeRules.add(edgeMap); + if( rulesV10.hasEdgeRule(oldNodeA, oldNodeB, oldEdgeLabel) ){ + rulesToWriteV10.add(data); + } + if( rulesV11.hasEdgeRule(oldNodeA, oldNodeB, oldEdgeLabel) ){ + rulesToWriteV11.add(data); + } } ++rowNum; } + + Configuration configuration = new Configuration(); + Template template = configuration.getTemplate("src/main/resources/edgerulesTemplate.ftlh"); + Writer file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v12.json")); + Map> wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV12); + template.process(wrappedRules, file); + file.close(); + + file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v7.json")); + wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV7); + template.process(wrappedRules, file); + file.close(); + + file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v8.json")); + wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV8); + template.process(wrappedRules, file); + file.close(); + + + file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v9.json")); + wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV9); + template.process(wrappedRules, file); + file.close(); + + file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v10.json")); + wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV10); + template.process(wrappedRules, file); + file.close(); + + file = new FileWriter(new File("src/main/resources/EdgeRulesWithNewLabels_v11.json")); + wrappedRules = new HashMap<>(); + wrappedRules.put("wrappedRules", rulesToWriteV11); + template.process(wrappedRules, file); + file.close(); + } catch(Exception ex){ ex.printStackTrace(); } - edgeRulesMap.put("edgeRules", edgeRules); - - Collections.sort(edgeRules, new Comparator>() { - @Override - public int compare(Map o1, Map o2) { - return o1.get("nodes").compareTo(o2.get("nodes")); - } - }); - Configuration configuration = new Configuration(); - Template template = configuration.getTemplate("ajsc-aai/src/main/resources/EdgeRules.ftl"); - Writer file = new FileWriter(new File("ajsc-aai/src/main/resources" + "/" + "EdgeRules.txt")); - template.process(edgeRulesMap, file); } private static Map retrieveHeaderMap(String line){ @@ -146,7 +198,7 @@ public class GenerateEdgeRules { int index = 0; for(String columnName : columnNames){ - map.put(columnName, index++); + map.put(columnName, index++); } return map; diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java index cd48fc6a..8e1bf968 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java @@ -1,73 +1,48 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * 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 - * + * + * 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.serialization.db; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Array; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; - -import javax.ws.rs.core.UriBuilder; - +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.common.base.CaseFormat; +import com.thinkaurelius.titan.core.SchemaViolationException; import org.apache.commons.collections.IteratorUtils; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Edge; -import org.apache.tinkerpop.gremlin.structure.Element; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.apache.tinkerpop.gremlin.structure.*; import org.javatuples.Pair; import org.javatuples.Triplet; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.exceptions.AAIException; -import org.onap.aai.introspection.Introspector; -import org.onap.aai.introspection.IntrospectorFactory; -import org.onap.aai.introspection.Loader; -import org.onap.aai.introspection.LoaderFactory; -import org.onap.aai.introspection.ModelType; -import org.onap.aai.introspection.PropertyPredicates; -import org.onap.aai.introspection.Version; +import org.onap.aai.introspection.*; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.introspection.sideeffect.DataCopy; import org.onap.aai.introspection.sideeffect.DataLinkReader; import org.onap.aai.introspection.sideeffect.DataLinkWriter; import org.onap.aai.introspection.sideeffect.SideEffectRunner; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.logging.LogFormatTools; import org.onap.aai.parsers.query.QueryParser; import org.onap.aai.parsers.uri.URIParser; import org.onap.aai.parsers.uri.URIToRelationshipObject; @@ -82,11 +57,22 @@ import org.onap.aai.util.AAIApiServerURLBase; import org.onap.aai.util.AAIConfig; import org.onap.aai.util.AAIConstants; import org.onap.aai.workarounds.NamingExceptions; +import org.onap.aai.logging.StopWatch; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.google.common.base.CaseFormat; -import com.thinkaurelius.titan.core.SchemaViolationException; +import javax.ws.rs.core.UriBuilder; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Array; +import java.lang.reflect.InvocationTargetException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class DBSerializer { @@ -100,6 +86,7 @@ public class DBSerializer { private final EdgeRules edgeRules = EdgeRules.getInstance(); private final Loader loader; private final String baseURL; + private double dbTimeMsecs = 0; /** * Instantiates a new DB serializer. * @@ -133,6 +120,7 @@ public class DBSerializer { if (isNewVertex) { v.property(AAIProperties.SOURCE_OF_TRUTH, this.sourceOfTruth); v.property(AAIProperties.CREATED_TS, timeNowInSec); + v.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()); } v.property(AAIProperties.RESOURCE_VERSION, timeNowInSec ); v.property(AAIProperties.LAST_MOD_TS, timeNowInSec); @@ -158,11 +146,15 @@ public class DBSerializer { * @throws AAIException the AAI exception */ public Vertex createNewVertex(Introspector wrappedObject) { - - - Vertex v = this.engine.tx().addVertex(); - touchStandardVertexProperties(wrappedObject.getDbName(), v, true); - + Vertex v; + try { + StopWatch.conditionalStart(); + v = this.engine.tx().addVertex(); + touchStandardVertexProperties(wrappedObject.getDbName(), v, true); + } + finally { + dbTimeMsecs += StopWatch.stopIfStarted(); + } return v; } @@ -205,7 +197,7 @@ public class DBSerializer { * @throws AAIUnknownObjectException */ public void serializeToDb(Introspector obj, Vertex v, QueryParser uriQuery, String identifier, String requestContext) throws AAIException, UnsupportedEncodingException { - + StopWatch.conditionalStart(); try { if (uriQuery.isDependent()) { //try to find the parent @@ -214,6 +206,7 @@ public class DBSerializer { Vertex parent = vertices.get(0); this.reflectDependentVertex(parent, v, obj, requestContext); } else { + dbTimeMsecs += StopWatch.stopIfStarted(); throw new AAIException("AAI_6114", "No parent Node of type " + uriQuery.getParentResultType() + " for " + identifier); } } else { @@ -221,17 +214,20 @@ public class DBSerializer { } } catch (SchemaViolationException e) { + dbTimeMsecs += StopWatch.stopIfStarted(); throw new AAIException("AAI_6117", e); } - + dbTimeMsecs += StopWatch.stopIfStarted(); } public void serializeSingleVertex(Vertex v, Introspector obj, String requestContext) throws UnsupportedEncodingException, AAIException { + StopWatch.conditionalStart(); try { boolean isTopLevel = obj.isTopLevel(); if (isTopLevel) { v.property(AAIProperties.AAI_URI, obj.getURI()); } + processObject(obj, v, requestContext); if (!isTopLevel) { URI uri = this.getURIForVertex(v); @@ -246,6 +242,9 @@ public class DBSerializer { } catch (SchemaViolationException e) { throw new AAIException("AAI_6117", e); } + finally { + dbTimeMsecs += StopWatch.stopIfStarted(); + } } /** @@ -555,7 +554,8 @@ public class DBSerializer { String parentUri = parent.property(AAIProperties.AAI_URI).orElse(null); if (parentUri != null) { - String uri = obj.getURI(); + String uri; + uri = obj.getURI(); child.property(AAIProperties.AAI_URI, parentUri + uri); } processObject(obj, child, requestContext); @@ -565,7 +565,8 @@ public class DBSerializer { if (e == null) { String canBeLinked = obj.getMetadata(ObjectMetadata.CAN_BE_LINKED); if (canBeLinked != null && canBeLinked.equals("true")) { - boolean isFirst = !this.engine.getQueryBuilder(parent).createEdgeTraversal(EdgeType.TREE, parent, obj).hasNext(); + Loader ldrForCntxt = LoaderFactory.createLoaderForVersion(introspectionType, getVerForContext(requestContext)); + boolean isFirst = !this.engine.getQueryBuilder(ldrForCntxt, parent).createEdgeTraversal(EdgeType.TREE, parent, obj).hasNext(); if (isFirst) { child.property(AAIProperties.LINKED, true); } @@ -575,6 +576,16 @@ public class DBSerializer { return child; } + + private Version getVerForContext(String requestContext) { + Pattern pattern = Pattern.compile("v[0-9]+"); + Matcher m = pattern.matcher(requestContext); + if (!m.find()) { + return this.version; + } else { + return Version.valueOf(requestContext); + } + } /** * Db to object. @@ -597,14 +608,15 @@ public class DBSerializer { * @throws URISyntaxException */ public Introspector dbToObject(List vertices, final Introspector obj, int depth, boolean nodeOnly, String cleanUp) throws UnsupportedEncodingException, AAIException { - final int internalDepth; if (depth == Integer.MAX_VALUE) { internalDepth = depth--; } else { internalDepth = depth; } + StopWatch.conditionalStart(); if (vertices.size() > 1 && !obj.isContainer()) { + dbTimeMsecs += StopWatch.stopIfStarted(); throw new AAIException("AAI_6136", "query object mismatch: this object cannot hold multiple items." + obj.getDbName()); } else if (obj.isContainer()) { final List getList; @@ -624,6 +636,8 @@ public class DBSerializer { ExecutorService pool = GetAllPool.getInstance().getPool(); List> futures = new ArrayList<>(); + + for (Vertex v : vertices) { Callable task = () -> { Set seen = new HashSet<>(); @@ -640,7 +654,11 @@ public class DBSerializer { for (Future future : futures) { try { getList.add(future.get()); - } catch (ExecutionException | InterruptedException e) { + } catch (ExecutionException e) { + dbTimeMsecs += StopWatch.stopIfStarted(); + throw new AAIException("AAI_4000", e); + } catch (InterruptedException e) { + dbTimeMsecs += StopWatch.stopIfStarted(); throw new AAIException("AAI_4000", e); } } @@ -653,7 +671,7 @@ public class DBSerializer { //obj = null; } - + dbTimeMsecs += StopWatch.stopIfStarted(); return obj; } @@ -747,7 +765,7 @@ public class DBSerializer { Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property); Object result = dbToObject(argumentObject, childVertex, seen, depth, nodeOnly, cleanUp); - if (result != null) { + if (result != null) { getList.add(argumentObject.getUnderlyingObject()); } @@ -795,13 +813,15 @@ public class DBSerializer { if (nodeType == null) { throw new AAIException("AAI_6143"); } + Introspector obj = this.latestLoader.introspectorFromName(nodeType); Set seen = new HashSet<>(); int depth = 0; String cleanUp = "false"; boolean nodeOnly = true; + StopWatch.conditionalStart(); this.dbToObject(obj, v, seen, depth, nodeOnly, cleanUp); - + dbTimeMsecs += StopWatch.stopIfStarted(); return obj; } @@ -815,10 +835,11 @@ public class DBSerializer { int depth = AAIProperties.MAXIMUM_DEPTH; String cleanUp = "false"; boolean nodeOnly = false; + StopWatch.conditionalStart(); Tree tree = this.engine.getQueryEngine().findSubGraph(v, depth, nodeOnly); TreeBackedVertex treeVertex = new TreeBackedVertex(v, tree); this.dbToObject(obj, treeVertex, seen, depth, nodeOnly, cleanUp); - + dbTimeMsecs += StopWatch.stopIfStarted(); return obj; } /** @@ -959,7 +980,8 @@ public class DBSerializer { uriParser = new URIToRelationshipObject(relationshipObj.getLoader(), uri, this.baseURL); result = uriParser.getResult(); } catch (AAIException | URISyntaxException e) { - LOGGER.error("Error while processing edge relationship in version " + relationshipObj.getVersion() + " (bad vertex ID=" + tuple.get().getValue0().id().toString() + ": " + e.getMessage(), e); + LOGGER.error("Error while processing edge relationship in version " + relationshipObj.getVersion() + " (bad vertex ID=" + tuple.get().getValue0().id().toString() + ": " + + e.getMessage() + " " + LogFormatTools.getStackTop(e)); if ("true".equals(cleanUp)) { this.deleteWithTraversal(tuple.get().getValue0()); } @@ -1003,11 +1025,15 @@ public class DBSerializer { if (aaiUri != null && !overwrite) { uri = UriBuilder.fromPath(aaiUri).build(); } else { + StopWatch.conditionalStart(); Optional>> tuple = this.getParents(this.loader, v, false); + dbTimeMsecs += StopWatch.stopIfStarted(); if (tuple.isPresent()) { List list = tuple.get().getValue1(); uri = this.getURIFromList(list); } + + } return uri; } @@ -1159,7 +1185,7 @@ public class DBSerializer { public boolean createEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException { Vertex relatedVertex = null; - + StopWatch.conditionalStart(); QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship); String label = null; @@ -1169,6 +1195,7 @@ public class DBSerializer { List results = parser.getQueryBuilder().toList(); if (results.isEmpty()) { + dbTimeMsecs += StopWatch.stopIfStarted(); AAIException e = new AAIException("AAI_6129", "Node of type " + parser.getResultType() + ". Could not find object at: " + parser.getUri()); e.getTemplateVars().add(parser.getResultType()); e.getTemplateVars().add(parser.getUri().toString()); @@ -1180,14 +1207,20 @@ public class DBSerializer { if (relatedVertex != null) { - Edge e = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label); - if (e == null) { - edgeRules.addEdge(this.engine.asAdmin().getTraversalSource(), inputVertex, relatedVertex, label); - } else { - //attempted to link two vertexes already linked + Edge e; + try { + e = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label); + if (e == null) { + edgeRules.addEdge(this.engine.asAdmin().getTraversalSource(), inputVertex, relatedVertex, label); + } else { + //attempted to link two vertexes already linked + } + } finally { + dbTimeMsecs += StopWatch.stopIfStarted(); } } + dbTimeMsecs += StopWatch.stopIfStarted(); return true; } @@ -1256,16 +1289,18 @@ public class DBSerializer { */ public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex, String label) throws AAIException { + StopWatch.conditionalStart(); if (bVertex != null) { List edges = this.getEdgesBetween(type, aVertex, bVertex, label); if (!edges.isEmpty()) { + dbTimeMsecs += StopWatch.stopIfStarted(); return edges.get(0); } } - + dbTimeMsecs += StopWatch.stopIfStarted(); return null; } public Edge getEdgeBetween(EdgeType type, Vertex aVertex, Vertex bVertex) throws AAIException { @@ -1285,7 +1320,7 @@ public class DBSerializer { public boolean deleteEdge(Introspector relationship, Vertex inputVertex) throws UnsupportedEncodingException, AAIException { Vertex relatedVertex = null; - + StopWatch.conditionalStart(); QueryParser parser = engine.getQueryBuilder().createQueryFromRelationship(relationship); List results = parser.getQueryBuilder().toList(); @@ -1296,6 +1331,7 @@ public class DBSerializer { } if (results.isEmpty()) { + dbTimeMsecs += StopWatch.stopIfStarted(); return false; } @@ -1304,12 +1340,15 @@ public class DBSerializer { try { edge = this.getEdgeBetween(EdgeType.COUSIN, inputVertex, relatedVertex, label); } catch (NoEdgeRuleFoundException e) { + dbTimeMsecs += StopWatch.stopIfStarted(); throw new AAIException("AAI_6129", e); } if (edge != null) { edge.remove(); + dbTimeMsecs += StopWatch.stopIfStarted(); return true; } else { + dbTimeMsecs += StopWatch.stopIfStarted(); return false; } @@ -1322,10 +1361,12 @@ public class DBSerializer { * @throws IllegalStateException the illegal state exception */ public void deleteItemsWithTraversal(List vertexes) throws IllegalStateException { + for (Vertex v : vertexes) { - LOGGER.debug("About to delete the vertex with id: " + v.id()); + LOGGER.debug("About to delete the vertex with id: " + v.id()); deleteWithTraversal(v); } + } /** @@ -1334,7 +1375,7 @@ public class DBSerializer { * @param startVertex the start vertex */ public void deleteWithTraversal(Vertex startVertex) { - + StopWatch.conditionalStart(); List results = this.engine.getQueryEngine().findDeletable(startVertex); for (Vertex v : results) { @@ -1342,7 +1383,7 @@ public class DBSerializer { v.remove(); } - + dbTimeMsecs += StopWatch.stopIfStarted(); } /** @@ -1385,8 +1426,10 @@ public class DBSerializer { nodeType = vertex.property(AAIProperties.NODE_TYPE).orElse(null); if (enableResourceVersion && !this.verifyResourceVersion("delete", nodeType, vertex.property(AAIProperties.RESOURCE_VERSION).orElse(null), resourceVersion, nodeType)) { } + StopWatch.conditionalStart(); List preventDeleteVertices = this.engine.asAdmin().getReadOnlyTraversalSource().V(vertex).union(__.inE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.IN.toString()).outV().values(AAIProperties.NODE_TYPE), __.outE().has(EdgeProperty.PREVENT_DELETE.toString(), AAIDirection.OUT.toString()).inV().values(AAIProperties.NODE_TYPE)).dedup().toList(); + dbTimeMsecs += StopWatch.stopIfStarted(); if (!preventDeleteVertices.isEmpty()) { aaiExceptionCode = "AAI_6110"; errorDetail = String.format("Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types %s", preventDeleteVertices); @@ -1499,4 +1542,194 @@ public class DBSerializer { runner.execute(obj, self); } + public double getDBTimeMsecs() { + return (dbTimeMsecs); + } + + /** + * Db to object With Filters + * This is for a one-time run with Tenant Isloation to only filter relationships + * TODO: Chnage the original dbToObject to take filter parent/cousins + * + * @param vertices the vertices + * @param obj the obj + * @param depth the depth + * @param cleanUp the clean up + * @return the introspector + * @throws AAIException the AAI exception + * @throws IllegalAccessException the illegal access exception + * @throws IllegalArgumentException the illegal argument exception + * @throws InvocationTargetException the invocation target exception + * @throws SecurityException the security exception + * @throws InstantiationException the instantiation exception + * @throws NoSuchMethodException the no such method exception + * @throws UnsupportedEncodingException the unsupported encoding exception + * @throws MalformedURLException the malformed URL exception + * @throws AAIUnknownObjectException + * @throws URISyntaxException + */ + //TODO - See if you can merge the 2 dbToObjectWithFilters + public Introspector dbToObjectWithFilters(Introspector obj, Vertex v, Set seen, int depth, boolean nodeOnly, List filterCousinNodes, List filterParentNodes) throws AAIException, UnsupportedEncodingException { + String cleanUp = "false"; + if (depth < 0) { + return null; + } + depth--; + seen.add(v); + boolean modified = false; + for (String property : obj.getProperties(PropertyPredicates.isVisible())) { + List getList = null; + Vertex[] vertices = null; + + if (!(obj.isComplexType(property) || obj.isListType(property))) { + this.copySimpleProperty(property, obj, v); + modified = true; + } else { + if (obj.isComplexType(property)) { + /* container case */ + + if (!property.equals("relationship-list") && depth >= 0) { + Introspector argumentObject = obj.newIntrospectorInstanceOfProperty(property); + Object result = dbToObjectWithFilters(argumentObject, v, seen, depth+1, nodeOnly, filterCousinNodes, filterParentNodes); + if (result != null) { + obj.setValue(property, argumentObject.getUnderlyingObject()); + modified = true; + } + } else if (property.equals("relationship-list") && !nodeOnly){ + /* relationships need to be handled correctly */ + Introspector relationshipList = obj.newIntrospectorInstanceOfProperty(property); + relationshipList = createFilteredRelationshipList(v, relationshipList, cleanUp, filterCousinNodes); + if (relationshipList != null) { + modified = true; + obj.setValue(property, relationshipList.getUnderlyingObject()); + modified = true; + } + + } + } else if (obj.isListType(property)) { + + if (property.equals("any")) { + continue; + } + String genericType = obj.getGenericTypeClass(property).getSimpleName(); + if (obj.isComplexGenericType(property) && depth >= 0) { + final String childDbName = convertFromCamelCase(genericType); + String vType = v.property(AAIProperties.NODE_TYPE).orElse(null); + EdgeRule rule; + + boolean isthisParentRequired = filterParentNodes.parallelStream().anyMatch(childDbName::contains); + + + + rule = edgeRules.getEdgeRule(EdgeType.TREE, vType, childDbName); + if (!rule.getContains().equals(AAIDirection.NONE.toString()) && isthisParentRequired) { + //vertices = this.queryEngine.findRelatedVertices(v, Direction.OUT, rule.getLabel(), childDbName); + Direction ruleDirection = rule.getDirection(); + Iterator itr = v.vertices(ruleDirection, rule.getLabel()); + List verticesList = (List)IteratorUtils.toList(itr); + itr = verticesList.stream().filter(item -> { + return item.property(AAIProperties.NODE_TYPE).orElse("").equals(childDbName); + }).iterator(); + if (itr.hasNext()) { + getList = (List)obj.getValue(property); + } + int processed = 0; + int removed = 0; + while (itr.hasNext()) { + Vertex childVertex = itr.next(); + if (!seen.contains(childVertex)) { + Introspector argumentObject = obj.newIntrospectorInstanceOfNestedProperty(property); + + Object result = dbToObjectWithFilters(argumentObject, childVertex, seen, depth, nodeOnly, filterCousinNodes, filterParentNodes); + if (result != null) { + getList.add(argumentObject.getUnderlyingObject()); + } + + processed++; + } else { + removed++; + LOGGER.warn("Cycle found while serializing vertex id={}", childVertex.id().toString()); + } + } + if (processed == 0) { + //vertices were all seen, reset the list + getList = null; + } + if (processed > 0) { + modified = true; + } + } + } else if (obj.isSimpleGenericType(property)) { + List temp = this.engine.getListProperty(v, property); + if (temp != null) { + getList = (List)obj.getValue(property); + getList.addAll(temp); + modified = true; + } + + } + + } + + } + } + + //no changes were made to this obj, discard the instance + if (!modified) { + return null; + } + this.enrichData(obj, v); + return obj; + + } + + /** + * Creates the relationship list with the filtered node types. + * + * @param v the v + * @param obj the obj + * @param cleanUp the clean up + * @return the object + * @throws InstantiationException the instantiation exception + * @throws IllegalAccessException the illegal access exception + * @throws IllegalArgumentException the illegal argument exception + * @throws InvocationTargetException the invocation target exception + * @throws NoSuchMethodException the no such method exception + * @throws SecurityException the security exception + * @throws UnsupportedEncodingException the unsupported encoding exception + * @throws AAIException the AAI exception + * @throws MalformedURLException the malformed URL exception + * @throws URISyntaxException + */ + private Introspector createFilteredRelationshipList(Vertex v, Introspector obj, String cleanUp, List filterNodes) throws UnsupportedEncodingException, AAIException { + List allCousins = this.engine.getQueryEngine().findCousinVertices(v); + + Iterator cousinVertices = allCousins.stream().filter(item -> { + String node = (String)item.property(AAIProperties.NODE_TYPE).orElse(""); + return filterNodes.parallelStream().anyMatch(node::contains); + }).iterator(); + + + List cousins = (List)IteratorUtils.toList(cousinVertices); + + //items.parallelStream().anyMatch(inputStr::contains) + List relationshipObjList = obj.getValue("relationship"); + for (Vertex cousin : cousins) { + + Introspector relationshipObj = obj.newIntrospectorInstanceOfNestedProperty("relationship"); + Object result = processEdgeRelationship(relationshipObj, cousin, cleanUp, null); + if (result != null) { + relationshipObjList.add(result); + } + + + } + + if (relationshipObjList.isEmpty()) { + return null; + } else { + return obj; + } + } + } diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeProperty.java b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeProperty.java index ecd749c7..65753a26 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeProperty.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeProperty.java @@ -1,21 +1,23 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * 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 - * + * + * 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.serialization.db; @@ -24,7 +26,8 @@ public enum EdgeProperty { CONTAINS("contains-other-v"), DELETE_OTHER_V("delete-other-v"), SVC_INFRA("SVC-INFRA"), - PREVENT_DELETE("prevent-delete"); + PREVENT_DELETE("prevent-delete"), + DESCRIPTION("description"); private final String name; private EdgeProperty(String name) { diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRule.java b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRule.java index ae9e96c0..0a32db7c 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRule.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRule.java @@ -1,30 +1,31 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * 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 - * + * + * 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.serialization.db; +import org.apache.tinkerpop.gremlin.structure.Direction; + import java.util.EnumMap; import java.util.Map; -import org.apache.tinkerpop.gremlin.structure.Direction; - public class EdgeRule { private String label = ""; @@ -32,14 +33,32 @@ public class EdgeRule { private Direction direction = null; private Map edgeProperties = null; private boolean isDefaultEdge = false; - + private String from; + private String to; + /** * Instantiates a new edge rule. */ public EdgeRule() { edgeProperties = new EnumMap<>(EdgeProperty.class); } - + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public String getTo() { + return to; + } + + public void setTo(String to) { + this.to = to; + } + /** * Gets the label. * @@ -210,14 +229,14 @@ public class EdgeRule { public boolean isDefault() { return isDefaultEdge; } - + public void setIsDefault(boolean isDefault) { this.isDefaultEdge = isDefault; } - + public void setIsDefault(String isDefault) { this.isDefaultEdge = "true".equals(isDefault); } - - + + } diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRules.java b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRules.java index 349f9e6b..622c3067 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRules.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeRules.java @@ -25,14 +25,8 @@ import static com.jayway.jsonpath.Criteria.where; import static com.jayway.jsonpath.Filter.filter; import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Optional; -import java.util.Scanner; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; @@ -243,6 +237,8 @@ public class EdgeRules { for (Entry entry : propMap.entrySet()) { edge.property(entry.getKey().toString(), entry.getValue()); } + + edge.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()); } /** @@ -652,11 +648,17 @@ public class EdgeRules { rule.setDeleteOtherV(edge.get(EdgeProperty.DELETE_OTHER_V.toString())); rule.setServiceInfrastructure(edge.get(EdgeProperty.SVC_INFRA.toString())); rule.setPreventDelete(edge.get(EdgeProperty.PREVENT_DELETE.toString())); + rule.setTo(edge.get("to")); + rule.setFrom(edge.get("from")); if (edge.containsKey("default")) { rule.setIsDefault(edge.get("default")); } - return rule; + if(rule.getFrom().equals(rule.getTo())){ + return this.flipDirection(rule); + } else { + return rule; + } } /** @@ -777,6 +779,11 @@ public class EdgeRules { */ private void verifyRule(Map rule) { for (EdgeProperty prop : EdgeProperty.values()) { + + // Description is not required as it is only set for v12 versions + if("description".equals(prop.toString())){ + continue; + } if (!rule.containsKey(prop.toString())) { /* Throws RuntimeException as rule definition errors * cannot be recovered from, and should never happen anyway diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/InMemoryGraphSingleton.java b/aai-core/src/main/java/org/onap/aai/serialization/db/InMemoryGraphSingleton.java new file mode 100644 index 00000000..091ab457 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/InMemoryGraphSingleton.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.serialization.db; + +import org.onap.aai.dbmap.DBConnectionType; + +import com.thinkaurelius.titan.core.TitanGraph; + +public class InMemoryGraphSingleton extends GraphSingleton { + + private static TitanGraph inMemgraph; + + private static class Helper { + private static final InMemoryGraphSingleton INSTANCE = new InMemoryGraphSingleton(); + } + + /** + * Gets the single instance of TitanGraphSingleton. + * + * @return single instance of TitanGraphSingleton + */ + public static InMemoryGraphSingleton getInstance(TitanGraph graph) { + inMemgraph = graph; + return Helper.INSTANCE; + } + + /** + * Gets the tx graph. + * + * @return the tx graph + */ + @Override + public TitanGraph getTxGraph() { + return inMemgraph; + } + + @Override + public TitanGraph getTxGraph(DBConnectionType connectionType) { + return inMemgraph; + } +} diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/exceptions/MultipleEdgeRuleFoundException.java b/aai-core/src/main/java/org/onap/aai/serialization/db/exceptions/MultipleEdgeRuleFoundException.java index bb4ba4df..f94eb407 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/exceptions/MultipleEdgeRuleFoundException.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/exceptions/MultipleEdgeRuleFoundException.java @@ -1,21 +1,23 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * 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 - * + * + * 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.serialization.db.exceptions; @@ -25,7 +27,7 @@ import org.onap.aai.exceptions.AAIException; public class MultipleEdgeRuleFoundException extends AAIException { private static final long serialVersionUID = -906843868234976763L; - + public MultipleEdgeRuleFoundException(String message) { super("AAI_6107", message); } diff --git a/aai-core/src/main/java/org/onap/aai/serialization/engines/InMemoryDBEngine.java b/aai-core/src/main/java/org/onap/aai/serialization/engines/InMemoryDBEngine.java new file mode 100644 index 00000000..197aff94 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/serialization/engines/InMemoryDBEngine.java @@ -0,0 +1,207 @@ +/** + * ============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.serialization.engines; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; + +import org.onap.aai.dbmap.DBConnectionType; +import org.onap.aai.introspection.Loader; +import org.onap.aai.query.builder.GremlinTraversal; +import org.onap.aai.query.builder.GremlinUnique; +import org.onap.aai.query.builder.QueryBuilder; +import org.onap.aai.query.builder.TraversalQuery; +import org.onap.aai.serialization.db.InMemoryGraphSingleton; +import org.onap.aai.serialization.engines.query.GraphTraversalQueryEngine; +import org.onap.aai.serialization.engines.query.QueryEngine; +import org.onap.aai.serialization.engines.TransactionalGraphEngine; + +import com.thinkaurelius.titan.core.TitanGraph; + +public class InMemoryDBEngine extends TransactionalGraphEngine { + + /** + * Instantiates a new titan DB engine. + * + * @param style + * the style + * @param loader + * the loader + */ + private TitanGraph graph = null; + + private static final TransactionalGraphEngine.Admin admin = null; + + public InMemoryDBEngine(QueryStyle style, DBConnectionType connectionType, Loader loader, TitanGraph graph) { + super(style, loader, connectionType, InMemoryGraphSingleton.getInstance(graph)); + this.graph = graph; + } + + /** + * Instantiates a new titan DB engine. + * + * @param style + * the style + * @param loader + * the loader + * @param connect + * the connect + */ + public InMemoryDBEngine(QueryStyle style, Loader loader, boolean connect, TitanGraph graph) { + super(style, loader); + if (connect) { + this.singleton = InMemoryGraphSingleton.getInstance(graph); + } + this.graph = graph; + } + + @Override + public QueryEngine getQueryEngine() { + + if (style.equals(QueryStyle.TRAVERSAL)) { + + GraphTraversalSource traversalSource = graph.traversal(); + return new GraphTraversalQueryEngine(traversalSource); + + } else { + throw new IllegalArgumentException("Query Engine type not recognized"); + } + + } + + @Override + public QueryBuilder getQueryBuilder(QueryStyle style, Loader loader) { + if (style.equals(QueryStyle.GREMLIN_TRAVERSAL)) { + return new GremlinTraversal<>(loader, graph.traversal()); + } else if (style.equals(QueryStyle.TRAVERSAL)) { + return new TraversalQuery<>(loader, graph.traversal()); + + } else { + throw new IllegalArgumentException("Query Builder type is Not recognized"); + } + + } + + /** + * {@inheritDoc} + */ + @Override + public boolean setListProperty(Vertex v, String name, List objs) { + + // clear out list full replace style + + Iterator> iterator = v.properties(name); + while (iterator.hasNext()) { + iterator.next().remove(); + } + if (objs != null) { + for (Object obj : objs) { + v.property(name, obj); + } + } + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public List getListProperty(Vertex v, String name) { + + List result = new ArrayList<>(); + + Iterator> iterator = v.properties(name); + + while (iterator.hasNext()) { + result.add(iterator.next().value()); + } + + if (result.isEmpty()) { + result = null; + } + + return result; + + } + + @Override + public QueryBuilder getQueryBuilder() { + return getQueryBuilder(this.loader); + } + + @Override + public QueryBuilder getQueryBuilder(Loader loader) { + if (style.equals(QueryStyle.GREMLIN_TRAVERSAL)) { + return new GremlinTraversal<>(loader, this.asAdmin().getTraversalSource()); + } else if (style.equals(QueryStyle.GREMLIN_UNIQUE)) { + return new GremlinUnique<>(loader, this.asAdmin().getTraversalSource()); + } else if (style.equals(QueryStyle.TRAVERSAL)) { + return new TraversalQuery<>(loader, graph.traversal()); + } else { + throw new IllegalArgumentException("Query Builder type not recognized"); + } + + } + + @Override + public QueryBuilder getQueryBuilder(Vertex start) { + return getQueryBuilder(this.loader, start); + } + + public GraphTraversalSource getTraversalSource() { + return graph.traversal(); + } + + @Override + public QueryBuilder getQueryBuilder(Loader loader, Vertex start) { + if (style.equals(QueryStyle.GREMLIN_TRAVERSAL)) { + return new GremlinTraversal<>(loader, graph.traversal(), start); + } else if (style.equals(QueryStyle.GREMLIN_UNIQUE)) { + return new GremlinUnique<>(loader, this.asAdmin().getTraversalSource(), start); + } else if (style.equals(QueryStyle.TRAVERSAL)) { + return new TraversalQuery<>(loader, graph.traversal(), start); + } else { + throw new IllegalArgumentException("Query Builder type not recognized"); + } + + } + + @Override + public Graph startTransaction() { + if (this.tx() == null) { + this.currentTx = graph.newTransaction(); + this.currentTraversal = this.tx().traversal(); + this.readOnlyTraversal = this.tx() + .traversal(GraphTraversalSource.build().with(ReadOnlyStrategy.instance())); + } + return currentTx; + } + + + +} diff --git a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java index 7efe2ea9..27733039 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngine.java @@ -42,6 +42,7 @@ import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.introspection.Loader; +import org.onap.aai.logging.StopWatch; /* * This class needs some big explanation despite its compact size. @@ -68,10 +69,15 @@ public class GraphTraversalQueryEngine extends QueryEngine { */ @Override public List findParents(Vertex start) { - - @SuppressWarnings("unchecked") - final GraphTraversal pipe = this.g.V(start).emit(v -> true).repeat(__.union(__.inE().has(CONTAINS.toString(), OUT.toString()).outV(), __.outE().has(CONTAINS.toString(), IN.toString()).inV())); - return pipe.toList(); + try { + StopWatch.conditionalStart(); + @SuppressWarnings("unchecked") + final GraphTraversal pipe = this.g.V(start).emit(v -> true).repeat(__.union(__.inE().has(CONTAINS.toString(), OUT.toString()).outV(), __.outE().has(CONTAINS.toString(), IN.toString()).inV())); + return pipe.toList(); + } + finally { + dbTimeMsecs += StopWatch.stopIfStarted(); + } } /** @@ -129,7 +135,7 @@ public class GraphTraversalQueryEngine extends QueryEngine { __.outE().has(DELETE_OTHER_V.toString(), OUT.toString()).inV(), __.inE().has(DELETE_OTHER_V.toString(), IN.toString()).outV() ) - ); + ).dedup(); return pipe.toList(); } @@ -201,5 +207,8 @@ public class GraphTraversalQueryEngine extends QueryEngine { return pipeline.toList(); } + public double getDBTimeMsecs() { + return (dbTimeMsecs); + } } diff --git a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java index 5a468b79..0e000948 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/engines/query/QueryEngine.java @@ -34,8 +34,8 @@ import java.util.List; public abstract class QueryEngine { - protected final GraphTraversalSource g; - + final protected GraphTraversalSource g; + protected double dbTimeMsecs = 0; /** * Instantiates a new query engine. * @@ -145,4 +145,6 @@ public abstract class QueryEngine { */ public abstract List findCousinVertices(Vertex start); + public abstract double getDBTimeMsecs(); + } diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatFactory.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatFactory.java index 21a7e0fe..aec0be27 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatFactory.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatFactory.java @@ -31,9 +31,6 @@ import org.onap.aai.serialization.queryformats.exceptions.QueryParamInjectionExc import org.onap.aai.serialization.queryformats.utils.QueryParamInjector; import org.onap.aai.serialization.queryformats.utils.UrlBuilder; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; - public class FormatFactory { private final Loader loader; diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatMapper.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatMapper.java index 27d204a6..44018354 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatMapper.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/FormatMapper.java @@ -21,9 +21,9 @@ */ package org.onap.aai.serialization.queryformats; +import com.google.gson.JsonObject; import org.onap.aai.serialization.queryformats.exceptions.AAIFormatQueryResultFormatNotSupported; import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; -import com.google.gson.JsonObject; public interface FormatMapper { diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java index b145d423..698aef6e 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java @@ -21,19 +21,20 @@ */ package org.onap.aai.serialization.queryformats; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import org.onap.aai.serialization.queryformats.exceptions.AAIFormatQueryResultFormatNotSupported; -import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; - import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import org.onap.aai.logging.LogFormatTools; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatQueryResultFormatNotSupported; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + public class Formatter { private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(Formatter.class); @@ -50,14 +51,14 @@ public class Formatter { Stream stream = null; JsonObject result = new JsonObject(); JsonArray body = new JsonArray(); - + if (this.format instanceof Count) { JsonObject countResult; try { countResult = format.formatObject(queryResults); - body.add(countResult); + body.add(countResult); } catch (Exception e) { - LOGGER.warn("Failed to format result type of the query", e); + LOGGER.warn("Failed to format result type of the query " + LogFormatTools.getStackTop(e)); } } else { if (queryResults.size() >= format.parallelThreshold()) { @@ -65,16 +66,16 @@ public class Formatter { } else { stream = queryResults.stream(); } - + final boolean isParallel = stream.isParallel(); - + stream.map(o -> { try { return Optional.of(format.formatObject(o)); } catch (AAIFormatVertexException e) { - LOGGER.warn("Failed to format vertex, returning a partial list", e); + LOGGER.warn("Failed to format vertex, returning a partial list " + LogFormatTools.getStackTop(e)); } catch (AAIFormatQueryResultFormatNotSupported e) { - LOGGER.warn("Failed to format result type of the query", e); + LOGGER.warn("Failed to format result type of the query " + LogFormatTools.getStackTop(e)); } return Optional.empty(); diff --git a/aai-core/src/main/java/org/onap/aai/tasks/ScheduledTasks.java b/aai-core/src/main/java/org/onap/aai/tasks/ScheduledTasks.java index 9d2e8b68..e1f554ad 100644 --- a/aai-core/src/main/java/org/onap/aai/tasks/ScheduledTasks.java +++ b/aai-core/src/main/java/org/onap/aai/tasks/ScheduledTasks.java @@ -32,6 +32,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import org.onap.aai.util.AAIConfig; import org.onap.aai.util.AAIConstants; import com.att.eelf.configuration.EELFLogger; @@ -57,9 +58,15 @@ public class ScheduledTasks { public void loadAAIProperties() { final UUID transId = UUID.randomUUID(); + LoggingContext.init(); LoggingContext.requestId(transId); LoggingContext.partnerName(FROM_APP_ID); LoggingContext.component(COMPONENT); + LoggingContext.targetEntity("AAI"); + LoggingContext.targetServiceName("loadAAIProperties"); + LoggingContext.serviceName("AAI"); + LoggingContext.statusCode(StatusCode.COMPLETE); + LoggingContext.responseCode(LoggingContext.SUCCESS); String dir = FilenameUtils.getFullPathNoEndSeparator(GlobalPropFileName); if (dir == null || dir.length() < 3) { @@ -82,7 +89,7 @@ public class ScheduledTasks { long curTSTm = curTS.getTime(); if (curTSTm - lastModTm < PROPERTY_READ_INTERVAL + 1000) { AAIConfig.reloadConfig(); - LOGGER.info("reloaded from aaiconfig.properties"); + LOGGER.debug("reloaded from aaiconfig.properties"); } break; } diff --git a/aai-core/src/main/java/org/onap/aai/util/AAIApiServerURLBase.java b/aai-core/src/main/java/org/onap/aai/util/AAIApiServerURLBase.java index 45f671ef..e458c4f9 100644 --- a/aai-core/src/main/java/org/onap/aai/util/AAIApiServerURLBase.java +++ b/aai-core/src/main/java/org/onap/aai/util/AAIApiServerURLBase.java @@ -73,8 +73,7 @@ public class AAIApiServerURLBase { */ public static String get(Version v) throws AAIException { String hostName = null; - hostName = AAIApiServerURLBase.get(); - + hostName = AAIApiServerURLBase.get(); return hostName; } diff --git a/aai-core/src/main/java/org/onap/aai/util/AAIConfig.java b/aai-core/src/main/java/org/onap/aai/util/AAIConfig.java index 445fa0dd..57bf2cc7 100644 --- a/aai-core/src/main/java/org/onap/aai/util/AAIConfig.java +++ b/aai-core/src/main/java/org/onap/aai/util/AAIConfig.java @@ -30,6 +30,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Properties; import java.util.Timer; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; + +import java.util.UUID; import org.eclipse.jetty.util.security.Password; @@ -62,6 +66,16 @@ public class AAIConfig { * @throws AAIException the AAI exception */ public synchronized static void init() throws AAIException{ + + LoggingContext.save(); + LoggingContext.component("config"); + LoggingContext.partnerName("NA"); + LoggingContext.targetEntity("AAI"); + LoggingContext.requestId(UUID.randomUUID().toString()); + LoggingContext.serviceName("AAI"); + LoggingContext.targetServiceName("init"); + LoggingContext.statusCode(StatusCode.COMPLETE); + LOGGER.info("Initializing AAIConfig"); ArrayList genericVnfBools = new ArrayList(); @@ -96,6 +110,7 @@ public class AAIConfig { } else { LOGGER.info("A&AI Server Node Name = " + AAIConstants.AAI_NODENAME); } + LoggingContext.restore(); } /** @@ -137,7 +152,7 @@ public class AAIConfig { String propFileName = GLOBAL_PROP_FILE_NAME; Properties newServerProps = null; - LOGGER.info("Reloading config from " + propFileName); + LOGGER.debug("Reloading config from " + propFileName); try { InputStream is = new FileInputStream(propFileName); diff --git a/aai-core/src/main/java/org/onap/aai/util/AAIConstants.java b/aai-core/src/main/java/org/onap/aai/util/AAIConstants.java index e201b6d8..9c875ec8 100644 --- a/aai-core/src/main/java/org/onap/aai/util/AAIConstants.java +++ b/aai-core/src/main/java/org/onap/aai/util/AAIConstants.java @@ -47,6 +47,8 @@ public final class AAIConstants { public static final String CACHED_DB_CONFIG = AAI_HOME_ETC_APP_PROPERTIES + "titan-cached.properties"; public static final String AAI_HOME_ETC_OXM = AAI_HOME_ETC + "oxm" + AAI_FILESEP; public static final String AAI_EVENT_DMAAP_PROPS = AAI_HOME_ETC_APP_PROPERTIES + "aaiEventDMaaPPublisher.properties"; + public static final String AAI_HOME_ETC_SCRIPT = AAI_HOME_ETC + AAI_FILESEP + "scriptdata" + AAI_FILESEP; + public static final String AAI_PROV_LOGBACK_PROPS = "prov-logback.xml"; public static final String AAI_GETRES_LOGBACK_PROPS = "getres-logback.xml"; @@ -96,6 +98,14 @@ public final class AAIConstants { public static final String AAI_BULKCONSUMER_LIMIT = "aai.bulkconsumer.payloadlimit"; public static final String AAI_BULKCONSUMER_OVERRIDE_LIMIT = "aai.bulkconsumer.payloadoverride"; + public static final String AAI_TRAVERSAL_TIMEOUT_LIMIT = "aai.traversal.timeoutlimit"; + public static final String AAI_TRAVERSAL_TIMEOUT_ENABLED = "aai.traversal.timeoutenabled"; + public static final String AAI_TRAVERSAL_TIMEOUT_APP = "aai.traversal.timeout.appspecific"; + + public static final String AAI_CRUD_TIMEOUT_LIMIT = "aai.crud.timeoutlimit"; + public static final String AAI_CRUD_TIMEOUT_ENABLED = "aai.crud.timeoutenabled"; + public static final String AAI_CRUD_TIMEOUT_APP = "aai.crud.timeout.appspecific"; + public static final String AAI_LOGGING_HBASE_INTERCEPTOR = "aai.logging.hbase.interceptor"; public static final String AAI_LOGGING_HBASE_ENABLED = "aai.logging.hbase.enabled"; public static final String AAI_LOGGING_HBASE_LOGREQUEST = "aai.logging.hbase.logrequest"; @@ -124,7 +134,7 @@ public final class AAIConstants { public static final String AAI_SKIPREALTIME_GROOMING = (System.getProperty("aai.skiprealtime.grooming") == null) ? "true" : System.getProperty("aai.skiprealtime.grooming"); - /*** UEB ***/ + /*** UEB ***/ public static final String UEB_PUB_PARTITION_AAI = "AAI"; public static final String UEB_PUB_AAI_VCE_INTERFACE_DATA_TOPIC = "ueb.pub.aai.vce.interface.data.topic"; diff --git a/aai-core/src/main/java/org/onap/aai/util/AAIRSyncUtility.java b/aai-core/src/main/java/org/onap/aai/util/AAIRSyncUtility.java index f20346eb..448d067a 100644 --- a/aai-core/src/main/java/org/onap/aai/util/AAIRSyncUtility.java +++ b/aai-core/src/main/java/org/onap/aai/util/AAIRSyncUtility.java @@ -35,7 +35,7 @@ import java.util.StringTokenizer; import org.onap.aai.exceptions.AAIException; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; - +import org.onap.aai.logging.ErrorLogHelper; public class AAIRSyncUtility { @@ -145,7 +145,7 @@ public class AAIRSyncUtility { } } } catch ( Exception e) { - LOGGER.error("no server found processing serverList for host " + host + ": " + e.getMessage() + " (AAI_4000)"); + ErrorLogHelper.logError("AAI_4000", "no server found processing serverList for host " + host + ": " + e.getMessage()); } } diff --git a/aai-core/src/main/java/org/onap/aai/util/AAISystemExitUtil.java b/aai-core/src/main/java/org/onap/aai/util/AAISystemExitUtil.java new file mode 100644 index 00000000..9149d0b4 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/util/AAISystemExitUtil.java @@ -0,0 +1,34 @@ +/** + * ============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.util; + +import org.onap.aai.dbmap.AAIGraph; + +public class AAISystemExitUtil { + + public static void systemExitCloseAAIGraph(int code) { + if (AAIGraph.isInit()) { + AAIGraph.getInstance().graphShutdown(); + } + System.exit(code); + } +} diff --git a/aai-core/src/main/java/org/onap/aai/util/AutoGenerateHtml.java b/aai-core/src/main/java/org/onap/aai/util/AutoGenerateHtml.java new file mode 100644 index 00000000..f0489da2 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/util/AutoGenerateHtml.java @@ -0,0 +1,67 @@ +/** + * ============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.util; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.ListIterator; + +import org.onap.aai.introspection.Version; +import org.onap.aai.util.swagger.GenerateSwagger; + +import freemarker.template.TemplateException; + +public class AutoGenerateHtml { + + public static final String DEFAULT_SCHEMA_DIR = "../aai-schema"; + //if the program is run from aai-common, use this directory as default" + public static final String ALT_SCHEMA_DIR = "aai-schema"; + //used to check to see if program is run from aai-core + public static final String DEFAULT_RUN_DIR = "aai-core"; + + public static void main(String[] args) throws IOException, TemplateException { + String savedProperty = System.getProperty("aai.generate.version"); + List versionsToGen = Arrays.asList(Version.values()); + Collections.sort(versionsToGen); + Collections.reverse(versionsToGen); + ListIterator versionIterator = versionsToGen.listIterator(); + String schemaDir; + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) { + schemaDir = ALT_SCHEMA_DIR; + } + else { + schemaDir = DEFAULT_SCHEMA_DIR; + } + while (versionIterator.hasNext()) { + System.setProperty("aai.generate.version", versionIterator.next().toString()); + String yamlFile = schemaDir + "/src/main/resources/aai_swagger_yaml/aai_swagger_" + System.getProperty("aai.generate.version")+ ".yaml"; + File swaggerYamlFile = new File(yamlFile); + if(swaggerYamlFile.exists()) { + GenerateSwagger.main(args); + } + } + String versionToGenerate = System.setProperty("aai.generate.version", savedProperty); + } +} diff --git a/aai-core/src/main/java/org/onap/aai/util/GenerateXsd.java b/aai-core/src/main/java/org/onap/aai/util/GenerateXsd.java index d2dc8b76..af9171dd 100644 --- a/aai-core/src/main/java/org/onap/aai/util/GenerateXsd.java +++ b/aai-core/src/main/java/org/onap/aai/util/GenerateXsd.java @@ -7,9 +7,9 @@ * 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 - * + * + * 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. @@ -19,13 +19,18 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ + package org.onap.aai.util; import com.google.common.base.Joiner; import com.jayway.jsonpath.JsonPath; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.similarity.LevenshteinDistance; + import org.onap.aai.introspection.Version; import org.onap.aai.serialization.db.EdgeProperty; import org.w3c.dom.*; +import org.xml.sax.InputSource; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; @@ -38,10 +43,13 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; - +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GenerateXsd { + private static final Logger logger = LoggerFactory.getLogger("GenerateXsd.class"); + static String apiVersion = null; static String apiVersionFmt = null; static boolean useAnnotationsInXsd = false; @@ -51,9 +59,24 @@ public class GenerateXsd { static Map generatedJavaType; static Map appliedPaths; + static Map deletePaths; + static Map putRelationPaths; static NodeList javaTypeNodes; + static Map javaTypeDefinitions = createJavaTypeDefinitions(); + private static Map createJavaTypeDefinitions() + { + StringBuffer aaiInternal = new StringBuffer(); + Map javaTypeDefinitions = new HashMap(); + aaiInternal.append(" aai-internal:\n"); + aaiInternal.append(" properties:\n"); + aaiInternal.append(" property-name:\n"); + aaiInternal.append(" type: string\n"); + aaiInternal.append(" property-value:\n"); + aaiInternal.append(" type: string\n"); + javaTypeDefinitions.put("aai-internal", aaiInternal.toString()); + return javaTypeDefinitions; + } - public static final int VALUE_NONE = 0; public static final int VALUE_DESCRIPTION = 1; public static final int VALUE_INDEXED_PROPS = 2; @@ -64,12 +87,17 @@ public class GenerateXsd { private static final String root = "../aai-schema/src/main/resources"; private static final String xsd_dir = root + "/aai_schema"; private static final String yaml_dir = root + "/aai_swagger_yaml"; + + /* These three strings are for yaml auto-generation from aai-common class*/ + private static final String normalStartDir = "aai-core"; + private static final String autoGenRoot = "aai-schema/src/main/resources"; + private static final String alt_yaml_dir = autoGenRoot + "/aai_swagger_yaml"; private static int annotationsStartVersion = 9; // minimum version to support annotations in xsd private static int swaggerSupportStartsVersion = 7; // minimum version to support swagger documentation private static XPath xpath = XPathFactory.newInstance().newXPath(); - + private enum LineageType { PARENT, CHILD, UNRELATED; @@ -77,10 +105,91 @@ public class GenerateXsd { private class EdgeDescription { private String ruleKey; + private String to; + private String from; private LineageType type = LineageType.UNRELATED; private String direction; private String multiplicity; + private String preventDelete; + private String deleteOtherV; private boolean hasDelTarget = false; + private String label; + private String description; + /** + * @return the deleteOtherV + */ + public String getDeleteOtherV() { + return deleteOtherV; + } + /** + * @param deleteOtherV the deleteOtherV to set + */ + public void setDeleteOtherV(String deleteOtherV) { + logger.debug("Edge: "+this.getRuleKey()); + logger.debug("Truth: "+(("${direction}".equals(deleteOtherV)) ? "true" : "false")); + logger.debug("Truth: "+(("!${direction}".equals(deleteOtherV)) ? "true" : "false")); + + if("${direction}".equals(deleteOtherV) ) { + this.deleteOtherV = this.direction; + } else if("!${direction}".equals(deleteOtherV) ) { + this.deleteOtherV = this.direction.equals("IN") ? "OUT" : ((this.direction.equals("OUT")) ? "IN" : deleteOtherV); + } else { + this.deleteOtherV = deleteOtherV; + } + logger.debug("DeleteOtherV="+deleteOtherV+"/"+this.direction+"="+this.deleteOtherV); + } + /** + * @return the preventDelete + */ + public String getPreventDelete() { + return preventDelete; + } + /** + * @param preventDelete the preventDelete to set + */ + public void setPreventDelete(String preventDelete) { + if(this.getTo().equals("flavor") || this.getFrom().equals("flavor") ){ + logger.debug("Edge: "+this.getRuleKey()); + logger.debug("Truth: "+(("${direction}".equals(preventDelete)) ? "true" : "false")); + logger.debug("Truth: "+(("!${direction}".equals(preventDelete)) ? "true" : "false")); + } + + if("${direction}".equals(preventDelete) ) { + this.preventDelete = this.direction; + } else if("!${direction}".equals(preventDelete) ) { + this.preventDelete = this.direction.equals("IN") ? "OUT" : ((this.direction.equals("OUT")) ? "IN" : preventDelete); + } else { + this.preventDelete = preventDelete; + } + if(this.getTo().equals("flavor") || this.getFrom().equals("flavor")) { + logger.debug("PreventDelete="+preventDelete+"/"+this.direction+"="+this.preventDelete); + } + } + /** + * @return the to + */ + public String getTo() { + return to; + } + /** + * @param to the to to set + */ + public void setTo(String to) { + this.to = to; + } + /** + * @return the from + */ + public String getFrom() { + return from; + } + /** + * @param from the from to set + */ + public void setFrom(String from) { + this.from = from; + } + public String getRuleKey() { return ruleKey; @@ -91,6 +200,9 @@ public class GenerateXsd { public String getDirection() { return direction; } + public String getDescription() { + return this.description; + } public void setRuleKey(String val) { this.ruleKey=val; } @@ -106,6 +218,9 @@ public class GenerateXsd { public void setHasDelTarget(String val) { hasDelTarget = Boolean.parseBoolean(val); } + public void setDescription(String val) { + this.description = val; + } public String getRelationshipDescription(String fromTo, String otherNodeName) { @@ -114,95 +229,487 @@ public class GenerateXsd { if ("FROM".equals(fromTo)) { if ("OUT".equals(direction)) { if (LineageType.PARENT == type) { - result = " (is composed of "+otherNodeName; + result = " (PARENT of "+otherNodeName; + result = String.join(" ", result+",", this.from, this.getLabel(), this.to); } } else { if (LineageType.CHILD == type) { - result = " (comprises "+otherNodeName; + result = " (CHILD of "+otherNodeName; + result = String.join(" ", result+",", this.from, this.getLabel(), this.to); } else if (LineageType.PARENT == type) { - result = " (comprises "+otherNodeName; + result = " (PARENT of "+otherNodeName; + result = String.join(" ", result+",", this.from, this.getLabel(), this.to); } } + if (result.length() == 0) result = String.join(" ", "(", this.from, this.getLabel(), this.to+",", this.getMultiplicity()); } else { + //if ("TO".equals(fromTo) if ("OUT".equals(direction)) { if (LineageType.PARENT == type) { - result = " (comprises "+otherNodeName; + result = " (CHILD of "+otherNodeName; + result = String.join(" ", result+",", this.from, this.getLabel(), this.to+",", this.getMultiplicity()); } } else { if (LineageType.PARENT == type) { - result = " (is composed of "+otherNodeName; + result = " (PARENT of "+otherNodeName; + result = String.join(" ", result+",", this.from, this.getLabel(), this.to+",", this.getMultiplicity()); } } - } + if (result.length() == 0) result = String.join(" ", "(", this.from, this.getLabel(), this.to+",", this.getMultiplicity()); -// if (type != null) { -// if (LineageType.PARENT.equals(type) && "FROM".equals(fromTo)) { -// if ("OUT".equals(direction)) { -// result = " (is composed of "+otherNodeName; -// } else { -// result = " (comprises "+otherNodeName; -// } -// } else { -// result = " (comprises " + otherNodeName; -// // if (!(multiplicity.startsWith("One"))) { -// // System.err.println("Surprised to find multiplicity "+multiplicity+" with comprises for "+ruleKey); -// // } -// } -// } - if ("TO".equals(fromTo)) { - if (result.length() == 0) result = result + " ("; - else result = result + ", "; - - result = result + mapMultiplicity(fromTo); - if (hasDelTarget) result = result + ", will delete target node"; } + if (hasDelTarget) result = result + ", will delete target node"; + if (result.length() > 0) result = result + ")"; + if (description != null && description.length() > 0) result = result + "\n "+ description; // 6 spaces is important for yaml + return result; } - private String mapMultiplicity(String fromTo) { - String result = multiplicity; -// Below logic works if an IN switches multiplicity, which it doesn't today. -// if ("TO".equals(fromTo)) { -// if (direction.equals("OUT")) { -// result = multiplicity; -// } else { -// result = switchMultiplicity(multiplicity); -// } -// } else { -// if (direction.equals("OUT")) { -// result = multiplicity; -// } else { -// result = switchMultiplicity(multiplicity); -// } -// } - return result; + /** + * @return the hasDelTarget + */ + @SuppressWarnings("unused") + public boolean isHasDelTarget() { + return hasDelTarget; + } + /** + * @param hasDelTarget the hasDelTarget to set + */ + @SuppressWarnings("unused") + public void setHasDelTarget(boolean hasDelTarget) { + this.hasDelTarget = hasDelTarget; + } + /** + * @return the type + */ + @SuppressWarnings("unused") + public LineageType getType() { + return type; } + /** + * @return the label + */ + public String getLabel() { + return label; + } + public void setLabel(String string) { + this.label=string; + } + } + + private static class PutRelationPathSet { + String apiPath; + String opId; + ArrayList relations = new ArrayList(); + String objectName = ""; + String currentAPIVersion = ""; + public PutRelationPathSet(String opId, String path) { + super(); + this.apiPath = path.replace("/relationship-list/relationship", ""); + this.opId = opId; + objectName = GenerateXsd.deletePaths.get(apiPath); + currentAPIVersion = GenerateXsd.apiVersion; + } + public void process() { + this.toRelations(); + this.fromRelations(); + this.writeRelationsFile(); -// private String switchMultiplicity(String val) throws IllegalArgumentException -// { -// String result = null; -// switch (val) { -// case "Many2Many": -// case "One2One": -// result = val; -// break; -// case "Many2One": -// result = "One2Many"; -// break; -// case "One2Many": -// result = "Many2One"; -// break; -// default: -// throw new IllegalArgumentException("Multiplicity cannot be "+val); -// } -// System.out.println("Switched Multiplicity from "+val+" to "+result); -// return result; -// } + } + public void toRelations() { + logger.debug("{“comment”: “Valid TO Relations that can be added”},"); + logger.debug("apiPath: "+apiPath+"\nopId="+opId+"\nobjectName="+objectName); + Collection toEdges = GenerateXsd.getEdgeRulesTO(objectName); + + if(toEdges.size() > 0) { + relations.add("{\"comment\": \"Valid TO Relations that can be added\"}\n"); + } + for (EdgeDescription ed : toEdges) { + logger.debug(ed.getRuleKey()+"Type="+ed.type); + String obj = ed.getRuleKey().replace(objectName,"").replace("|",""); + String selectedRelation = ""; + if(ed.type == LineageType.UNRELATED) { + String selectObj = getUnrelatedObjectPaths(obj, apiPath); + logger.debug("SelectedObj:"+selectObj); + selectedRelation = formatObjectRelationSet(obj,selectObj); + logger.trace("ObjectRelationSet"+selectedRelation); + } else { + String selectObj = getKinObjectPath(obj, apiPath); + logger.debug("SelectedObj:"+selectObj); + selectedRelation = formatObjectRelation(obj,selectObj); + logger.trace("ObjectRelationSet"+selectedRelation); + } + relations.add(selectedRelation); + logger.trace(selectedRelation); + } + } + + public void fromRelations() { + logger.debug("“comment”: “Valid FROM Relations that can be added”"); + Collection fromEdges = getEdgeRulesFROM(objectName); + if(fromEdges.size() > 0) { + relations.add("{\"comment\": \"Valid FROM Relations that can be added\"}\n"); + } + for (EdgeDescription ed : fromEdges) { + logger.debug(ed.getRuleKey()+"Type="+ed.type); + String obj = ed.getRuleKey().replace(objectName,"").replace("|",""); + String selectedRelation = ""; + if(ed.type == LineageType.UNRELATED) { + String selectObj = getUnrelatedObjectPaths(obj, apiPath); + logger.debug("SelectedObj"+selectObj); + selectedRelation = formatObjectRelationSet(obj,selectObj); + logger.trace("ObjectRelationSet"+selectedRelation); + } else { + String selectObj = getKinObjectPath(obj, apiPath); + logger.debug("SelectedObj"+selectObj); + selectedRelation = formatObjectRelation(obj,selectObj); + logger.trace("ObjectRelationSet"+selectedRelation); + } + relations.add(selectedRelation); + logger.trace(selectedRelation); + } + } + public void writeRelationsFile() { + File examplefilePath = new File(yaml_dir + "/relations/" + currentAPIVersion+"/"+opId.replace("RelationshipListRelationship", "") + ".json"); + + logger.debug(String.join("exampleFilePath: ", examplefilePath.toString())); + FileOutputStream fop = null; + try { + if (!examplefilePath.exists()) { + examplefilePath.getParentFile().mkdirs(); + examplefilePath.createNewFile(); + } + fop = new FileOutputStream(examplefilePath); + } catch(Exception e) { + e.printStackTrace(); + return; + } + try { + if(relations.size() > 0) {fop.write("[\n".getBytes());} + fop.write(String.join(",\n", relations).getBytes()); + if(relations.size() > 0) {fop.write("\n]\n".getBytes());} + fop.flush(); + fop.close(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + logger.debug(String.join(",\n", relations)); + return; + } + + private static String formatObjectRelationSet(String obj, String selectObj) { + StringBuffer pathSb = new StringBuffer(); + String[] paths = selectObj.split("[|]"); + for (String s: paths) { + logger.trace("SelectOBJ"+s); + pathSb.append(formatObjectRelation(obj, s)+",\n"); + } + pathSb.deleteCharAt(pathSb.length()-2); + return pathSb.toString(); + } + + private static String formatObjectRelation(String obj, String selectObj) { + StringBuffer pathSb = new StringBuffer(); + pathSb.append("{\n"); + pathSb.append("\"related-to\" : \""+obj+"\",\n"); + pathSb.append("\"related-link\" : \""+selectObj+"\"\n"); + pathSb.append("}"); + return pathSb.toString(); + } + + private static String getKinObjectPath(String obj, String apiPath) { + LevenshteinDistance proximity = new LevenshteinDistance(); + String targetPath = ""; + int targetScore = Integer.MAX_VALUE; + int targetMaxScore = 0; + for (Map.Entry p : deletePaths.entrySet()) { + if(p.getValue().equals(obj)) { + targetScore = (targetScore >= proximity.apply(apiPath, p.getKey())) ? proximity.apply(apiPath, p.getKey()) : targetScore; + targetPath = (targetScore >= proximity.apply(apiPath, p.getKey())) ? p.getKey() : targetPath; + targetMaxScore = (targetMaxScore <= proximity.apply(apiPath, p.getKey())) ? proximity.apply(apiPath, p.getKey()) : targetScore; + logger.trace(proximity.apply(apiPath, p.getKey())+":"+p.getKey()); + logger.trace(proximity.apply(apiPath, p.getKey())+":"+apiPath); + } + } + return targetPath; + } + + private static String getUnrelatedObjectPaths(String obj, String apiPath) { + String targetPath = ""; + logger.trace("Obj:"+obj +"\n" + apiPath); + for (Map.Entry p : deletePaths.entrySet()) { + if(p.getValue().equals(obj)) { + logger.trace("p.getvalue:"+p.getValue()+"p.getkey:"+p.getKey()); + targetPath += ((targetPath.length() == 0 ? "" : "|") + p.getKey()); + logger.trace("Match:"+apiPath +"\n" + targetPath); + } + } + return targetPath; + } + } + + private static class PatchOperation { + String useOpId; + String xmlRootElementName; + String tag; + String path; + String pathParams; + + public PatchOperation(String useOpId, String xmlRootElementName, String tag, String path, String pathParams) { + super(); + this.useOpId = useOpId; + this.xmlRootElementName = xmlRootElementName; + this.tag = tag; + this.path = path; + this.pathParams = pathParams; + } + + @Override + public String toString() { + StringBuffer pathSb = new StringBuffer(); + pathSb.append(" patch:\n"); + pathSb.append(" tags:\n"); + pathSb.append(" - " + tag + "\n"); + + pathSb.append(" summary: update an existing " + xmlRootElementName + "\n"); + pathSb.append(" description: update an existing " + xmlRootElementName + "\n"); + pathSb.append(" operationId: Update" + useOpId + "\n"); + pathSb.append(" consumes:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" produces:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" responses:\n"); + pathSb.append(" \"default\":\n"); + pathSb.append(" " + responsesUrl); + + pathSb.append(" parameters:\n"); + pathSb.append(pathParams); // for nesting + pathSb.append(" - name: body\n"); + pathSb.append(" in: body\n"); + pathSb.append(" description: " + xmlRootElementName + " object that needs to be created or updated\n"); + pathSb.append(" required: true\n"); + pathSb.append(" schema:\n"); + pathSb.append(" $ref: \"patchSchema.yaml#/definitions/" + xmlRootElementName + "\"\n"); + + return pathSb.toString(); + } + public String toString1() { + StringBuffer pathSb = new StringBuffer(); + StringBuffer relationshipExamplesSb = new StringBuffer(); + if ( path.endsWith("/relationship") ) { + pathSb.append(" " + path + ":\n" ); + } + pathSb.append(" patch:\n"); + pathSb.append(" tags:\n"); + pathSb.append(" - " + tag + "\n"); + + if ( path.endsWith("/relationship") ) { + pathSb.append(" summary: see node definition for valid relationships\n"); + relationshipExamplesSb.append("[See Examples](apidocs/relations/"+GenerateXsd.apiVersion+"/"+useOpId+".json)"); + } else { + pathSb.append(" summary: update an existing " + xmlRootElementName + "\n"); + pathSb.append(" description: |\n"); + pathSb.append(" Update an existing " + xmlRootElementName + "\n"); + pathSb.append(" #\n"); + pathSb.append(" Note: Endpoints that are not devoted to object relationships support both PUT and PATCH operations.\n"); + pathSb.append(" The PUT operation will entirely replace an existing object.\n"); + pathSb.append(" The PATCH operation sends a \"description of changes\" for an existing object. The entire set of changes must be applied. An error result means no change occurs.\n"); + pathSb.append(" #\n"); + pathSb.append(" Other differences between PUT and PATCH are:\n"); + pathSb.append(" #\n"); + pathSb.append(" - For PATCH, you can send any of the values shown in sample REQUEST body. There are no required values.\n"); + pathSb.append(" - For PATCH, resource-id which is a required REQUEST body element for PUT, must not be sent.\n"); + pathSb.append(" - PATCH cannot be used to update relationship elements; there are dedicated PUT operations for this.\n"); + } + pathSb.append(" operationId: Update" + useOpId + "\n"); + pathSb.append(" consumes:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" produces:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" responses:\n"); + pathSb.append(" \"default\":\n"); + pathSb.append(" " + responsesUrl); + pathSb.append(" parameters:\n"); + pathSb.append(pathParams); // for nesting + pathSb.append(" - name: body\n"); + pathSb.append(" in: body\n"); + pathSb.append(" description: " + xmlRootElementName + " object that needs to be created or updated. "+relationshipExamplesSb.toString()+"\n"); + pathSb.append(" required: true\n"); + pathSb.append(" schema:\n"); + pathSb.append(" $ref: \"#/patchDefinitions/" + xmlRootElementName + "\"\n"); + return pathSb.toString(); + } + } + private static class PutOperation { + String useOpId; + String xmlRootElementName; + String tag; + String path; + String pathParams; + + public PutOperation(String useOpId, String xmlRootElementName, String tag, String path, String pathParams) { + super(); + this.useOpId = useOpId; + this.xmlRootElementName = xmlRootElementName; + this.tag = tag; + this.path = path; + this.pathParams = pathParams; + } + + @Override + public String toString() { + StringBuffer pathSb = new StringBuffer(); + StringBuffer relationshipExamplesSb = new StringBuffer(); + if ( path.endsWith("/relationship") ) { + pathSb.append(" " + path + ":\n" ); + } + pathSb.append(" put:\n"); + pathSb.append(" tags:\n"); + pathSb.append(" - " + tag + "\n"); + + if ( path.endsWith("/relationship") ) { + pathSb.append(" summary: see node definition for valid relationships\n"); + } else { + pathSb.append(" summary: create or update an existing " + xmlRootElementName + "\n"); + pathSb.append(" description: |\n Create or update an existing " + xmlRootElementName + ".\n #\n Note! This PUT method has a corresponding PATCH method that can be used to update just a few of the fields of an existing object, rather than a full object replacement. An example can be found in the [PATCH section] below\n"); + } + relationshipExamplesSb.append("[Valid relationship examples shown here](apidocs/relations/"+GenerateXsd.apiVersion+"/"+useOpId.replace("RelationshipListRelationship", "")+".json)"); + pathSb.append(" operationId: createOrUpdate" + useOpId + "\n"); + pathSb.append(" consumes:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" produces:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" responses:\n"); + pathSb.append(" \"default\":\n"); + pathSb.append(" " + responsesUrl); + + pathSb.append(" parameters:\n"); + pathSb.append(pathParams); // for nesting + pathSb.append(" - name: body\n"); + pathSb.append(" in: body\n"); + pathSb.append(" description: " + xmlRootElementName + " object that needs to be created or updated. "+relationshipExamplesSb.toString()+"\n"); + pathSb.append(" required: true\n"); + pathSb.append(" schema:\n"); + pathSb.append(" $ref: \"#/definitions/" + xmlRootElementName + "\"\n"); + return pathSb.toString(); + } + public String tagRelationshipPathMapEntry() { + if ( path.endsWith("/relationship") ) { + putRelationPaths.put(useOpId, path); + } + return ""; + } + + } + + private static class GetOperation { + String useOpId; + String xmlRootElementName; + String tag; + String path; + @SuppressWarnings("unused") + String pathParams; + public GetOperation(String useOpId, String xmlRootElementName, String tag, String path, String pathParams) { + super(); + this.useOpId = useOpId; + this.xmlRootElementName = xmlRootElementName; + this.tag = tag; + this.path = path; + this.pathParams = pathParams; + } + @Override + public String toString() { + StringBuffer pathSb = new StringBuffer(); + pathSb.append(" " + path + ":\n" ); + pathSb.append(" get:\n"); + pathSb.append(" tags:\n"); + pathSb.append(" - " + tag + "\n"); + pathSb.append(" summary: returns " + xmlRootElementName + "\n"); + + pathSb.append(" description: returns " + xmlRootElementName + "\n"); + pathSb.append(" operationId: get" + useOpId + "\n"); + pathSb.append(" produces:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + + pathSb.append(" responses:\n"); + pathSb.append(" \"200\":\n"); + pathSb.append(" description: successful operation\n"); + pathSb.append(" schema:\n"); + pathSb.append(" $ref: \"#/getDefinitions/" + xmlRootElementName + "\"\n"); + pathSb.append(" \"default\":\n"); + pathSb.append(" " + responsesUrl); + + return pathSb.toString(); + } + + } + private static class DeleteOperation { + String useOpId; + String xmlRootElementName; + String tag; + String path; + String pathParams; + public DeleteOperation(String useOpId, String xmlRootElementName, String tag, String path, String pathParams) { + super(); + this.useOpId = useOpId; + this.xmlRootElementName = xmlRootElementName; + this.tag = tag; + this.path = path; + this.pathParams = pathParams; + } + @Override + public String toString() { + StringBuffer pathSb = new StringBuffer(); + pathSb.append(" delete:\n"); + pathSb.append(" tags:\n"); + pathSb.append(" - " + tag + "\n"); + pathSb.append(" summary: delete an existing " + xmlRootElementName + "\n"); + + pathSb.append(" description: delete an existing " + xmlRootElementName + "\n"); + + pathSb.append(" operationId: delete" + useOpId + "\n"); + pathSb.append(" consumes:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" produces:\n"); + pathSb.append(" - application/json\n"); + pathSb.append(" - application/xml\n"); + pathSb.append(" responses:\n"); + pathSb.append(" \"default\":\n"); + pathSb.append(" " + responsesUrl); + pathSb.append(" parameters:\n"); + + pathSb.append(pathParams); // for nesting + if ( !path.endsWith("/relationship") ) { + pathSb.append(" - name: resource-version\n"); + + pathSb.append(" in: query\n"); + pathSb.append(" description: resource-version for concurrency\n"); + pathSb.append(" required: true\n"); + pathSb.append(" type: string\n"); + } + return pathSb.toString(); + } + public String objectPathMapEntry() { + if (! path.endsWith("/relationship") ) { + deletePaths.put(path, xmlRootElementName); + } + return (xmlRootElementName+":"+path); + } + } private static boolean validVersion(String versionToGen) { @@ -247,57 +754,75 @@ public class GenerateXsd { } + String responsesLabel = System.getProperty("yamlresponses_url"); + responsesUrl = responsesLabel; + + List versionsToGen = new ArrayList<>(); if ( versionToGen == null ) { System.err.println("Version is required, ie v or ALL."); System.exit(1); } - - responsesUrl = System.getProperty("yamlresponses_url"); - String responsesLabel = System.getProperty("yamlresponses_label"); - List versionsToGen = new ArrayList<>(); - - - if (!"ALL".equalsIgnoreCase(versionToGen) && !versionToGen.matches("v\\d+") && !validVersion(versionToGen)) { + else if (!"ALL".equalsIgnoreCase(versionToGen) && !versionToGen.matches("v\\d+") && !validVersion(versionToGen)) { System.err.println("Invalid version passed. " + versionToGen); System.exit(1); } - - if ("ALL".equalsIgnoreCase(versionToGen)) { + else if ("ALL".equalsIgnoreCase(versionToGen)) { versionsToGen = Arrays.asList(Version.values()); Collections.sort(versionsToGen); Collections.reverse(versionsToGen); } else { versionsToGen.add(Version.valueOf(versionToGen)); } - - if ( fileTypeToGen.equals(generateTypeYAML) ) { + + //process file type System property + fileTypeToGen = (fileTypeToGen == null ? generateTypeXSD : fileTypeToGen.toLowerCase()); + if ( !fileTypeToGen.equals( generateTypeXSD ) && !fileTypeToGen.equals( generateTypeYAML )) { + System.err.println("Invalid gen_type passed. " + fileTypeToGen); + System.exit(1); + } else if ( fileTypeToGen.equals(generateTypeYAML) ) { if ( responsesUrl == null || responsesUrl.length() < 1 || responsesLabel == null || responsesLabel.length() < 1 ) { System.err.println("generating swagger yaml file requires yamlresponses_url and yamlresponses_label properties" ); System.exit(1); + } else { + responsesUrl = "description: "+ "Response codes found in [response codes]("+responsesLabel+ ").\n"; } - responsesUrl = "description: "+ responsesLabel+ "(" + responsesUrl + ").\n"; } - String oxmPath = root + "/oxm/"; - + String oxmPath; + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(normalStartDir)) { + oxmPath = autoGenRoot + "/oxm/"; + } + else { + oxmPath = root + "/oxm/"; + } + String outfileName; File outfile; String fileContent; for (Version v : versionsToGen) { apiVersion = v.toString(); - System.out.println("Generating " + apiVersion + " " + fileTypeToGen); + logger.info("Generating " + apiVersion + " " + fileTypeToGen); File oxm_file = new File(oxmPath + "aai_oxm_" + apiVersion + ".xml"); apiVersionFmt = "." + apiVersion + "."; generatedJavaType = new HashMap(); appliedPaths = new HashMap(); + putRelationPaths = new HashMap(); + deletePaths = new HashMap(); + if ( fileTypeToGen.equals(generateTypeXSD) ) { useAnnotationsInXsd = versionUsesAnnotations(apiVersion); outfileName = xsd_dir + "/aai_schema_" + apiVersion + "." + generateTypeXSD; - fileContent = processOxmFile(oxm_file, v); + fileContent = processOxmFile(oxm_file, v, null); } else if ( versionSupportsSwagger(apiVersion )) { - outfileName = yaml_dir + "/aai_swagger_" + apiVersion + "." + generateTypeYAML; - fileContent = generateSwaggerFromOxmFile( oxm_file); + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(normalStartDir)) { + outfileName = alt_yaml_dir; + } + else { + outfileName = yaml_dir; + } + outfileName = outfileName + "/aai_swagger_" + apiVersion + "." + generateTypeYAML; + fileContent = generateSwaggerFromOxmFile( oxm_file, null); } else { continue; } @@ -309,7 +834,7 @@ public class GenerateXsd { try { outfile.createNewFile(); } catch (IOException e) { - System.out.println( "Exception creating output file " + outfileName); + logger.error( "Exception creating output file " + outfileName); e.printStackTrace(); } BufferedWriter bw = null; @@ -319,14 +844,14 @@ public class GenerateXsd { bw = Files.newBufferedWriter(path, charset); bw.write(fileContent); } catch ( IOException e) { - System.out.println( "Exception writing output file " + outfileName); + logger.error( "Exception writing output file " + outfileName); e.printStackTrace(); } finally { if ( bw != null ) { bw.close(); } } - System.out.println( "GeneratedXSD successful, saved in " + outfileName); + logger.info( "GeneratedXSD successful, saved in " + outfileName); } } @@ -339,7 +864,7 @@ public class GenerateXsd { NodeList parentNodes = javaTypeElement.getElementsByTagName("java-attributes"); StringBuffer sb = new StringBuffer(); if ( parentNodes.getLength() == 0 ) { - //System.out.println( "no java-attributes for java-type " + javaTypeName); + logger.trace( "no java-attributes for java-type " + javaTypeName); return ""; } @@ -354,17 +879,10 @@ public class GenerateXsd { String attrName = attr.getNodeName(); String attrValue = attr.getNodeValue(); - //System.out.println("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); + logger.trace("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); if ( attrName.equals("name")) xmlRootElementName = attrValue; } - /* - if ( javaTypeName.equals("RelationshipList")) { - System.out.println( "Skipping " + javaTypeName); - generatedJavaType.put(javaTypeName, null); - return ""; - } - */ Element parentElement = (Element)parentNodes.item(0); NodeList xmlElementNodes = parentElement.getElementsByTagName("xml-element"); @@ -381,14 +899,14 @@ public class GenerateXsd { sb1.append(" \n"); NodeList properties = GenerateXsd.locateXmlProperties(javaTypeElement); if (properties != null && useAnnotationsInXsd) { - //System.out.println("properties found for: " + xmlRootElementName); + logger.trace("properties found for: " + xmlRootElementName); sb1.append(" \r\n"); insertAnnotation(properties, false, "class", sb1, " "); sb1.append(" \r\n"); - } /*else { - System.out.println("no properties found for: " + xmlRootElementName); - }*/ + } else { + logger.trace("no properties found for: " + xmlRootElementName); + } sb1.append(" \n"); for ( int i = 0; i < xmlElementNodes.getLength(); ++i ) { @@ -406,7 +924,7 @@ public class GenerateXsd { String attrValue = attr.getNodeValue(); if ( attrName.equals("name")) { xmlElementWrapper = attrValue; - //System.out.println("found xml-element-wrapper " + xmlElementWrapper); + logger.trace("found xml-element-wrapper " + xmlElementWrapper); } } @@ -421,7 +939,7 @@ public class GenerateXsd { String attrName = attr.getNodeName(); String attrValue = attr.getNodeValue(); - //System.out.println("For " + xmlRootElementName + " Found xml-element attribute: " + attrName + " with value: " + attrValue); + logger.trace("For " + xmlRootElementName + " Found xml-element attribute: " + attrName + " with value: " + attrValue); if ( attrName.equals("name")) { elementName = attrValue; } @@ -460,33 +978,29 @@ public class GenerateXsd { sb1.append(" \r\n"); insertAnnotation(properties, false, "class", sb1, " "); sb1.append(" \r\n"); - } /*else { - System.out.println("no properties found for: " + xmlElementWrapper); - }*/ + } else { + logger.trace("no properties found for: " + xmlElementWrapper); + } sb1.append(" \n"); sb1.append(" "); } if ("Nodes".equals(addType)) { - //System.out.println ("Skipping nodes, temporary testing"); + logger.trace("Skipping nodes, temporary testing"); continue; } if ( addType != null ) { - //sb1.append(" \n"); } } - /* - if ( xmlRootElementName.equals("notify") || - xmlRootElementName.equals("relationship") || - xmlRootElementName.equals("relationship-data") || - xmlRootElementName.equals("related-to-property") ) - - sb1.append(" \n"); - */ sb1.append(" \n"); sb1.append(" \n"); sb1.append(" \n"); } - /* - NodeList valNodes = javaTypeElement.getElementsByTagName("xml-root-element"); - Element valElement = (Element) valNodes.item(0); - attributes = valElement.getAttributes(); - for ( int i = 0; i < attributes.getLength(); ++i ) { - Attr attr = (Attr) attributes.item(i); - String attrName = attr.getNodeName(); - - String attrValue = attr.getNodeValue(); - System.out.println("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); - if ( attrValue.equals("name")) - xmlRootElementName = attrValue; - } - */ if ( xmlElementNodes.getLength() < 1 ) { sb.append(" \n"); @@ -549,9 +1041,7 @@ public class GenerateXsd { generatedJavaType.put(javaTypeName, null); return sb.toString(); } - sb.append( sb1 ); - return sb.toString(); } @@ -576,8 +1066,6 @@ public class GenerateXsd { name = "extendsFrom"; } metadata.add(name + "=\"" + value.replaceAll("&", "&") + "\""); - //System.out.println("property name: " + name); - } } sb1.append( @@ -605,7 +1093,7 @@ public class GenerateXsd { return javaTypeElement; } } - System.out.println( "oxm file format error, missing java-type " + javaTypeName); + logger.error( "oxm file format error, missing java-type " + javaTypeName); return (Element) null; } @@ -626,7 +1114,7 @@ public class GenerateXsd { return javaTypeElement; } } - System.out.println( "oxm file format error, missing java-type " + javaTypeName); + logger.error( "oxm file format error, missing java-type " + javaTypeName); return (Element) null; } private static String getXmlRootElementName( String javaTypeName ) @@ -651,21 +1139,28 @@ public class GenerateXsd { attrName = attr.getNodeName(); attrValue = attr.getNodeValue(); - //System.out.println("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); if ( attrName.equals("name")) return (attrValue); } } } } - System.out.println( "oxm file format error, missing java-type " + javaTypeName); + logger.error( "oxm file format error, missing java-type " + javaTypeName); return null; } - public static String processOxmFile( File oxmFile, Version v ) + public static String processOxmFile( File oxmFile, Version v, String xml ) { + if ( xml != null ){ + apiVersion = v.toString(); + useAnnotationsInXsd = true; + apiVersionFmt = "." + apiVersion + "."; + generatedJavaType = new HashMap<>(); + appliedPaths = new HashMap<>(); + } StringBuilder sb = new StringBuilder(); + logger.trace("processing starts"); sb.append("\n"); String namespace = "org.onap"; if (v.compareTo(Version.v11) < 0 || v.compareTo(Version.v12) < 0) { @@ -680,7 +1175,8 @@ public class GenerateXsd { " xmlns:annox=\"http://annox.dev.java.net\" \r\n" + " jaxb:extensionBindingPrefixes=\"annox\">\n\n"); } else { - sb.append("\n\n"); } @@ -689,8 +1185,14 @@ public class GenerateXsd { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(oxmFile); - + Document doc; + + if ( xml == null ){ + doc = dBuilder.parse(oxmFile); + } else { + InputSource is = new InputSource(new StringReader(xml)); + doc = dBuilder.parse(is); + } NodeList bindingsNodes = doc.getElementsByTagName("xml-bindings"); Element bindingElement; NodeList javaTypesNodes; @@ -700,20 +1202,20 @@ public class GenerateXsd { if ( bindingsNodes == null || bindingsNodes.getLength() == 0 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } bindingElement = (Element) bindingsNodes.item(0); javaTypesNodes = bindingElement.getElementsByTagName("java-types"); if ( javaTypesNodes.getLength() < 1 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } javaTypesElement = (Element) javaTypesNodes.item(0); javaTypeNodes = javaTypesElement.getElementsByTagName("java-type"); if ( javaTypeNodes.getLength() < 1 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } @@ -732,11 +1234,11 @@ public class GenerateXsd { javaTypeName = attrValue; } if ( javaTypeName == null ) { - System.out.println( " has no name attribute in " + oxmFile ); + logger.error( " has no name attribute in " + oxmFile ); return null; } if ("Nodes".equals(javaTypeName)) { - //System.out.println("skipping Nodes entry (temporary feature)"); + logger.debug("skipping Nodes entry (temporary feature)"); continue; } if ( !generatedJavaType.containsKey(javaTypeName) ) { @@ -752,6 +1254,66 @@ public class GenerateXsd { sb.append("\n"); return sb.toString(); } + + public static String toDeleteRules(String objectName) { + Collection toEdges = GenerateXsd.getEdgeRulesTO(objectName); + logger.debug("TO Edges count: "+toEdges.size()+" Object: "+objectName); + String prevent=null; + String also=null; + LinkedHashSet preventDelete = new LinkedHashSet(); + LinkedHashSet alsoDelete = new LinkedHashSet(); + for (EdgeDescription ed : toEdges) { + logger.debug("{“comment”: From = "+ed.getFrom()+" To: "+ed.getTo()+" Object: "+objectName); + logger.debug("{“comment”: Direction = "+ed.getDirection()+" PreventDelete: "+ed.getPreventDelete()+" DeleteOtherV: "+ed.getDeleteOtherV()+" Object: "+objectName); + if(ed.getPreventDelete().equals("IN") && ed.getTo().equals(objectName)) { + preventDelete.add(ed.getFrom().toUpperCase()); + } + if(ed.getDeleteOtherV().equals("IN") && ed.getTo().equals(objectName) ) { + alsoDelete.add(ed.getFrom().toUpperCase()); + } + } + if(preventDelete.size() > 0) { + prevent = " - "+objectName.toUpperCase()+" cannot be deleted if linked to "+String.join(",",preventDelete); + logger.info(prevent); + } + if(alsoDelete.size() > 0) { + also = " - "+objectName.toUpperCase()+" is DELETED when these are DELETED "+String.join(",",alsoDelete); + // This commented out line is better (gets who deletes what correct) but still not accurate. + //also = " - Deletion of an instance of "+objectName.toUpperCase()+" causes instances of these directly related types to be DELETED ["+String.join(",",alsoDelete)+"]"; + logger.info(also); + } + return String.join((prevent == null || also == null) ? "" : "\n", prevent == null ? "" : prevent, also == null ? "" : also)+((prevent == null && also == null) ? "" : "\n"); + } + + public static String fromDeleteRules(String objectName) { + Collection fromEdges = GenerateXsd.getEdgeRulesFROM(objectName); + LinkedHashSet preventDelete = new LinkedHashSet (); + LinkedHashSet alsoDelete = new LinkedHashSet (); + String prevent=null; + String also=null; + for (EdgeDescription ed : fromEdges) { + logger.debug("{“comment”: From = "+ed.getFrom()+" To: "+ed.getTo()+" Object: "+objectName); + logger.debug("{“comment”: Direction = "+ed.getDirection()+" PreventDelete: "+ed.getPreventDelete()+" DeleteOtherV: "+ed.getDeleteOtherV()+" Object: "+objectName); + if(ed.getPreventDelete().equals("OUT") && ed.getFrom().equals(objectName)) { + preventDelete.add(ed.getTo().toUpperCase()); + } + if(ed.getDeleteOtherV().equals("OUT") && ed.getFrom().equals(objectName) ) { + alsoDelete.add(ed.getTo().toUpperCase()); + } + } + if(preventDelete.size() > 0) { + prevent = " - "+objectName.toUpperCase()+" cannot be deleted if linked to "+String.join(",",preventDelete); + logger.info(prevent); + } + if(alsoDelete.size() > 0) { + also = " - "+objectName.toUpperCase()+" deletion means associated objects of these types are also DELETED:"+String.join(",",alsoDelete); + // This commented out line is better (gets who deletes what correct) but still not accurate. + //also = " - Deletion of an instance of "+objectName.toUpperCase()+" causes instances of these directly related types to be DELETED ["+String.join(",",alsoDelete)+"]"; + logger.info(also); + } + return String.join((prevent == null || also == null) ? "" : "\n", prevent == null ? "" : prevent, also == null ? "" : also)+((prevent == null && also == null) ? "" : "\n"); + } + private static boolean isStandardType( String elementType ) { @@ -778,7 +1340,7 @@ public class GenerateXsd { } return result; } - + /** * Guaranteed to at least return non null but empty collection of edge descriptions * @param nodeName name of the vertex whose edge relationships to return @@ -799,11 +1361,13 @@ public class GenerateXsd { Map edgeMap; String fromNode; String toNode; - String ruleKey; String direction; String multiplicity; String isParent; String hasDelTarget; + String deleteOtherV; + String preventDelete; + String description; EdgeDescription edgeDes; while( edgeRulesIterator.hasNext() ){ @@ -817,6 +1381,9 @@ public class GenerateXsd { } edgeDes = x.new EdgeDescription(); edgeDes.setRuleKey(fromNode + "|" + toNode); + edgeDes.setLabel((String)edgeMap.get("label")); + edgeDes.setTo((String)edgeMap.get("to")); + edgeDes.setFrom((String)edgeMap.get("from")); direction = (String)edgeMap.get("direction"); edgeDes.setDirection(direction); multiplicity = (String)edgeMap.get("multiplicity"); @@ -828,9 +1395,16 @@ public class GenerateXsd { edgeDes.setType(LineageType.UNRELATED); } hasDelTarget = (String)edgeMap.get(EdgeProperty.DELETE_OTHER_V.toString()); + deleteOtherV = (String)edgeMap.get(EdgeProperty.DELETE_OTHER_V.toString()); + edgeDes.setDeleteOtherV(deleteOtherV); edgeDes.setHasDelTarget(hasDelTarget); - result.add(edgeDes); + preventDelete = (String)edgeMap.get(EdgeProperty.PREVENT_DELETE.toString()); + edgeDes.setPreventDelete(preventDelete); + description = (String)edgeMap.get(EdgeProperty.DESCRIPTION.toString()); + edgeDes.setDescription(description); + result.add(edgeDes); + logger.debug("Edge: "+edgeDes.getRuleKey()); } } catch (Exception ex) { ex.printStackTrace(); @@ -854,13 +1428,26 @@ public class GenerateXsd { return edges; } + private static Collection getEdgeRulesTO( String nodeName ) + { + String toRulesPath = "$['rules'][?(@['to']=='" + nodeName + "')]"; + Collection edges = getEdgeRulesFromJson( toRulesPath, true ); + return edges; + } + + private static Collection getEdgeRulesFROM( String nodeName ) + { + String fromRulesPath = "$['rules'][?(@['from']=='" + nodeName + "')]"; + Collection edges = getEdgeRulesFromJson( fromRulesPath, true ); + return edges; + } public static String processJavaTypeElementSwagger( String javaTypeName, Element javaTypeElement, StringBuffer pathSb, StringBuffer definitionsSb, String path, String tag, String opId, String getItemName, StringBuffer pathParams, String queryParams, String validEdges) { String xmlRootElementName = null; - - //Map addJavaType = new HashMap(); + StringBuilder definitionsLocalSb = new StringBuilder(256); + String useTag = null; String useOpId = null; @@ -871,38 +1458,11 @@ public class GenerateXsd { case "Business": case "LicenseManagement": case "CloudInfrastructure": - case "ExternalSystem": break; default: return null; } } - /* - if ( path == null ) - System.out.println( "processJavaTypeElementSwagger called with null path for javaTypeName " + javaTypeName); - */ - /* - if ( path == null || !(path.contains("cloud-infrastructure"))) - switch ( javaTypeName) { - case "Inventory": - useTag = null; - break; - - case "CloudInfrastructure": - case "Search": - case "Actions": - case "ServiceDesignAndCreation": - case "LicenseManagement": - case "Network": - if ( tag == null ) - useTag = javaTypeName; - - break; - default: - return null; - - } - */ if ( !javaTypeName.equals("Inventory") ) { if ( javaTypeName.equals("AaiInternal")) @@ -915,20 +1475,11 @@ public class GenerateXsd { useTag = javaTypeName; } - /* - if ( javaTypeName.equals("GenericVnf")) - System.out.println( "Processing " + javaTypeName); - else if ( javaTypeName.equals("Service")) - System.out.println( "Processing " + javaTypeName); - else if ( javaTypeName.equals("SitePair")) - System.out.println( "Processing " + javaTypeName); - */ NodeList parentNodes = javaTypeElement.getElementsByTagName("java-attributes"); if ( parentNodes.getLength() == 0 ) { - //System.out.println( "no java-attributes for java-type " + javaTypeName); + logger.trace( "no java-attributes for java-type " + javaTypeName); return ""; - } NamedNodeMap attributes; @@ -941,20 +1492,11 @@ public class GenerateXsd { String attrName = attr.getNodeName(); String attrValue = attr.getNodeValue(); - //System.out.println("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); + logger.trace("Found xml-root-element attribute: " + attrName + " with value: " + attrValue); if ( attrName.equals("name")) xmlRootElementName = attrValue; } - /* - if ( xmlRootElementName.equals("oam-networks")) - System.out.println( "xmlRootElement oam-networks with getItemData [" + getItemName + "]"); - */ - //already processed - /* - if ( generatedJavaType.containsKey(xmlRootElementName) ) { - return null; - } - */ + NodeList childNodes; Element childElement; NodeList xmlPropNodes = javaTypeElement.getElementsByTagName("xml-properties"); @@ -964,10 +1506,6 @@ public class GenerateXsd { Vector indexedProps = null; - /*System.out.println( "javaTypeName " + javaTypeName + " has xml-properties length " + xmlPropNodes.getLength()); - if ( path != null && path.equals("/network/generic-vnfs")) - System.out.println("path is " + "/network/generic-vnfs with getItemName " + getItemName); - */ if ( xmlPropNodes.getLength() > 0 ) { for ( int i = 0; i < xmlPropNodes.getLength(); ++i ) { @@ -993,8 +1531,6 @@ public class GenerateXsd { } if ( useValue == VALUE_DESCRIPTION && attrName.equals("value")) { pathDescriptionProperty = attrValue; - //break; - //System.out.println("found xml-element-wrapper " + xmlElementWrapper); } if ( attrValue.equals("indexedProps")) { useValue = VALUE_INDEXED_PROPS; @@ -1007,15 +1543,7 @@ public class GenerateXsd { } } } - //System.out.println("javaTypeName " + javaTypeName + " description " + pathDescriptionProperty); - - /* - if ( javaTypeName.equals("RelationshipList")) { - System.out.println( "Skipping " + javaTypeName); - generatedJavaType.put(javaTypeName, null); - return ""; - } - */ + logger.trace("javaTypeName " + javaTypeName + " description " + pathDescriptionProperty); Element parentElement = (Element)parentNodes.item(0); NodeList xmlElementNodes = parentElement.getElementsByTagName("xml-element"); @@ -1040,24 +1568,16 @@ public class GenerateXsd { if ( xmlRootElementName.equals("inventory")) path = ""; else if ( path == null ) - //path = "/aai/" + apiVersion; path = "/" + xmlRootElementName; else path += "/" + xmlRootElementName; st = new StringTokenizer(path, "/"); - /* - if ( path.equals("/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription")) - System.out.println("processing path /business/customers/customer/{global-customer-id}/service-subscriptions with tag " + tag); - */ boolean genPath = false; - /* - if ( path != null && path.equals("/network/generic-vnfs/generic-vnf")) - System.out.println("path is " + "/network/generic-vnfs/generic-vnf"); - */ + if ( st.countTokens() > 1 && getItemName == null ) { if ( appliedPaths.containsKey(path)) return null; - appliedPaths.put(path, null); + appliedPaths.put(path, xmlRootElementName); genPath = true; if ( path.contains("/relationship/") ) { // filter paths with relationship-list genPath = false; @@ -1075,23 +1595,7 @@ public class GenerateXsd { xmlElementElement = (Element)xmlElementNodes.item(i); if ( !xmlElementElement.getParentNode().isSameNode(parentElement)) continue; - /*childNodes = xmlElementElement.getElementsByTagName("xml-element-wrapper"); - if ( childNodes.getLength() > 0 ) { - childElement = (Element)childNodes.item(0); - // get name - attributes = childElement.getAttributes(); - for ( int k = 0; k < attributes.getLength(); ++k ) { - Attr attr = (Attr) attributes.item(k); - String attrName = attr.getNodeName(); - String attrValue = attr.getNodeValue(); - if ( attrName.equals("name")) { - xmlElementWrapper = attrValue; - //System.out.println("found xml-element-wrapper " + xmlElementWrapper); - } - } - } - */ valNodes = xmlElementElement.getElementsByTagName("xml-properties"); attrDescription = null; if ( valNodes.getLength() > 0 ) { @@ -1115,7 +1619,6 @@ public class GenerateXsd { } if ( useValue && attrName.equals("value")) { attrDescription = attrValue; - //System.out.println("found xml-element-wrapper " + xmlElementWrapper); } } @@ -1133,7 +1636,7 @@ public class GenerateXsd { String attrName = attr.getNodeName(); String attrValue = attr.getNodeValue(); - //System.out.println("For " + xmlRootElementName + " Found xml-element attribute: " + attrName + " with value: " + attrValue); + logger.trace("For " + xmlRootElementName + " Found xml-element attribute: " + attrName + " with value: " + attrValue); if ( attrName.equals("name")) { elementName = attrValue; @@ -1162,18 +1665,18 @@ public class GenerateXsd { if ( getItemName != null ) { if ( getItemName.equals("array") ) { if ( elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) { - //System.out.println( " returning array " + elementName ); + logger.trace( " returning array " + elementName ); return elementName; } } else { // not an array check if ( elementContainerType == null || !elementContainerType.equals("java.util.ArrayList")) { - //System.out.println( " returning object " + elementName ); + logger.trace( " returning object " + elementName ); return elementName; } } - //System.out.println( " returning null" ); + logger.trace( " returning null" ); return null; } if ( elementIsRequired != null ) { @@ -1190,7 +1693,7 @@ public class GenerateXsd { } if ( elementIsKey != null ) { - sbParameters.append((" - name: " + elementName + "\n")); + sbParameters.append((" - name: " + elementName + "\n")); sbParameters.append((" in: path\n")); if ( attrDescription != null && attrDescription.length() > 0 ) sbParameters.append((" description: " + attrDescription + "\n")); @@ -1205,10 +1708,12 @@ public class GenerateXsd { sbParameters.append(" type: integer\n"); sbParameters.append(" format: int32\n"); } - if ( elementType.equals("java.lang.Boolean")) + if ( elementType.equals("java.lang.Boolean")) { sbParameters.append(" type: boolean\n"); - - + } + if(StringUtils.isNotBlank(elementName)) { + sbParameters.append(" example: "+"__"+elementName.toUpperCase()+"__"+"\n"); + } } else if ( indexedProps != null && indexedProps.contains(elementName ) ) { sbIndexedParams.append((" - name: " + elementName + "\n")); @@ -1229,12 +1734,6 @@ public class GenerateXsd { if ( elementType.equals("java.lang.Boolean")) sbIndexedParams.append(" type: boolean\n"); } - - /* - if ( elementName != null && elementName.equals("inventory-item")) - System.out.println( "processing inventory-item elementName"); - */ - if ( isStandardType(elementType)) { sbProperties.append(" " + elementName + ":\n"); ++propertyCnt; @@ -1256,8 +1755,6 @@ public class GenerateXsd { sbProperties.append(" description: " + attrDescription + "\n"); } - //if ( addType != null && elementContainerType != null && elementContainerType.equals("java.util.ArrayList") ) { - if ( addTypeV != null ) { StringBuffer newPathParams = null; if ( pathParams != null ) { @@ -1293,21 +1790,17 @@ public class GenerateXsd { if ( itemName != null ) { if ( addType.equals("AaiInternal") ) { - //System.out.println( "addType AaiInternal, skip properties"); + logger.debug( "addType AaiInternal, skip properties"); } else if ( getItemName == null) { ++propertyCnt; sbProperties.append(" " + getXmlRootElementName(addType) + ":\n"); sbProperties.append(" type: array\n items:\n"); - sbProperties.append(" $ref: \"#/definitions/" + itemName + "\"\n"); + sbProperties.append(" $ref: \"#/definitions/" + (itemName == "" ? "aai-internal" : itemName) + "\"\n"); if ( attrDescription != null && attrDescription.length() > 0 ) sbProperties.append(" description: " + attrDescription + "\n"); } } else { - /*itemName = processJavaTypeElementSwagger( addType, getJavaTypeElementSwagger(addType), - pathSb, definitionsSb, path, tag == null ? useTag : tag, useOpId, "other" ); - if ( itemName != null ) { - */ if ( elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) { // need properties for getXmlRootElementName(addType) newPathParams = null; @@ -1343,55 +1836,16 @@ public class GenerateXsd { if ( attrDescription != null && attrDescription.length() > 0 ) sbProperties.append(" description: " + attrDescription + "\n"); ++propertyCnt; - /*} - else { - System.out.println(" unable to define swagger object for " + addType); - } - */ } - //if ( getItemName == null) looking for missing properties - //generatedJavaType.put(addType, null); } } } } if ( genPath ) { - /* - if ( useOpId.equals("CloudInfrastructureComplexesComplexCtagPools")) - System.out.println( "adding path CloudInfrastructureComplexesComplexCtagPools"); - */ - if ( !path.endsWith("/relationship") ) { - pathSb.append(" " + path + ":\n" ); - pathSb.append(" get:\n"); - pathSb.append(" tags:\n"); - pathSb.append(" - " + tag + "\n"); - pathSb.append(" summary: returns " + xmlRootElementName + "\n"); - - pathSb.append(" description: returns " + xmlRootElementName + "\n"); - pathSb.append(" operationId: get" + useOpId + "\n"); - pathSb.append(" produces:\n"); - pathSb.append(" - application/json\n"); - pathSb.append(" - application/xml\n"); - - pathSb.append(" responses:\n"); - pathSb.append(" \"200\":\n"); - pathSb.append(" description: successful operation\n"); - pathSb.append(" schema:\n"); - pathSb.append(" $ref: \"#/definitions/" + xmlRootElementName + "\"\n"); - pathSb.append(" \"default\":\n"); - pathSb.append(" " + responsesUrl); - /* - pathSb.append(" \"200\":\n"); - pathSb.append(" description: successful operation\n"); - pathSb.append(" schema:\n"); - pathSb.append(" $ref: \"#/definitions/" + xmlRootElementName + "\"\n"); - pathSb.append(" \"404\":\n"); - pathSb.append(" description: resource was not found\n"); - pathSb.append(" \"400\":\n"); - pathSb.append(" description: bad request\n"); - */ - if ( path.indexOf('{') > 0 ) { + GetOperation get = new GetOperation(useOpId, xmlRootElementName, tag, path, pathParams == null ? "" : pathParams.toString()); + pathSb.append(get.toString()); +// if ( path.indexOf('{') > 0 ) { if ( sbParameters.toString().length() > 0 ) { if ( pathParams == null ) @@ -1402,7 +1856,7 @@ public class GenerateXsd { pathSb.append(" parameters:\n"); pathSb.append(pathParams); } else - System.out.println( "null pathParams for " + useOpId); + logger.trace( "null pathParams for " + useOpId); if ( sbIndexedParams.toString().length() > 0 ) { if ( queryParams == null ) queryParams = sbIndexedParams.toString(); @@ -1415,7 +1869,7 @@ public class GenerateXsd { } pathSb.append(queryParams); } - } +// } } boolean skipPutDelete = false; // no put or delete for "all" if ( !path.endsWith("/relationship") ) { @@ -1426,103 +1880,18 @@ public class GenerateXsd { } if ( path.indexOf('{') > 0 && !opId.startsWith("Search") &&!skipPutDelete) { // add PUT - if ( path.endsWith("/relationship") ) { - pathSb.append(" " + path + ":\n" ); - } - pathSb.append(" put:\n"); - pathSb.append(" tags:\n"); - pathSb.append(" - " + tag + "\n"); - - if ( path.endsWith("/relationship") ) { - pathSb.append(" summary: see node definition for valid relationships\n"); - } else { - pathSb.append(" summary: create or update an existing " + xmlRootElementName + "\n"); - pathSb.append(" description: create or update an existing " + xmlRootElementName + "\n"); - } - pathSb.append(" operationId: createOrUpdate" + useOpId + "\n"); - pathSb.append(" consumes:\n"); - pathSb.append(" - application/json\n"); - pathSb.append(" - application/xml\n"); - pathSb.append(" produces:\n"); - pathSb.append(" - application/json\n"); - pathSb.append(" - application/xml\n"); - pathSb.append(" responses:\n"); - pathSb.append(" \"default\":\n"); - pathSb.append(" " + responsesUrl); - /* - pathSb.append(" responses:\n"); - pathSb.append(" \"200\":\n"); - pathSb.append(" description: existing resource has been modified and there is a response buffer\n"); - pathSb.append(" \"201\":\n"); - pathSb.append(" description: new resource is created\n"); - pathSb.append(" \"202\":\n"); - pathSb.append(" description: action requested but may have taken other actions as well, which are returned in the response payload\n"); - pathSb.append(" \"204\":\n"); - pathSb.append(" description: existing resource has been modified and there is no response buffer\n"); - pathSb.append(" \"400\":\n"); - pathSb.append(" description: Bad Request will be returned if headers are missing\n"); - pathSb.append(" \"404\":\n"); - pathSb.append(" description: Not Found will be returned if an unknown URL is used\n"); - */ - pathSb.append(" parameters:\n"); - //pathSb.append(" - in: path\n"); - pathSb.append(pathParams); // for nesting - pathSb.append(" - name: body\n"); - pathSb.append(" in: body\n"); - pathSb.append(" description: " + xmlRootElementName + " object that needs to be created or updated\n"); - pathSb.append(" required: true\n"); - pathSb.append(" schema:\n"); - pathSb.append(" $ref: \"#/definitions/" + xmlRootElementName + "\"\n"); - /* - if ( queryParams != null ) { - pathSb.append(queryParams); - } - */ - // add DELETE - pathSb.append(" delete:\n"); - pathSb.append(" tags:\n"); - pathSb.append(" - " + tag + "\n"); - pathSb.append(" summary: delete an existing " + xmlRootElementName + "\n"); - - pathSb.append(" description: delete an existing " + xmlRootElementName + "\n"); - - pathSb.append(" operationId: delete" + useOpId + "\n"); - pathSb.append(" consumes:\n"); - pathSb.append(" - application/json\n"); - pathSb.append(" - application/xml\n"); - pathSb.append(" produces:\n"); - pathSb.append(" - application/json\n"); - pathSb.append(" - application/xml\n"); - pathSb.append(" responses:\n"); - pathSb.append(" \"default\":\n"); - pathSb.append(" " + responsesUrl); - /* - pathSb.append(" responses:\n"); - pathSb.append(" \"200\":\n"); - pathSb.append(" description: successful, the response includes an entity describing the status\n"); - pathSb.append(" \"204\":\n"); - pathSb.append(" description: successful, action has been enacted but the response does not include an entity\n"); - pathSb.append(" \"400\":\n"); - pathSb.append(" description: Bad Request will be returned if headers are missing\n"); - pathSb.append(" \"404\":\n"); - pathSb.append(" description: Not Found will be returned if an unknown URL is used\n"); - */ - pathSb.append(" parameters:\n"); - //pathSb.append(" - in: path\n"); - pathSb.append(pathParams); // for nesting + PutOperation put = new PutOperation(useOpId, xmlRootElementName, tag, path, pathParams == null ? "" : pathParams.toString()); + pathSb.append(put.toString()); if ( !path.endsWith("/relationship") ) { - pathSb.append(" - name: resource-version\n"); - - pathSb.append(" in: query\n"); - pathSb.append(" description: resource-version for concurrency\n"); - pathSb.append(" required: true\n"); - pathSb.append(" type: string\n"); + PatchOperation patch = new PatchOperation(useOpId, xmlRootElementName, tag, path, pathParams == null ? "" : pathParams.toString()); + pathSb.append(patch.toString1()); } - /* - if ( queryParams != null ) { - pathSb.append(queryParams); - } - */ + logger.debug(put.tagRelationshipPathMapEntry()); + + // add DELETE + DeleteOperation del = new DeleteOperation(useOpId, xmlRootElementName, tag, path, pathParams == null ? "" : pathParams.toString()); + pathSb.append(del.toString()); + logger.debug(del.objectPathMapEntry()); } } @@ -1531,11 +1900,13 @@ public class GenerateXsd { } definitionsSb.append(" " + xmlRootElementName + ":\n"); + definitionsLocalSb.append(" " + xmlRootElementName + ":\n"); Collection edges = getEdgeRules(xmlRootElementName ); + if ( edges.size() > 0 ) { StringBuffer sbEdge = new StringBuffer(); sbEdge.append(" ###### Related Nodes\n"); - for (EdgeDescription ed : edges) { + for (EdgeDescription ed : edges) { if ( ed.getRuleKey().startsWith(xmlRootElementName)) { sbEdge.append(" - TO ").append(ed.getRuleKey().substring(ed.getRuleKey().indexOf("|")+1)); sbEdge.append(ed.getRelationshipDescription("TO", xmlRootElementName)); @@ -1549,51 +1920,94 @@ public class GenerateXsd { sbEdge.append("\n"); } } + // Delete rule processing is incorrect. One cannot express the delete rules in isolation from the + // specific edge. Take the case of allotted-resource and service-instance. When the service-instance owns the + // allotted-resource, yes, it deletes it. But when the service-instance only uses the allotted-resource, the deletion + // of the service instance does not cause the deletion of the allotted-resource. + // I put some lines into the toDeleteRules and fromDeleteRules to correct things to an extent, but it's still + // not right. + sbEdge.append(toDeleteRules(xmlRootElementName)); + sbEdge.append(fromDeleteRules(xmlRootElementName)); validEdges = sbEdge.toString(); } // Handle description property. Might have a description OR valid edges OR both OR neither. // Only put a description: tag if there is at least one. if (pathDescriptionProperty != null || validEdges != null) { - definitionsSb.append(" description: |\n"); + definitionsSb.append(" description: |\n"); + definitionsLocalSb.append(" description: |\n"); - if ( pathDescriptionProperty != null ) + if ( pathDescriptionProperty != null ) { definitionsSb.append(" " + pathDescriptionProperty + "\n" ); - if (validEdges != null) + definitionsLocalSb.append(" " + pathDescriptionProperty + "\n" ); + } + if (validEdges != null) { definitionsSb.append(validEdges); + definitionsLocalSb.append(validEdges); + } } - if ( requiredCnt > 0 ) + if ( requiredCnt > 0 ) { definitionsSb.append(sbRequired); + definitionsLocalSb.append(sbRequired); + } + if ( propertyCnt > 0 ) { definitionsSb.append(" properties:\n"); definitionsSb.append(sbProperties); + definitionsLocalSb.append(" properties:\n"); + definitionsLocalSb.append(sbProperties); + } + try { + javaTypeDefinitions.put(xmlRootElementName, definitionsLocalSb.toString()); + } catch (Exception e) { + e.printStackTrace(); } generatedJavaType.put(xmlRootElementName, null); return null; } - public static String generateSwaggerFromOxmFile( File oxmFile ) - { + public static void generateRelations() { + if(putRelationPaths == null) + return; + putRelationPaths.forEach((k,v)->{ + logger.trace("k="+k+"\n"+"v="+v+v.equals("/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources/allotted-resource/{id}/relationship-list/relationship")); + logger.debug("apiPath(Operation): "+v); + logger.debug("Target object: "+v.replace("/relationship-list/relationship", "")); + logger.debug("Relations: "); + PutRelationPathSet prp = new PutRelationPathSet(k, v); + prp.process(); + }); + } + public static String generateSwaggerFromOxmFile( File oxmFile, String xml ) + { + if ( xml != null ){ + apiVersion = Version.getLatest().toString(); + apiVersionFmt = "." + apiVersion + "."; + generatedJavaType = new HashMap<>(); + appliedPaths = new HashMap<>(); + responsesUrl = "Description: response-label\n"; + } StringBuffer sb = new StringBuffer(); - sb.append("swagger: \"2.0\"\ninfo:\n description: |\n Copyright © 2017 AT&T Intellectual Property. All rights reserved.\n\n Licensed under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License.\n\n You may obtain a copy of the License at\n\n (https://creativecommons.org/licenses/by/4.0/)\n\n 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.\n\n ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.\n\n This document is best viewed with Firefox or Chrome. Nodes can be found by appending /#/definitions/node-type-to-find to the path to this document. Edge definitions can be found with the node definitions.\n version: \"" + apiVersion +"\"\n"); + sb.append("swagger: \"2.0\"\ninfo:\n "); + sb.append("description: |"); + sb.append("\n\n [Differences versus the previous schema version]("+"apidocs/aai_swagger_" + apiVersion + ".diff)"); + sb.append("\n\n Copyright © 2017 AT&T Intellectual Property. All rights reserved.\n\n Licensed under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License.\n\n You may obtain a copy of the License at\n\n (https://creativecommons.org/licenses/by/4.0/)\n\n 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.\n\n ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.\n\n This document is best viewed with Firefox or Chrome. Nodes can be found by appending /#/definitions/node-type-to-find to the path to this document. Edge definitions can be found with the node definitions.\n version: \"" + apiVersion +"\"\n"); sb.append(" title: Active and Available Inventory REST API\n"); sb.append(" license:\n name: Apache 2.0\n url: http://www.apache.org/licenses/LICENSE-2.0.html\n"); sb.append(" contact:\n name:\n url:\n email:\n"); sb.append("host:\nbasePath: /aai/" + apiVersion + "\n"); sb.append("schemes:\n - https\npaths:\n"); - /* - sb.append("responses:\n"); - sb.append(" \"200\":\n"); - sb.append(" description: successful operation\n"); - sb.append(" \"404\":\n"); - sb.append(" description: resource was not found\n"); - sb.append(" \"400\":\n"); - sb.append(" description: bad request\n"); - */ + try { - File initialFile = new File("src/main/resources/dbedgerules/DbEdgeRules_" + apiVersion + ".json"); + File initialFile; + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(normalStartDir)) { + initialFile = new File(normalStartDir + "/src/main/resources/dbedgerules/DbEdgeRules_" + apiVersion + ".json"); + } + else { + initialFile = new File("src/main/resources/dbedgerules/DbEdgeRules_" + apiVersion + ".json"); + } InputStream is = new FileInputStream(initialFile); Scanner scanner = new Scanner(is); @@ -1604,7 +2018,14 @@ public class GenerateXsd { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(oxmFile); + Document doc; + + if ( xml == null ) { + doc = dBuilder.parse(oxmFile); + } else { + InputSource isInput = new InputSource(new StringReader(xml)); + doc = dBuilder.parse(isInput); + } NodeList bindingsNodes = doc.getElementsByTagName("xml-bindings"); Element bindingElement; @@ -1615,21 +2036,21 @@ public class GenerateXsd { if ( bindingsNodes == null || bindingsNodes.getLength() == 0 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } bindingElement = (Element) bindingsNodes.item(0); javaTypesNodes = bindingElement.getElementsByTagName("java-types"); if ( javaTypesNodes.getLength() < 1 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } javaTypesElement = (Element) javaTypesNodes.item(0); javaTypeNodes = javaTypesElement.getElementsByTagName("java-type"); if ( javaTypeNodes.getLength() < 1 ) { - System.out.println( "missing in " + oxmFile ); + logger.error( "missing in " + oxmFile ); return null; } @@ -1638,8 +2059,7 @@ public class GenerateXsd { Attr attr; StringBuffer pathSb = new StringBuffer(); - StringBuffer definitionsSb = new StringBuffer("definitions:\n"); - + StringBuffer definitionsSb = new StringBuffer(); for ( int i = 0; i < javaTypeNodes.getLength(); ++ i ) { javaTypeElement = (Element) javaTypeNodes.item(i); NamedNodeMap attributes = javaTypeElement.getAttributes(); @@ -1652,28 +2072,67 @@ public class GenerateXsd { javaTypeName = attrValue; } if ( javaTypeName == null ) { - System.out.println( " has no name attribute in " + oxmFile ); + logger.error( " has no name attribute in " + oxmFile ); return null; } if ( !generatedJavaType.containsKey(getXmlRootElementName(javaTypeName)) ) { - //generatedJavaType.put(javaTypeName, null); - //if ( javaTypeName.equals("search")||javaTypeName.equals("actions")) - processJavaTypeElementSwagger( javaTypeName, javaTypeElement, pathSb, definitionsSb, null, null, null, null, null, null, null); } } sb.append(pathSb); - //System.out.println( "definitions block\n" + definitionsSb.toString()); - sb.append(definitionsSb.toString()); - //sb.append(definitionsSb); - } catch (Exception e) { e.printStackTrace(); return null; } - //System.out.println("generated " + sb.toString()); + //append definitions + sb.append("definitions:\n"); + Map sortedJavaTypeDefinitions = new TreeMap(javaTypeDefinitions); + for (Map.Entry entry : sortedJavaTypeDefinitions.entrySet()) { + logger.debug("Key: "+entry.getKey()+"Test: "+ (entry.getKey() == "relationship")); + if(entry.getKey().matches("relationship")) { + String jb=entry.getValue(); + logger.debug("Value: "+jb); + int ndx=jb.indexOf("related-to-property:"); + if(ndx > 0) { + jb=jb.substring(0, ndx); + jb=jb.replaceAll(" +$", ""); + } + logger.debug("Value-after: "+jb); + sb.append(jb); + continue; + } + sb.append(entry.getValue()); + } + + sb.append("patchDefinitions:\n"); + for (Map.Entry entry : sortedJavaTypeDefinitions.entrySet()) { + String jb=entry.getValue().replaceAll("/definitions/", "/patchDefinitions/"); + int ndx=jb.indexOf("relationship-list:"); + if(ndx > 0) { + jb=jb.substring(0, ndx); + jb=jb.replaceAll(" +$", ""); + } + int ndx1=jb.indexOf("resource-version:"); + logger.debug("Key: "+entry.getKey()+" index: " + ndx1); + logger.debug("Value: "+jb); + if(ndx1 > 0) { + jb=jb.substring(0, ndx1); + jb=jb.replaceAll(" +$", ""); + } + logger.debug("Value-after: "+jb); + sb.append(jb); + } + + sb.append("getDefinitions:\n"); + for (Map.Entry entry : sortedJavaTypeDefinitions.entrySet()) { + String jb=entry.getValue().replaceAll("/definitions/", "/getDefinitions/"); + sb.append(jb); + } + + logger.debug("generated " + sb.toString()); + generateRelations(); return sb.toString(); } @@ -1686,7 +2145,7 @@ public class GenerateXsd { Object nodeset = expr.evaluate(element, XPathConstants.NODESET); if (nodeset != null) { NodeList nodes = (NodeList) nodeset; - if (nodes.getLength() > 0) { + if (nodes != null && nodes.getLength() > 0) { Element xmlProperty = (Element)nodes.item(0); result = xmlProperty.getElementsByTagName("xml-property"); } @@ -1698,4 +2157,4 @@ public class GenerateXsd { return result; } -} +} \ No newline at end of file diff --git a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java index 24ba1ba8..5deb48ae 100644 --- a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java +++ b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java @@ -61,7 +61,7 @@ public class HttpsAuthClient{ // System.out.println("Jersey result: "); // System.out.println(res.getEntity(String.class).toString()); - + } catch (KeyManagementException e) { e.printStackTrace(); } catch (Exception e) { diff --git a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthExternalClient.java b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthExternalClient.java new file mode 100644 index 00000000..a984c1e6 --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthExternalClient.java @@ -0,0 +1,150 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright (C) 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========================================================= + */ + +package org.onap.aai.util; + +import java.io.FileInputStream; +import java.security.KeyManagementException; +import java.security.KeyStore; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; + +import org.onap.aai.domain.yang.Customers; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.json.JSONConfiguration; +import com.sun.jersey.client.urlconnection.HTTPSProperties; + +public class HttpsAuthExternalClient { + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + try { + String url = AAIConfig.get(AAIConstants.AAI_SERVER_URL) + "business/customers"; + System.out.println("Making Jersey https call..."); + String keystore = args[0]; + String keypasswd = args[1]; + Client client = HttpsAuthExternalClient.getClient(keystore, keypasswd); + + ClientResponse res = client.resource(url) + .accept("application/json") + .header("X-TransactionId", "PROV001") + .header("X-FromAppId", "AAI") + .type("application/json") + .get(ClientResponse.class); + +// System.out.println("Jersey result: "); +// System.out.println(res.getEntity(String.class).toString()); + + Customers customers = res.getEntity(Customers.class); + System.out.println("Jersey result: "); + System.out.println("Number of customers: " + customers.getCustomer().size()); + + } catch (KeyManagementException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + /** + * Gets the client. + * + * @param keystoreFileName the keystore file name + * @param keystorePassword the keystore password + * @return the client + * @throws Exception the exception + */ + public static Client getClient ( String keystoreFileName, String keystorePassword ) throws Exception { + + ClientConfig config = new DefaultClientConfig(); + config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); + config.getClasses().add(org.onap.aai.restcore.CustomJacksonJaxBJsonProvider.class); + Client client = null; + SSLContext ctx = null; + + try { + String truststore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_FILENAME); + String truststore_password = AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_PASSWD); + String keystore_path = AAIConstants.AAI_HOME_ETC_AUTH + keystoreFileName; + String keystore_password = keystorePassword; + + //System.setProperty("javax.net.ssl.trustStore", truststore_path); + //System.setProperty("javax.net.ssl.trustStorePassword", truststore_password); + HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){ + public boolean verify(String string,SSLSession ssls) { + return true; + } + }); + + ctx = SSLContext.getInstance("TLS"); + KeyManagerFactory kmf = null; + + + /**** kmf = KeyManagerFactory.getInstance("SunX509"); + FileInputStream fin = new FileInputStream(keystore_path); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] pwd = keystore_password.toCharArray(); + ks.load(fin, pwd); + kmf.init(ks, pwd); + ***/ + + String alg = TrustManagerFactory.getDefaultAlgorithm(); + TrustManagerFactory tmf = TrustManagerFactory.getInstance(alg); + FileInputStream tin = new FileInputStream(truststore_path); + KeyStore ts = KeyStore.getInstance("PKCS12"); + char[] tpwd = truststore_password.toCharArray(); + ts.load(tin, tpwd); + tmf.init(ts); + + //ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + // Updating key manager to null, to disable two way SSL + ctx.init(null, tmf.getTrustManagers(), null); + + config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, + new HTTPSProperties( new HostnameVerifier() { + @Override + public boolean verify( String s, SSLSession sslSession ) { + return true; + } + }, ctx)); + + client = Client.create(config); + // uncomment this line to get more logging for the request/response + // client.addFilter(new LoggingFilter(System.out)); + } catch (Exception e) { + throw e; + } + return client; + } + +} diff --git a/aai-core/src/main/java/org/onap/aai/util/Request.java b/aai-core/src/main/java/org/onap/aai/util/Request.java index 605aa2b9..46c891c2 100644 --- a/aai-core/src/main/java/org/onap/aai/util/Request.java +++ b/aai-core/src/main/java/org/onap/aai/util/Request.java @@ -33,10 +33,7 @@ import org.onap.aai.exceptions.AAIException; public class Request { - public static final String V2 = "v2"; - public static final String V3 = "v3"; - public static final String V4 = "v4"; - public static final String V5 = "v5"; + public static final String V12 = "v12"; public final String fromAppId; public final String transactionId; public final String path; @@ -73,7 +70,7 @@ public class Request { private String path; private RestObject restObj; private boolean oldServer; - private String apiVersion = Request.V4; + private String apiVersion = Request.V12; /** diff --git a/aai-core/src/main/java/org/onap/aai/util/RestController.java b/aai-core/src/main/java/org/onap/aai/util/RestController.java new file mode 100644 index 00000000..421946ef --- /dev/null +++ b/aai-core/src/main/java/org/onap/aai/util/RestController.java @@ -0,0 +1,469 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright (C) 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========================================================= + */ + +package org.onap.aai.util; + +import java.security.KeyManagementException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.LoggingContext; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.ClientResponse; + +public class RestController { + + private static final String TARGET_NAME = "AAI"; + private static EELFLogger LOGGER = EELFManager.getInstance().getLogger(RestController.class); + + private static Client client = null; + + private String restSrvrBaseURL; + + //To do - Come up with helper function that will automatically + //generate the REST API path based on path parameter(s) and query parameter(s)! + public static final String REST_APIPATH_COMPLEXES = "cloud-infrastructure/complexes"; + public static final String REST_APIPATH_COMPLEX = "cloud-infrastructure/complexes/complex/"; + public static final String REST_APIPATH_PSERVERS = "cloud-infrastructure/pservers"; + public static final String REST_APIPATH_PSERVER = "cloud-infrastructure/pservers/pserver/"; + public static final String REST_APIPATH_PHYSICALLINKS = "network/physical-links/"; + public static final String REST_APIPATH_PHYSICALLINK = "network/physical-links/physical-link/"; + public static final String REST_APIPATH_PINTERFACES = "network/p-interfaces/"; + public static final String REST_APIPATH_PINTERFACE = "network/p-interfaces/p-interface/"; + public static final String REST_APIPATH_VPLSPES = "network/vpls-pes/"; + public static final String REST_APIPATH_VPLSPE = "network/vpls-pes/vpls-pe/"; + public static final String REST_APIPATH_UPDATE = "actions/update/"; + public static final String REST_APIPATH_SEARCH = "search/nodes-query?search-node-type="; + + public static final String REST_APIPATH_CLOUDREGION = "cloud-infrastructure/cloud-regions/cloud-region/"; + public static final String REST_APIPATH_TENANT = "cloud-infrastructure/tenants/tenant/"; + public static final String REST_APIPATH_VIRTUAL_DATA_CENTER = "cloud-infrastructure/virtual-data-centers/virtual-data-center/"; + public static final String REST_APIPATH_VIRTUAL_DATA_CENTERS = "cloud-infrastructure/virtual-data-centers/"; + //network/generic-vnfs/generic-vnf/{vnf-id} + public static final String REST_APIPATH_GENERIC_VNF = "network/generic-vnfs/generic-vnf/"; + public static final String REST_APIPATH_GENERIC_VNFS = "network/generic-vnfs"; + public static final String REST_APIPATH_L3_NETWORK = "network/l3-networks/l3-network/"; + public static final String REST_APIPATH_L3_NETWORKS = "network/l3-networks"; + public static final String REST_APIPATH_INSTANCE_GROUP = "network/instance-groups/instance-group"; + public static final String REST_APIPATH_INSTANCE_GROUPS = "network/instance-groups"; + + public static final String REST_APIPATH_VCE = "network/vces/vce/"; + + public static final String REST_APIPATH_SERVICE = "service-design-and-creation/services/service/"; + public static final String REST_APIPATH_LOGICALLINKS = "network/logical-links/"; + public static final String REST_APIPATH_LOGICALLINK = "network/logical-links/logical-link/"; + + /** + * Inits the rest client. + * + * @throws AAIException the AAI exception + */ + private static void initRestClient() throws AAIException + { + if (client == null) { + try { + client = HttpsAuthClient.getClient(); + } + catch (KeyManagementException e){ + throw new AAIException("AAI_7117", "KeyManagementException in REST call to DB: " + e.toString()); + } catch (Exception e) { + throw new AAIException("AAI_7117", " Exception in REST call to DB: " + e.toString()); + } + } + } + + /** + * Sets the rest srvr base URL. + * + * @param baseURL the base URL + * @throws AAIException the AAI exception + */ + public void SetRestSrvrBaseURL(String baseURL) throws AAIException + { + if (baseURL == null) + throw new AAIException("AAI_7117", "REST Server base URL cannot be null."); + restSrvrBaseURL = baseURL; + } + + /** + * Gets the rest srvr base URL. + * + * @return the rest srvr base URL + */ + public String getRestSrvrBaseURL() + { + return restSrvrBaseURL; + } + + + public static void Get(T t, String sourceID, String transId, String path, RestObject restObject, boolean oldserver) throws AAIException { + RestController.Get(t, sourceID, transId, path, restObject, oldserver, AAIConstants.AAI_RESOURCES_PORT); + } + /** + * To do - optimization and automation. Also make it as generic as possible. + * + * @param the generic type + * @param t the t + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @param restObject the rest object + * @param oldserver the oldserver + * @throws AAIException the AAI exception + */ + @SuppressWarnings("unchecked") + public static void Get(T t, String sourceID, String transId, String path, RestObject restObject, boolean oldserver, int port) throws AAIException { + String methodName = "Get"; + String url=""; + transId += ":" + UUID.randomUUID().toString(); + + LoggingContext.save(); + LoggingContext.partnerName(sourceID); + LoggingContext.targetEntity(TARGET_NAME); + LoggingContext.requestId(transId); + LoggingContext.serviceName(methodName); + LoggingContext.targetServiceName(methodName); + + LOGGER.debug(methodName + " start"); + + restObject.set(t); + + if (oldserver) + url = AAIConfig.get(AAIConstants.AAI_OLDSERVER_URL) + path; + else + url = String.format(AAIConstants.AAI_LOCAL_REST, port) + path; + initRestClient(); + LOGGER.debug(url + " for the get REST API"); + ClientResponse cres = client.resource(url) + .accept("application/json") + .header("X-TransactionId", transId) + .header("X-FromAppId", sourceID) + .header("Real-Time", "true") + .type("application/json") + .get(ClientResponse.class); + +// System.out.println("cres.EntityInputSream()="+cres.getEntityInputStream().toString()); +// System.out.println("cres.tostring()="+cres.toString()); + + if (cres.getStatus() == 200) { +// System.out.println(methodName + ": url=" + url); + t = (T) cres.getEntity(t.getClass()); + restObject.set(t); + LOGGER.debug(methodName + "REST api GET was successfull!"); + } else { + LoggingContext.restore(); +// System.out.println(methodName + ": url=" + url + " failed with status=" + cres.getStatus()); + throw new AAIException("AAI_7116", methodName +" with status="+cres.getStatus()+", url="+url); + } + + LoggingContext.restore(); + } + + /** + * Map json to object list. + * + * @param the generic type + * @param typeDef the type def + * @param json the json + * @param clazz the clazz + * @return the list + * @throws Exception the exception + */ + private static List mapJsonToObjectList(T typeDef,String json, Class clazz) throws Exception + { + List list; + ObjectMapper mapper = new ObjectMapper(); + System.out.println(json); + TypeFactory t = TypeFactory.defaultInstance(); + list = mapper.readValue(json, t.constructCollectionType(ArrayList.class,clazz)); + + return list; + } + + /** + * Put. + * + * @param the generic type + * @param t the t + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @throws AAIException the AAI exception + */ + public static void Put(T t, String sourceID, String transId, String path) throws AAIException { + Put( t, sourceID, transId, path, false, AAIConstants.AAI_RESOURCES_PORT); + } + + /** + * Put. + * + * @param the generic type + * @param t the t + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @throws AAIException the AAI exception + */ + public static void Put(T t, String sourceID, String transId, String path, boolean oldserver) throws AAIException { + Put( t, sourceID, transId, path, oldserver, AAIConstants.AAI_RESOURCES_PORT); + } + + /** + * Put. + * + * @param the generic type + * @param t the t + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @param oldserver the oldserver + * @throws AAIException the AAI exception + */ + public static void Put(T t, String sourceID, String transId, String path, boolean oldserver, int port) throws AAIException { + String methodName = "Put"; + String url=""; + transId += ":" + UUID.randomUUID().toString(); + + LoggingContext.save(); + LoggingContext.partnerName(sourceID); + LoggingContext.targetEntity(TARGET_NAME); + LoggingContext.requestId(transId); + LoggingContext.serviceName(methodName); + LoggingContext.targetServiceName(methodName); + + LOGGER.debug(methodName + " start"); + + initRestClient(); + + if (oldserver) + url = AAIConfig.get(AAIConstants.AAI_OLDSERVER_URL) + path; + else + url = String.format(AAIConstants.AAI_LOCAL_REST, port) + path; + + ClientResponse cres = client.resource(url) + .accept("application/json") + .header("X-TransactionId", transId) + .header("X-FromAppId", sourceID) + .header("Real-Time", "true") + .type("application/json") + .entity(t) + .put(ClientResponse.class); + +// System.out.println("cres.tostring()="+cres.toString()); + + int statuscode = cres.getStatus(); + if ( statuscode >= 200 && statuscode <= 299 ) { + LOGGER.debug(methodName+": url=" + url + ", request=" + path); + LoggingContext.restore(); + } else { + LoggingContext.restore(); + throw new AAIException("AAI_7116", methodName +" with status="+statuscode+", url="+url + ", msg=" + cres.getEntity(String.class)); + } + } + + public static void Delete(String sourceID, String transId, String path) throws AAIException { + RestController.Delete(sourceID, transId, path, AAIConstants.AAI_RESOURCES_PORT); + } + /** + * Delete. + * + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @throws AAIException the AAI exception + */ + public static void Delete(String sourceID, String transId, String path, int port) throws AAIException { + String methodName = "Delete"; + String url=""; + transId += ":" + UUID.randomUUID().toString(); + + LoggingContext.save(); + LoggingContext.partnerName(sourceID); + LoggingContext.targetEntity(TARGET_NAME); + LoggingContext.requestId(transId); + LoggingContext.serviceName(methodName); + LoggingContext.targetServiceName(methodName); + + LOGGER.debug(methodName + " start"); + + initRestClient(); + String request = "{}"; + url = String.format(AAIConstants.AAI_LOCAL_REST, port) + path; + ClientResponse cres = client.resource(url) + .accept("application/json") + .header("X-TransactionId", transId) + .header("X-FromAppId", sourceID) + .header("Real-Time", "true") + .type("application/json") + .entity(request) + .delete(ClientResponse.class); + + if (cres.getStatus() == 404) { // resource not found + LOGGER.info("Resource does not exist...: " + cres.getStatus() + + ":" + cres.getEntity(String.class)); + LoggingContext.restore(); + } else if (cres.getStatus() == 200 || cres.getStatus() == 204){ + LOGGER.info("Resource " + url + " deleted"); + LoggingContext.restore(); + } else { + LOGGER.error("Deleting Resource failed: " + cres.getStatus() + + ":" + cres.getEntity(String.class)); + LoggingContext.restore(); + throw new AAIException("AAI_7116", "Error during DELETE"); + } + } + + /** + * Post. + * + * @param the generic type + * @param t the t + * @param sourceID the source ID + * @param transId the trans id + * @param path the path + * @return the string + * @throws Exception the exception + */ + public static String Post(T t, String sourceID, String transId, String path) throws Exception { + String methodName = "Post"; + String url=""; + transId += ":" + UUID.randomUUID().toString(); + + LoggingContext.save(); + LoggingContext.partnerName(sourceID); + LoggingContext.targetEntity(TARGET_NAME); + LoggingContext.requestId(transId); + LoggingContext.serviceName(methodName); + LoggingContext.targetServiceName(methodName); + + LOGGER.debug(methodName + " start"); + + try { + + initRestClient(); + + url = AAIConfig.get(AAIConstants.AAI_SERVER_URL) + path; + + ClientResponse cres = client.resource(url) + .accept("application/json") + .header("X-TransactionId", transId) + .header("X-FromAppId", sourceID) + .header("Real-Time", "true") + .type("application/json") + .entity(t) + .post(ClientResponse.class); + + int statuscode = cres.getStatus(); + if ( statuscode >= 200 && statuscode <= 299 ) { + LOGGER.debug(methodName + "REST api POST was successful!"); + return cres.getEntity(String.class); + } else { + throw new AAIException("AAI_7116", methodName +" with status="+statuscode+", url="+url + ", msg=" + cres.getEntity(String.class)); + } + + } catch (AAIException e) { + throw new AAIException("AAI_7116", methodName + " with url="+url+ ", Exception: " + e.toString()); + } catch (Exception e) + { + throw new AAIException("AAI_7116", methodName + " with url="+url+ ", Exception: " + e.toString()); + + } + finally { + LoggingContext.restore(); + } + } + + + /** + * Gets the single instance of RestController. + * + * @param the generic type + * @param clazz the clazz + * @return single instance of RestController + * @throws IllegalAccessException the illegal access exception + * @throws InstantiationException the instantiation exception + */ + public static T getInstance(Class clazz) throws IllegalAccessException, InstantiationException + { + return clazz.newInstance(); + } + + /** + * Does resource exist. + * + * @param the generic type + * @param resourcePath the resource path + * @param resourceClassName the resource class name + * @param fromAppId the from app id + * @param transId the trans id + * @return the t + */ + /* + * DoesResourceExist + * + * To check whether a resource exist or get a copy of the existing version of the resource + * + * Resourcepath: should contain the qualified resource path (including encoded unique key identifier value), + * resourceClassName: is the canonical name of the resource class name, + * fromAppId: + * transId: + * + * Will return null (if the resource doesn’t exist) (or) + * Will return the specified resource from the Graph. + * + * Example: + * LogicalLink llink = new LogicalLink(); + * String resourceClassName = llink.getClass().getCanonicalName(); + * llink = RestController.DoesResourceExist("network/logical-links/logical-link/" + , resourceClassName, fromAppId, transId); + */ + public static T DoesResourceExist(String resourcePath, String resourceClassName, String fromAppId, String transId) { + + try { + + RestObject restObj = new RestObject(); + @SuppressWarnings("unchecked") + T resourceObj = (T)getInstance(Class.forName(resourceClassName)); + restObj.set(resourceObj); + RestController.Get(resourceObj, fromAppId, transId, resourcePath, restObj, false, AAIConstants.AAI_RESOURCES_PORT); + + resourceObj = restObj.get(); + if (resourceObj != null) + return resourceObj; + + } catch (AAIException e) { + + } catch (ClientHandlerException che) { + + }catch (Exception e) { + + } + + return null; + } + +} diff --git a/aai-core/src/main/java/org/onap/aai/util/StoreNotificationEvent.java b/aai-core/src/main/java/org/onap/aai/util/StoreNotificationEvent.java index 96dbfeb4..0ad33cb9 100644 --- a/aai-core/src/main/java/org/onap/aai/util/StoreNotificationEvent.java +++ b/aai-core/src/main/java/org/onap/aai/util/StoreNotificationEvent.java @@ -49,7 +49,11 @@ public class StoreNotificationEvent { * Instantiates a new store notification event. */ public StoreNotificationEvent(String transactionId, String sourceOfTruth) { - this.messageProducer = new AAIDmaapEventJMSProducer(); + this(new AAIDmaapEventJMSProducer(), transactionId, sourceOfTruth); + } + + public StoreNotificationEvent(AAIDmaapEventJMSProducer producer, String transactionId, String sourceOfTruth) { + this.messageProducer = producer; this.transactionId = transactionId; this.sourceOfTruth = sourceOfTruth; } @@ -64,7 +68,7 @@ public class StoreNotificationEvent { * @throws AAIException * the AAI exception */ - public void storeEvent(NotificationEvent.EventHeader eh, Object obj) throws AAIException { + public String storeEvent(NotificationEvent.EventHeader eh, Object obj) throws AAIException { if (obj == null) { throw new AAIException("AAI_7350"); @@ -123,6 +127,7 @@ public class StoreNotificationEvent { PojoUtils pu = new PojoUtils(); String entityJson = pu.getJsonFromObject(ne); sendToDmaapJmsQueue(entityJson); + return entityJson; } catch (Exception e) { throw new AAIException("AAI_7350", e); } @@ -214,7 +219,7 @@ public class StoreNotificationEvent { } } - public void storeEvent(Loader loader, Introspector eventHeader, Introspector obj) throws AAIException { + public String storeEvent(Loader loader, Introspector eventHeader, Introspector obj) throws AAIException { if (obj == null) { throw new AAIException("AAI_7350"); } @@ -271,6 +276,7 @@ public class StoreNotificationEvent { String entityJson = notificationEvent.marshal(false); sendToDmaapJmsQueue(entityJson); + return entityJson; } catch (JSONException e) { throw new AAIException("AAI_7350", e); } catch (AAIUnknownObjectException e) { diff --git a/aai-core/src/main/java/org/onap/aai/util/UniquePropertyCheck.java b/aai-core/src/main/java/org/onap/aai/util/UniquePropertyCheck.java index ae2cdaae..72e5380f 100644 --- a/aai-core/src/main/java/org/onap/aai/util/UniquePropertyCheck.java +++ b/aai-core/src/main/java/org/onap/aai/util/UniquePropertyCheck.java @@ -32,6 +32,8 @@ import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.onap.aai.exceptions.AAIException; +import org.onap.aai.logging.LoggingContext; +import org.onap.aai.logging.LoggingContext.StatusCode; import org.slf4j.MDC; import com.att.eelf.configuration.Configuration; @@ -39,8 +41,7 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; - - +import org.onap.aai.dbmap.AAIGraphConfig; public class UniquePropertyCheck { @@ -61,11 +62,24 @@ public class UniquePropertyCheck { props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "uniquePropertyCheck-logback.xml"); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); EELFLogger logger = EELFManager.getInstance().getLogger(UniquePropertyCheck.class.getSimpleName()); + + LoggingContext.init(); + LoggingContext.partnerName(FROMAPPID); + LoggingContext.serviceName(AAIConstants.AAI_RESOURCES_MS); + LoggingContext.component(COMPONENT); + LoggingContext.targetEntity(AAIConstants.AAI_RESOURCES_MS); + LoggingContext.targetServiceName("main"); + LoggingContext.requestId(TRANSID); + LoggingContext.statusCode(StatusCode.COMPLETE); + LoggingContext.responseCode(LoggingContext.SUCCESS); + MDC.put("logFilenameAppender", UniquePropertyCheck.class.getSimpleName()); if( args == null || args.length != 1 ){ String msg = "usage: UniquePropertyCheck propertyName \n"; System.out.println(msg); + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.BUSINESS_PROCESS_ERROR); logAndPrint(logger, msg ); System.exit(1); } @@ -75,26 +89,34 @@ public class UniquePropertyCheck { try { AAIConfig.init(); System.out.println(" ---- NOTE --- about to open graph (takes a little while)--------\n"); - TitanGraph tGraph = TitanFactory.open(AAIConstants.REALTIME_DB_CONFIG); + TitanGraph tGraph = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(UniquePropertyCheck.class.getSimpleName()).withGraphType("realtime").buildConfiguration()); if( tGraph == null ) { + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); logAndPrint(logger, " Error: Could not get TitanGraph "); System.exit(1); } graph = tGraph.newTransaction(); if( graph == null ){ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.AVAILABILITY_TIMEOUT_ERROR); logAndPrint(logger, "could not get graph object in UniquePropertyCheck() \n"); System.exit(0); } } catch (AAIException e1) { String msg = "Threw Exception: [" + e1.toString() + "]"; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.UNKNOWN_ERROR); logAndPrint(logger, msg); System.exit(0); } catch (Exception e2) { String msg = "Threw Exception: [" + e2.toString() + "]"; + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.UNKNOWN_ERROR); logAndPrint(logger, msg); System.exit(0); } @@ -180,6 +202,8 @@ public class UniquePropertyCheck { } } catch( Exception e2 ){ + LoggingContext.statusCode(StatusCode.ERROR); + LoggingContext.responseCode(LoggingContext.DATA_ERROR); logAndPrint(logger, "Threw Exception: [" + e2.toString() + "]"); } finally { diff --git a/aai-core/src/main/java/org/onap/aai/util/swagger/GenerateSwagger.java b/aai-core/src/main/java/org/onap/aai/util/swagger/GenerateSwagger.java index a85b548e..9d36c0e8 100644 --- a/aai-core/src/main/java/org/onap/aai/util/swagger/GenerateSwagger.java +++ b/aai-core/src/main/java/org/onap/aai/util/swagger/GenerateSwagger.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.dataformat.yaml.snakeyaml.constructor.SafeConstruct import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; +import org.onap.aai.introspection.Version; import java.io.*; import java.util.*; @@ -37,7 +38,11 @@ public class GenerateSwagger { public static final String DEFAULT_WIKI = ""; public static final String DEFAULT_SCHEMA_DIR = "../aai-schema"; - public static final String CURRENT_VERSION = "v11"; + public static final String CURRENT_VERSION = Version. getLatest().toString(); + //if the program is run from aai-common, use this directory as default" + public static final String ALT_SCHEMA_DIR = "aai-schema"; + //used to check to see if program is run from aai-core + public static final String DEFAULT_RUN_DIR = "aai-core"; public static void main(String[] args) throws IOException, TemplateException { @@ -46,8 +51,14 @@ public class GenerateSwagger { String wikiLink = System.getProperty("aai.wiki.link"); if(schemaDir == null){ - System.out.println("Warning: Schema directory is not set so using default schema dir: " + DEFAULT_SCHEMA_DIR); - schemaDir = DEFAULT_SCHEMA_DIR; + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) { + System.out.println("Warning: Schema directory is not set so using default schema dir: " + ALT_SCHEMA_DIR); + schemaDir = ALT_SCHEMA_DIR; + } + else { + System.out.println("Warning: Schema directory is not set so using default schema dir: " + DEFAULT_SCHEMA_DIR); + schemaDir = DEFAULT_SCHEMA_DIR; + } } if(versionToGenerate == null){ @@ -136,8 +147,13 @@ public class GenerateSwagger { Configuration configuration = new Configuration(); configuration.setClassForTemplateLoading(Api.class, "/"); - configuration.setDirectoryForTemplateLoading(new File("src/main/resources/")); - + String resourcePath = "src/main/resources"; + if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) { + configuration.setDirectoryForTemplateLoading(new File(DEFAULT_RUN_DIR + "/" + resourcePath)); + } + else { + configuration.setDirectoryForTemplateLoading(new File(resourcePath)); + } Template template = configuration.getTemplate("swagger.html.ftl"); String outputDirStr = schemaDir + "/src/main/resources/aai_swagger_html"; diff --git a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v10.json b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v10.json index e7a2e489..1c683237 100644 --- a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v10.json +++ b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v10.json @@ -1,21 +1,21 @@ { "rules": [ { - "from": "ipsec-configuration", - "to": "vig-server", - "label": "hasVigServer", + "from": "allotted-resource", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "multicast-configuration", - "label": "uses", + "from": "allotted-resource", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -25,107 +25,95 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "allotted-resource", + "to": "l3-network", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-constraint", - "to": "constrained-element-set", - "label": "uses", + "from": "allotted-resource", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "l-interface", - "label": "has", + "from": "allotted-resource", + "to": "vlan", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vf-module", - "label": "has", + "from": "tunnel-xconnect", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "p-interface", - "label": "usesPInterface", + "from": "availability-zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "model-element", - "to": "model-constraint", - "label": "uses", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "connector", - "to": "virtual-data-center", - "label": "contains", + "from": "availability-zone", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-element", - "label": "connectsTo", + "from": "availability-zone", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "vpn-binding", - "label": "uses", + "from": "cloud-region", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -133,381 +121,405 @@ "default": "true" }, { - "from": "tenant", - "to": "vserver", - "label": "owns", + "from": "cloud-region", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "flavor", - "label": "hasFlavor", + "from": "cloud-region", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "vlan", - "label": "hasVlan", + "from": "dvs-switch", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "flavor", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "allotted-resource", - "to": "network-policy", - "label": "uses", + "from": "group-assignment", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vpls-pe", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "image", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "vnfc", - "label": "hosts", + "from": "oam-network", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "instance-group", - "to": "model", - "label": "targets", + "from": "snapshot", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "tenant", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "volume-group", - "label": "has", + "from": "volume-group", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "pnf", - "label": "uses", + "from": "complex", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "ctag-assignment", - "label": "hasCtagAssignment", + "from": "ctag-pool", + "to": "complex", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "service-instance", - "label": "hasServiceInstance", + "from": "connector", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "service-instance", - "label": "dependsOn", + "from": "metadatum", + "to": "connector", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "flavor", - "label": "has", + "from": "element-choice-set", + "to": "constrained-element-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "instance-group", - "label": "isMemberOf", + "from": "ctag-pool", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "pserver", - "label": "runsOnPserver", + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "pnf", - "label": "bridgedTo", + "from": "dvs-switch", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "virtual-data-center", - "to": "generic-vnf", - "label": "hasVNF", + "from": "model-element", + "to": "element-choice-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "p-interface", - "label": "hasPinterface", + "from": "entitlement", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "vf-module", - "label": "isPartOf", + "from": "generic-vnf", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "complex", - "to": "ctag-pool", - "label": "hasCtagPool", + "from": "generic-vnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "constrained-element-set", - "to": "element-choice-set", - "label": "uses", + "from": "generic-vnf", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "generic-vnf", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "physical-link", - "label": "usesPhysicalLink", + "from": "generic-vnf", + "to": "license-key-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-ver", - "label": "isA", + "from": "generic-vnf", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "image", - "label": "hasImage", + "from": "vnfc", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "complex", - "label": "locatedIn", + "from": "generic-vnf", + "to": "vnf-image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "tenant", - "to": "l3-network", - "label": "usesL3Network", + "from": "generic-vnf", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "generic-vnf", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "complex", - "label": "existsIn", + "from": "lag-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "license", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "l-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "cloud-region", - "label": "existsIn", + "from": "network-profile", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -517,23 +529,23 @@ "default": "true" }, { - "from": "oam-network", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "service-instance", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "zone", - "label": "isMemberOf", + "from": "site-pair-set", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -541,81 +553,81 @@ "default": "true" }, { - "from": "customer", - "to": "service-subscription", - "label": "subscribesTo", + "from": "vf-module", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "segmentation-assignment", - "label": "has", + "from": "pserver", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "vce", - "to": "license", - "label": "has", + "from": "tenant", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "related-lookup", - "label": "uses", + "from": "metadatum", + "to": "image", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "p-interface", - "label": "hasPinterface", + "from": "instance-group", + "to": "model", + "label": "org.onap.relationships.inventory.Targets", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "newvce", - "to": "l-interface", - "label": "hasLInterface", + "from": "vig-server", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "l3-network", - "label": "isPartOf", + "from": "l3-interface-ipv4-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -625,23 +637,11 @@ "default": "true" }, { - "from": "p-interface", - "to": "logical-link", - "label": "usesLogicalLink", - "direction": "OUT", - "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "vserver", - "label": "runsOnVserver", + "from": "l3-interface-ipv4-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -649,11 +649,11 @@ "default": "true" }, { - "from": "pserver", - "to": "availability-zone", - "label": "existsIn", + "from": "l3-interface-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -661,105 +661,81 @@ "default": "true" }, { - "from": "vpls-pe", - "to": "lag-interface", - "label": "hasLAGinterface", + "from": "l3-interface-ipv6-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "vnfc", - "label": "uses", - "direction": "OUT", - "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "service-instance", - "label": "hasInstance", + "from": "l3-interface-ipv6-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "model", - "label": "relatedTo", + "from": "l3-interface-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vf-module", - "to": "vnfc", - "label": "uses", + "from": "ctag-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "complex", - "label": "locatedIn", + "from": "l3-network", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "model-ver", - "to": "metadatum", - "label": "hasMetaData", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "entitlement", - "label": "has", + "from": "l3-network", + "to": "route-table-reference", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "availability-zone", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "l3-network", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -769,23 +745,23 @@ "default": "true" }, { - "from": "vserver", - "to": "volume", - "label": "hasVolume", + "from": "segmentation-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", + "from": "service-instance", "to": "l3-network", - "label": "isMemberOf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -793,105 +769,93 @@ "default": "true" }, { - "from": "cloud-region", - "to": "zone", - "label": "isMemberOf", + "from": "subnet", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "service-instance", - "label": "hasInstance", + "from": "lag-interface", + "to": "lag-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "route-table-reference", - "label": "uses", + "from": "lag-interface", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "model-element", - "to": "constrained-element-set", - "label": "connectsTo", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "dvs-switch", - "to": "availability-zone", - "label": "existsIn", + "from": "lag-interface", + "to": "p-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", + "from": "l-interface", "to": "lag-interface", - "label": "hasLAGInterface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "availability-zone", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "complex", - "label": "locatedIn", + "from": "l3-interface-ipv6-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "vlan", - "label": "isPartOf", + "from": "l-interface", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -901,203 +865,227 @@ "default": "true" }, { - "from": "zone", - "to": "complex", - "label": "existsIn", + "from": "l-interface", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair", - "to": "class-of-service", - "label": "hasClassOfService", + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "sriov-vf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "element-choice-set", - "to": "model-element", - "label": "has", + "from": "vlan", + "to": "l-interface", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "ctag-pool", - "to": "availability-zone", - "label": "supportsAvailabilityZone", + "from": "logical-link", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "network-policy", - "label": "uses", + "from": "logical-link", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "port-group", - "label": "hasPortGroup", + "from": "logical-link", + "to": "lag-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "complex", - "label": "locatedIn", + "from": "logical-link", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnf-image", - "label": "usesVnfImage", + "from": "logical-link", + "to": "pnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair-set", - "to": "routing-instance", - "label": "hasRoutingInstance", + "from": "logical-link", + "to": "pserver", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vlan", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "logical-link", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "model-ver", + "to": "model", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "l-interface", - "label": "hasLInterface", + "from": "constrained-element-set", + "to": "model-constraint", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "constrained-element-set", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "generic-vnf", - "label": "isPartOf", + "from": "model-constraint", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license", - "label": "has", + "from": "model-element", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "zone", - "label": "isMemberOf", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "lag-interface", - "to": "logical-link", - "label": "uses", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "named-query", + "to": "model", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1105,177 +1093,177 @@ "default": "true" }, { - "from": "vce", - "to": "vserver", - "label": "runsOnVserver", + "from": "named-query-element", + "to": "named-query", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "named-query-element", + "to": "model", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "volume-group", - "label": "uses", + "from": "named-query-element", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "pserver", - "label": "bridgedTo", + "from": "property-constraint", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "oam-network", - "label": "has", + "from": "related-lookup", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "dvs-switch", - "label": "has", + "from": "l-interface", + "to": "newvce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "has", + "from": "oam-network", + "to": "complex", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "uses", + "from": "oam-network", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "l-interface", + "to": "p-interface", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "l3-network", - "label": "uses", + "from": "p-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "group-assignment", - "label": "has", + "from": "p-interface", + "to": "physical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "group-assignment", - "to": "tenant", - "label": "has", + "from": "lag-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "p-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "virtual-data-center", - "to": "logical-link", - "label": "contains", + "from": "pnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "named-query-element", - "to": "named-query-element", - "label": "connectsTo", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "connector", - "label": "uses", + "from": "pnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1285,153 +1273,141 @@ "default": "true" }, { - "from": "lag-interface", - "to": "lag-link", - "label": "usesLAGLink", + "from": "pnf", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "cloud-region", - "label": "locatedIn", + "from": "cvlan-tag", + "to": "port-group", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "generic-vnf", - "label": "bridgedTo", + "from": "lag-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "entitlement", - "label": "has", + "from": "p-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "l3-network", - "label": "uses", + "from": "pserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "sriov-vf", - "label": "has", + "from": "pserver", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "model", - "label": "isA", + "from": "pserver", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "group-assignment", - "to": "pserver", - "label": "has", + "from": "pserver", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "snapshot", - "label": "has", + "from": "site-pair", + "to": "routing-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "cloud-region", - "to": "tenant", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "image", - "label": "has", + "from": "allotted-resource", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "model-ver", - "to": "model-element", - "label": "startsWith", + "from": "metadatum", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "service-instance", - "to": "cvlan-tag", - "label": "hasIPAGFacingVLAN", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1441,21 +1417,9 @@ "default": "true" }, { - "from": "vserver", - "to": "l-interface", - "label": "hasLInterface", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "service-instance", + "to": "connector", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1465,71 +1429,71 @@ "default": "true" }, { - "from": "pnf", - "to": "lag-interface", - "label": "has", + "from": "service-instance", + "to": "ctag-assignment", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "snapshot", - "label": "uses", + "from": "service-instance", + "to": "cvlan-tag", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "property-constraint", - "label": "uses", + "from": "service-instance", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-subscription", - "to": "service-instance", - "label": "hasInstance", + "from": "service-instance", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "service-instance", - "to": "logical-link", - "label": "uses", + "to": "pnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "service-instance", + "to": "service-instance", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1537,11 +1501,11 @@ "default": "true" }, { - "from": "tenant", - "to": "service-subscription", - "label": "relatedTo", + "from": "service-instance", + "to": "vlan", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1549,45 +1513,45 @@ "default": "true" }, { - "from": "vserver", - "to": "pserver", - "label": "runsOnPserver", + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "vlan", - "label": "dependsOn", + "from": "class-of-service", + "to": "site-pair", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "metadatum", - "label": "hasMetaData", + "from": "routing-instance", + "to": "site-pair-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "instance-group", - "label": "isMemberOf", + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1597,59 +1561,71 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "tenant", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "lag-link", - "label": "usesLAGLink", + "from": "vserver", + "to": "tenant", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "entitlement", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "license", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "subnet", - "label": "hasSubnet", + "from": "port-group", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "tenant", - "label": "belongsTo", + "from": "service-instance", + "to": "vce", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -1657,11 +1633,11 @@ "default": "true" }, { - "from": "cloud-region", - "to": "complex", - "label": "locatedIn", + "from": "vce", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1669,81 +1645,81 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "l3-network", - "label": "usesL3Network", + "from": "vce", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "availability-zone", - "to": "complex", - "label": "groupsResourcesIn", + "from": "vce", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "vf-module", + "to": "l3-network", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "named-query-element", - "label": "startsWith", + "from": "vf-module", + "to": "vnfc", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "service-instance", - "to": "ctag-assignment", - "label": "uses", + "from": "vf-module", + "to": "volume-group", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { "from": "generic-vnf", - "to": "ipsec-configuration", - "label": "uses", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "site-pair-set", - "label": "hasSitePairSet", + "from": "logical-link", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1753,231 +1729,255 @@ "default": "true" }, { - "from": "model", - "to": "model-ver", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "metadatum", - "label": "hasMetaData", + "from": "l3-interface-ipv6-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "network-profile", - "label": "hasNetworkProfile", + "from": "vlan", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "volume-group", - "label": "uses", + "from": "vlan", + "to": "multicast-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "logical-link", - "label": "uses", + "from": "tenant", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "volume-group", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "port-group", - "to": "cvlan-tag", - "label": "hasCTag", + "from": "lag-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "p-interface", - "label": "hasPinterface", + "from": "p-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "image", - "to": "metadatum", - "label": "hasMetaDatum", + "from": "vpls-pe", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "license-key-resource", - "label": "uses", + "from": "vpls-pe", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", + "from": "route-target", "to": "vpn-binding", - "label": "usesVpnBinding", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "l-interface", + "to": "vserver", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "vf-module", + "to": "vserver", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "complex", - "to": "l3-network", - "label": "usesL3Network", + "from": "vnfc", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "oam-network", - "to": "complex", - "label": "definedFor", + "from": "vserver", + "to": "flavor", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "vserver", + "to": "image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "routing-instance", - "to": "site-pair", - "label": "hasSitePair", + "from": "vserver", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "vserver", + "to": "snapshot", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpn-binding", - "to": "route-target", - "label": "has", + "from": "vserver", + "to": "volume", + "label": "tosca.relationships.AttachesTo", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "${direction}", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "tunnel-xconnect", - "label": "has", + "from": "metadatum", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "instance-group", - "label": "isMemberOf", + "from": "zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" } ] diff --git a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v11.json b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v11.json index e369390b..a32ba86e 100644 --- a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v11.json +++ b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v11.json @@ -61,11 +61,11 @@ "default": "true" }, { - "from": "vlan", - "to": "multicast-configuration", - "label": "uses", + "from": "allotted-resource", + "to": "allotted-resource", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -73,23 +73,23 @@ "default": "true" }, { - "from": "vnfc", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "allotted-resource", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "allotted-resource", - "to": "l-interface", - "label": "uses", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -97,57 +97,33 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "vf-module", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "logical-link", - "to": "vpn-binding", - "label": "uses", + "from": "allotted-resource", + "to": "l3-network", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "flavor", - "label": "hasFlavor", + "from": "allotted-resource", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "l-interface", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "allotted-resource", "to": "network-policy", - "label": "uses", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2ONE", "contains-other-v": "NONE", @@ -157,93 +133,93 @@ "default": "true" }, { - "from": "vserver", - "to": "vnfc", - "label": "hosts", + "from": "allotted-resource", + "to": "vlan", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "cloud-region", - "to": "volume-group", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "service-instance", - "label": "hasServiceInstance", + "from": "allotted-resource", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "service-instance", - "label": "dependsOn", + "from": "tunnel-xconnect", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "flavor", - "label": "has", + "from": "availability-zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "pserver", - "label": "runsOnPserver", + "from": "availability-zone", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vip-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "availability-zone", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "cloud-region", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "logical-link", - "to": "pnf", - "label": "bridgedTo", + "from": "cloud-region", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -253,189 +229,201 @@ "default": "true" }, { - "from": "virtual-data-center", - "to": "generic-vnf", - "label": "hasVNF", + "from": "cloud-region", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "p-interface", - "label": "hasPinterface", + "from": "dvs-switch", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vip-ipv4-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "flavor", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "pnf", - "label": "hostedOn", + "from": "group-assignment", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "p-interface", - "to": "physical-link", - "label": "usesPhysicalLink", + "from": "image", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-ver", - "label": "isA", + "from": "oam-network", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pnf", - "to": "complex", - "label": "locatedIn", + "from": "snapshot", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "tenant", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "oam-network", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "vip-ipv4-address-list", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pserver", - "to": "zone", - "label": "isMemberOf", + "from": "vip-ipv6-address-list", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-network", - "to": "segmentation-assignment", - "label": "has", + "from": "volume-group", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "complex", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "configuration", - "to": "metadatum", - "label": "owns", + "from": "ctag-pool", + "to": "complex", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "license", - "label": "has", + "from": "configuration", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "related-lookup", - "label": "uses", + "from": "configuration", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "p-interface", - "label": "hasPinterface", + "from": "metadatum", + "to": "configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vip-ipv6-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "connector", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -445,59 +433,59 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "vserver", - "label": "runsOnVserver", + "from": "metadatum", + "to": "connector", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "lag-interface", - "label": "hasLAGinterface", + "from": "element-choice-set", + "to": "constrained-element-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnfc", - "label": "uses", + "from": "ctag-pool", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-network", - "to": "service-instance", - "label": "hasInstance", + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "model", - "label": "relatedTo", + "from": "dvs-switch", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -505,33 +493,33 @@ "default": "true" }, { - "from": "vf-module", - "to": "vnfc", - "label": "uses", + "from": "model-element", + "to": "element-choice-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "entitlement", - "label": "has", + "from": "entitlement", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vip-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "generic-vnf", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -541,9 +529,9 @@ "default": "true" }, { - "from": "availability-zone", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "generic-vnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -553,33 +541,21 @@ "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "l3-network", - "label": "isMemberOf", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "cloud-region", - "to": "vip-ipv6-address-list", - "label": "hasIpAddress", + "from": "generic-vnf", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "route-table-reference", - "label": "uses", + "from": "generic-vnf", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -589,45 +565,45 @@ "default": "true" }, { - "from": "model-element", - "to": "constrained-element-set", - "label": "connectsTo", + "from": "generic-vnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "configuration", - "to": "allotted-resource", - "label": "uses", + "from": "generic-vnf", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "configuration", - "to": "allotted-resource", - "label": "uses", + "from": "generic-vnf", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "dvs-switch", - "to": "availability-zone", - "label": "existsIn", + "from": "generic-vnf", + "to": "license-key-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -637,129 +613,117 @@ "default": "true" }, { - "from": "pserver", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "generic-vnf", + "to": "pnf", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "complex", - "label": "locatedIn", + "from": "generic-vnf", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "allotted-resource", - "to": "vlan", - "label": "isPartOf", + "from": "vnfc", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "zone", - "to": "complex", - "label": "existsIn", + "from": "generic-vnf", + "to": "vnf-image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "ctag-pool", - "to": "availability-zone", - "label": "supportsAvailabilityZone", + "from": "generic-vnf", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "owning-entity", - "to": "service-instance", - "label": "owns", + "from": "generic-vnf", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "vce", - "to": "port-group", - "label": "hasPortGroup", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "complex", - "label": "locatedIn", + "from": "lag-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair-set", - "to": "routing-instance", - "label": "hasRoutingInstance", + "from": "license", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "l-interface", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", + "from": "network-profile", "to": "generic-vnf", - "label": "isPartOf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -769,201 +733,189 @@ "default": "true" }, { - "from": "vnfc", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "service-instance", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "site-pair-set", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "vserver", - "label": "runsOnVserver", + "from": "vf-module", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "pserver", - "label": "bridgedTo", + "from": "pserver", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "oam-network", - "label": "has", + "from": "tenant", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "dvs-switch", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "service-instance", - "to": "allotted-resource", - "label": "has", + "from": "metadatum", + "to": "image", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "uses", + "from": "instance-group", + "to": "model", + "label": "org.onap.relationships.inventory.Targets", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "configuration", - "label": "uses", + "from": "vig-server", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "subnet", - "to": "host-route", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "lag-link", - "label": "usesLAGLink", + "from": "l3-interface-ipv4-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "generic-vnf", - "label": "bridgedTo", + "from": "l3-interface-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vce", - "to": "entitlement", - "label": "has", + "from": "l3-interface-ipv6-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "sriov-vf", - "label": "has", + "from": "l3-interface-ipv6-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "model", - "label": "isA", + "from": "l3-interface-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "group-assignment", - "to": "pserver", - "label": "has", + "from": "ctag-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vnfc", + "from": "l3-network", "to": "instance-group", - "label": "isMemberOf", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -973,21 +925,21 @@ "default": "true" }, { - "from": "service-instance", - "to": "cvlan-tag", - "label": "hasIPAGFacingVLAN", + "from": "l3-network", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "l3-network", + "to": "route-table-reference", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -997,155 +949,203 @@ "default": "true" }, { - "from": "line-of-business", - "to": "generic-vnf", - "label": "realizedBy", + "from": "l3-network", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "segmentation-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "service-instance", + "to": "l3-network", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "pserver", - "label": "runsOnPserver", + "from": "subnet", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "instance-group", - "label": "isMemberOf", + "from": "lag-interface", + "to": "lag-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "lag-interface", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "lag-interface", + "to": "p-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "subnet", - "label": "hasSubnet", + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "tenant", - "label": "belongsTo", + "from": "line-of-business", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "complex", - "label": "locatedIn", + "from": "l3-interface-ipv4-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "l3-interface-ipv6-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "l-interface", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", + "direction": "OUT", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "l3-network", - "label": "usesL3Network", + "from": "l-interface", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "availability-zone", - "to": "complex", - "label": "groupsResourcesIn", + "from": "sriov-vf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "vpn-binding", - "label": "belongsTo", + "from": "vlan", + "to": "l-interface", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "project", - "to": "service-instance", - "label": "created", + "from": "logical-link", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1153,9 +1153,9 @@ "default": "true" }, { - "from": "platform", + "from": "logical-link", "to": "generic-vnf", - "label": "uses", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1165,9 +1165,9 @@ "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "logical-link", + "to": "lag-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1177,45 +1177,45 @@ "default": "true" }, { - "from": "port-group", - "to": "cvlan-tag", - "label": "hasCTag", + "from": "logical-link", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "image", - "to": "metadatum", - "label": "hasMetaDatum", + "from": "logical-link", + "to": "pnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vnfc", - "to": "vip-ipv6-address-list", - "label": "uses", + "from": "logical-link", + "to": "pserver", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "oam-network", - "to": "complex", - "label": "definedFor", + "from": "logical-link", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1225,201 +1225,189 @@ "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "model-ver", + "to": "model", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "routing-instance", - "to": "site-pair", - "label": "hasSitePair", + "from": "constrained-element-set", + "to": "model-constraint", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpn-binding", - "to": "route-target", - "label": "has", + "from": "constrained-element-set", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "tunnel-xconnect", - "label": "has", + "from": "model-constraint", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "instance-group", - "label": "isMemberOf", + "from": "model-element", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "ipsec-configuration", - "to": "vig-server", - "label": "hasVigServer", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-constraint", - "to": "constrained-element-set", - "label": "uses", + "from": "named-query", + "to": "model", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "l-interface", - "label": "has", + "from": "named-query-element", + "to": "named-query", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "p-interface", - "label": "usesPInterface", + "from": "named-query-element", + "to": "model", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-constraint", - "label": "uses", + "from": "named-query-element", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "virtual-data-center", - "label": "contains", + "from": "property-constraint", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-element", - "to": "model-element", - "label": "connectsTo", + "from": "related-lookup", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, - { - "from": "tenant", - "to": "vserver", - "label": "owns", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", - "default": "true" - }, { "from": "l-interface", - "to": "vlan", - "label": "hasVlan", + "to": "newvce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "oam-network", + "to": "complex", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "instance-group", - "to": "model", - "label": "targets", + "from": "oam-network", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1430,34 +1418,46 @@ }, { "from": "service-instance", - "to": "zone", - "label": "locatedIn", + "to": "owning-entity", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "l-interface", + "to": "p-interface", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "p-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "configuration", - "to": "logical-link", - "label": "has", + "from": "p-interface", + "to": "physical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", @@ -1465,23 +1465,23 @@ "default": "true" }, { - "from": "configuration", - "to": "logical-link", - "label": "has", + "from": "sriov-pf", + "to": "p-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "pnf", - "label": "uses", + "from": "platform", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1489,93 +1489,117 @@ "default": "true" }, { - "from": "l3-network", - "to": "ctag-assignment", - "label": "hasCtagAssignment", + "from": "lag-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "instance-group", - "label": "isMemberOf", + "from": "p-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "vf-module", - "label": "isPartOf", + "from": "pnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "complex", - "to": "ctag-pool", - "label": "hasCtagPool", + "from": "pnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "constrained-element-set", - "to": "element-choice-set", - "label": "uses", + "from": "pnf", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "cvlan-tag", + "to": "port-group", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "complex", - "label": "locatedIn", + "from": "project", + "to": "service-instance", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "image", - "label": "hasImage", + "from": "lag-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "p-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "pserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", @@ -1585,23 +1609,23 @@ "default": "true" }, { - "from": "tenant", - "to": "l3-network", - "label": "usesL3Network", + "from": "pserver", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", + "from": "pserver", "to": "complex", - "label": "existsIn", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -1609,11 +1633,11 @@ "default": "true" }, { - "from": "logical-link", - "to": "cloud-region", - "label": "existsIn", + "from": "pserver", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1621,47 +1645,47 @@ "default": "true" }, { - "from": "sriov-vf", - "to": "sriov-pf", - "label": "uses", + "from": "site-pair", + "to": "routing-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "customer", - "to": "service-subscription", - "label": "subscribesTo", + "from": "allotted-resource", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "newvce", - "to": "l-interface", - "label": "hasLInterface", + "from": "metadatum", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", + "from": "service-instance", "to": "allotted-resource", - "label": "bindsTo", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1669,9 +1693,21 @@ "default": "true" }, { - "from": "allotted-resource", - "to": "l3-network", - "label": "isPartOf", + "from": "service-instance", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "service-instance", + "to": "connector", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1681,83 +1717,83 @@ "default": "true" }, { - "from": "p-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "service-instance", + "to": "ctag-assignment", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "availability-zone", - "label": "existsIn", + "from": "service-instance", + "to": "cvlan-tag", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "complex", - "label": "locatedIn", + "from": "service-instance", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "model-ver", - "to": "metadatum", - "label": "hasMetaData", + "from": "service-instance", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "volume", - "label": "hasVolume", + "from": "service-instance", + "to": "pnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "vip-ipv4-address-list", - "label": "hasIpAddress", + "from": "service-instance", + "to": "service-instance", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "zone", - "label": "isMemberOf", + "from": "service-instance", + "to": "vlan", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1765,11 +1801,11 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "service-instance", - "label": "hasInstance", + "from": "service-instance", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -1777,35 +1813,47 @@ "default": "true" }, { - "from": "cloud-region", - "to": "availability-zone", - "label": "has", + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "class-of-service", + "to": "site-pair", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair", - "to": "class-of-service", - "label": "hasClassOfService", + "from": "routing-instance", + "to": "site-pair-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "instance-group", - "label": "memberOf", + "from": "sriov-vf", + "to": "sriov-pf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1813,141 +1861,129 @@ "default": "true" }, { - "from": "element-choice-set", - "to": "model-element", - "label": "has", + "from": "host-route", + "to": "subnet", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "network-policy", - "label": "uses", + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnf-image", - "label": "usesVnfImage", + "from": "tenant", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "vserver", + "to": "tenant", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "l-interface", - "label": "hasLInterface", + "from": "entitlement", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license", - "label": "has", + "from": "license", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "zone", - "label": "isMemberOf", + "from": "port-group", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "service-instance", + "to": "vce", + "label": "org.onap.relationships.inventory.ComposedOf", + "direction": "OUT", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vnfc", - "to": "vip-ipv4-address-list", - "label": "uses", + "from": "vce", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "lag-interface", - "to": "logical-link", - "label": "uses", + "from": "vce", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "p-interface", - "to": "sriov-pf", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "l3-interface-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "volume-group", - "label": "uses", + "from": "vce", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", @@ -1957,57 +1993,45 @@ "default": "true" }, { - "from": "cloud-region", + "from": "vf-module", "to": "l3-network", - "label": "uses", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "group-assignment", - "label": "has", + "from": "vf-module", + "to": "vnfc", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "group-assignment", - "to": "tenant", - "label": "has", - "direction": "OUT", - "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "l-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "vf-module", + "to": "volume-group", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "virtual-data-center", - "to": "logical-link", - "label": "contains", + "from": "vip-ipv4-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -2017,21 +2041,21 @@ "default": "true" }, { - "from": "named-query-element", - "to": "named-query-element", - "label": "connectsTo", + "from": "vip-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "connector", - "label": "uses", + "from": "vip-ipv6-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -2041,23 +2065,23 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "vip-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pserver", - "to": "cloud-region", - "label": "locatedIn", + "from": "generic-vnf", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -2065,141 +2089,105 @@ "default": "true" }, { - "from": "vf-module", - "to": "l3-network", - "label": "uses", + "from": "logical-link", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "cloud-region", - "to": "snapshot", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "tenant", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "cloud-region", - "to": "image", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "model-ver", - "to": "model-element", - "label": "startsWith", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "l-interface", - "label": "hasLInterface", + "from": "l3-interface-ipv6-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "lag-interface", - "label": "has", + "from": "vlan", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "snapshot", - "label": "uses", + "from": "vlan", + "to": "multicast-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "property-constraint", - "label": "uses", + "from": "l3-interface-ipv4-address-list", + "to": "vnfc", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-subscription", - "to": "service-instance", - "label": "hasInstance", + "from": "l3-interface-ipv6-address-list", + "to": "vnfc", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "logical-link", - "label": "uses", + "from": "vnfc", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "tenant", - "to": "service-subscription", - "label": "relatedTo", + "from": "vnfc", + "to": "vip-ipv4-address-list", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -2209,11 +2197,11 @@ "default": "true" }, { - "from": "service-instance", - "to": "vlan", - "label": "dependsOn", + "from": "vnfc", + "to": "vip-ipv6-address-list", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -2221,71 +2209,71 @@ "default": "true" }, { - "from": "service-instance", - "to": "metadatum", - "label": "hasMetaData", + "from": "tenant", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "lag-link", - "label": "usesLAGLink", + "from": "volume-group", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { "from": "lag-interface", - "to": "l-interface", - "label": "hasLInterface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "named-query-element", - "label": "startsWith", + "from": "p-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "ctag-assignment", - "label": "uses", + "from": "vpls-pe", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "ipsec-configuration", - "label": "uses", + "from": "vpls-pe", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -2293,95 +2281,95 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "site-pair-set", - "label": "hasSitePairSet", + "from": "route-target", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model", - "to": "model-ver", - "label": "has", + "from": "l-interface", + "to": "vserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "metadatum", - "label": "hasMetaData", + "from": "vf-module", + "to": "vserver", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "network-profile", - "label": "hasNetworkProfile", + "from": "vnfc", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "volume-group", - "label": "uses", + "from": "vserver", + "to": "flavor", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "configuration", - "label": "has", + "from": "vserver", + "to": "image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "configuration", - "label": "has", + "from": "vserver", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "logical-link", - "to": "logical-link", - "label": "uses", + "from": "vserver", + "to": "snapshot", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -2389,64 +2377,40 @@ "default": "true" }, { - "from": "vpls-pe", - "to": "p-interface", - "label": "hasPinterface", + "from": "vserver", + "to": "volume", + "label": "tosca.relationships.AttachesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "${direction}", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license-key-resource", - "label": "uses", + "from": "metadatum", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "vpn-binding", - "label": "usesVpnBinding", + "from": "zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" - }, - { - "from": "complex", - "to": "l3-network", - "label": "usesL3Network", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "vlan", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" } ] } diff --git a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v12.json b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v12.json index ff813a48..4b33f0f2 100644 --- a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v12.json +++ b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v12.json @@ -61,2488 +61,2812 @@ "default": "true" }, { - "from": "vlan", - "to": "multicast-configuration", - "label": "uses", + "from": "allotted-resource", + "to": "allotted-resource", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vnfc", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "allotted-resource", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "allotted-resource", - "to": "l-interface", - "label": "uses", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "vf-module", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "vpn-binding", - "label": "uses", + "from": "allotted-resource", + "to": "l3-network", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "flavor", - "label": "hasFlavor", + "from": "allotted-resource", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "l-interface", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "allotted-resource", "to": "network-policy", - "label": "uses", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "vnfc", - "label": "hosts", + "from": "allotted-resource", + "to": "vlan", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "cloud-region", - "to": "volume-group", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "vce", - "to": "service-instance", - "label": "hasServiceInstance", + "from": "allotted-resource", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", - "prevent-delete": "NONE", - "default": "true" + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "service-instance", - "label": "dependsOn", + "from": "tunnel-xconnect", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "flavor", - "label": "has", + "from": "availability-zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "pserver", - "label": "runsOnPserver", + "from": "availability-zone", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vip-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "availability-zone", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "cloud-region", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "pnf", - "label": "bridgedTo", + "from": "cloud-region", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "virtual-data-center", - "to": "generic-vnf", - "label": "hasVNF", + "from": "cloud-region", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pnf", - "to": "p-interface", - "label": "hasPinterface", + "from": "dvs-switch", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "vip-ipv4-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "flavor", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "pnf", - "label": "hostedOn", + "from": "group-assignment", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "p-interface", - "to": "physical-link", - "label": "usesPhysicalLink", + "from": "image", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "model-element", - "to": "model-ver", - "label": "isA", + "from": "oam-network", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pnf", - "to": "complex", - "label": "locatedIn", + "from": "snapshot", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-interface-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "tenant", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "oam-network", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "vip-ipv4-address-list", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pserver", - "to": "zone", - "label": "isMemberOf", + "from": "vip-ipv6-address-list", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "segmentation-assignment", - "label": "has", + "from": "volume-group", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "metadatum", - "label": "owns", + "from": "complex", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vce", - "to": "license", - "label": "has", + "from": "ctag-pool", + "to": "complex", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query-element", - "to": "related-lookup", - "label": "uses", + "from": "configuration", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pserver", - "to": "p-interface", - "label": "hasPinterface", + "from": "configuration", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vip-ipv6-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "metadatum", + "to": "configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "vserver", - "label": "runsOnVserver", + "from": "connector", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vpls-pe", - "to": "lag-interface", - "label": "hasLAGinterface", + "from": "metadatum", + "to": "connector", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "vnfc", - "label": "uses", + "from": "element-choice-set", + "to": "constrained-element-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "service-instance", - "label": "hasInstance", + "from": "ctag-pool", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query", - "to": "model", - "label": "relatedTo", + "from": "dvs-switch", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vf-module", - "to": "vnfc", - "label": "uses", + "from": "model-element", + "to": "element-choice-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "${direction}", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "entitlement", - "label": "has", + "from": "entitlement", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vip-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "generic-vnf", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "availability-zone", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "generic-vnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "l3-interface-ipv4-address-list", - "to": "l3-network", - "label": "isMemberOf", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "vip-ipv6-address-list", - "label": "hasIpAddress", + "from": "generic-vnf", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "route-table-reference", - "label": "uses", + "from": "generic-vnf", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "model-element", - "to": "constrained-element-set", - "label": "connectsTo", + "from": "generic-vnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "allotted-resource", - "label": "uses", + "from": "generic-vnf", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "dvs-switch", - "to": "availability-zone", - "label": "existsIn", + "from": "generic-vnf", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "pserver", - "to": "lag-interface", - "label": "hasLAGInterface", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vpls-pe", - "to": "complex", - "label": "locatedIn", + "from": "generic-vnf", + "to": "license-key-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", - "to": "vlan", - "label": "isPartOf", + "from": "generic-vnf", + "to": "pnf", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "zone", - "to": "complex", - "label": "existsIn", + "from": "generic-vnf", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "ctag-pool", - "to": "availability-zone", - "label": "supportsAvailabilityZone", + "from": "vnfc", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "generic-vnf", + "to": "vnf-image", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "owning-entity", - "to": "service-instance", - "label": "owns", + "from": "generic-vnf", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vce", - "to": "port-group", - "label": "hasPortGroup", + "from": "generic-vnf", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vce", - "to": "complex", - "label": "locatedIn", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "from": "lag-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "site-pair-set", - "to": "routing-instance", - "label": "hasRoutingInstance", + "from": "license", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "l-interface", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", + "from": "network-profile", "to": "generic-vnf", - "label": "isPartOf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vnfc", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "service-instance", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "operational-environment", - "to": "operational-environment", - "label": "managedBy", - "direction": "OUT", - "multiplicity": "One2One", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vce", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "site-pair-set", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "vce", - "to": "vserver", - "label": "runsOnVserver", + "from": "vf-module", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "pserver", - "label": "bridgedTo", + "from": "pserver", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "cloud-region", - "to": "oam-network", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", "prevent-delete": "${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "dvs-switch", - "label": "has", + "from": "tenant", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "has", + "from": "metadatum", + "to": "image", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "uses", + "from": "instance-group", + "to": "model", + "label": "org.onap.relationships.inventory.Targets", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "configuration", - "label": "uses", + "from": "vig-server", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "subnet", - "to": "host-route", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "lag-interface", - "to": "lag-link", - "label": "usesLAGLink", + "from": "l3-interface-ipv4-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "generic-vnf", - "label": "bridgedTo", + "from": "l3-interface-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "vce", - "to": "entitlement", - "label": "has", + "from": "l3-interface-ipv6-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "sriov-vf", - "label": "has", + "from": "l3-interface-ipv6-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query-element", - "to": "model", - "label": "isA", + "from": "l3-interface-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "group-assignment", - "to": "pserver", - "label": "has", + "from": "ctag-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "vnfc", + "from": "l3-network", "to": "instance-group", - "label": "isMemberOf", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "cvlan-tag", - "label": "hasIPAGFacingVLAN", + "from": "l3-network", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "l3-network", + "to": "route-table-reference", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "line-of-business", - "to": "generic-vnf", - "label": "realizedBy", + "from": "l3-network", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "l3-interface-ipv6-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "segmentation-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "pserver", - "label": "runsOnPserver", + "from": "service-instance", + "to": "l3-network", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "operational-environment", - "to": "operational-environment", - "label": "managedBy", + "from": "subnet", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", - "to": "instance-group", - "label": "isMemberOf", + "from": "lag-interface", + "to": "lag-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "lag-interface", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "l3-interface-ipv4-address-list", - "to": "instance-group", - "label": "isMemberOf", + "from": "lag-interface", + "to": "p-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "subnet", - "label": "hasSubnet", + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "volume-group", - "to": "tenant", - "label": "belongsTo", + "from": "line-of-business", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "complex", - "label": "locatedIn", + "from": "l3-interface-ipv4-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "l3-interface-ipv6-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "l-interface", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", + "direction": "OUT", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "l3-network", - "label": "usesL3Network", + "from": "l-interface", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "availability-zone", - "to": "complex", - "label": "groupsResourcesIn", + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Source", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" }, { - "from": "allotted-resource", - "to": "vpn-binding", - "label": "belongsTo", + "from": "logical-link", + "to": "l-interface", + "label": "org.onap.relationships.inventory.Destination", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "false", + "description":"" + }, + { + "from": "sriov-vf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "project", - "to": "service-instance", - "label": "created", + "from": "vlan", + "to": "l-interface", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "logical-link", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "platform", + "from": "logical-link", "to": "generic-vnf", - "label": "uses", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-interface-ipv6-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "logical-link", + "to": "lag-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "port-group", - "to": "cvlan-tag", - "label": "hasCTag", + "from": "logical-link", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "image", - "to": "metadatum", - "label": "hasMetaDatum", + "from": "logical-link", + "to": "pnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vnfc", - "to": "vip-ipv6-address-list", - "label": "uses", + "from": "logical-link", + "to": "pserver", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "oam-network", - "to": "complex", - "label": "definedFor", + "from": "logical-link", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vlan", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "model-ver", + "to": "model", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "routing-instance", - "to": "site-pair", - "label": "hasSitePair", + "from": "constrained-element-set", + "to": "model-constraint", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vpn-binding", - "to": "route-target", - "label": "has", + "from": "constrained-element-set", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", - "to": "tunnel-xconnect", - "label": "has", + "from": "model-constraint", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "instance-group", - "label": "isMemberOf", + "from": "model-element", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "ipsec-configuration", - "to": "vig-server", - "label": "hasVigServer", + "from": "metadatum", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "model-constraint", - "to": "constrained-element-set", - "label": "uses", + "from": "named-query", + "to": "model", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "l-interface", - "label": "has", + "from": "named-query-element", + "to": "named-query", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "lag-interface", - "to": "p-interface", - "label": "usesPInterface", + "from": "named-query-element", + "to": "model", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "named-query-element", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "model-element", - "to": "model-constraint", - "label": "uses", + "from": "property-constraint", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "connector", - "to": "virtual-data-center", - "label": "contains", + "from": "related-lookup", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "l-interface", + "to": "newvce", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "oam-network", + "to": "complex", + "label": "org.onap.relationships.inventory.AppliesTo", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "oam-network", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "operational-environment", + "to": "operational-environment", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "model-element", - "to": "model-element", - "label": "connectsTo", + "from": "service-instance", + "to": "owning-entity", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "tenant", - "to": "vserver", - "label": "owns", + "from": "l-interface", + "to": "p-interface", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "vlan", - "label": "hasVlan", + "from": "p-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "p-interface", + "to": "physical-link", + "label": "tosca.relationships.network.LinksTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vpls-pe", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "sriov-pf", + "to": "p-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "instance-group", - "to": "model", - "label": "targets", + "from": "platform", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "zone", - "label": "locatedIn", + "from": "lag-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "p-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "pnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { "from": "pnf", "to": "instance-group", - "label": "isMemberOf", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "logical-link", - "label": "has", + "from": "pnf", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "logical-link", - "label": "has", + "from": "cvlan-tag", + "to": "port-group", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "pnf", - "label": "uses", + "from": "project", + "to": "service-instance", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "ctag-assignment", - "label": "hasCtagAssignment", + "from": "lag-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "instance-group", - "label": "isMemberOf", + "from": "p-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "pserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.MemberOf", + "direction": "OUT", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "vf-module", - "label": "isPartOf", + "from": "pserver", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "complex", - "to": "ctag-pool", - "label": "hasCtagPool", + "from": "pserver", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "pserver", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "site-pair", + "to": "routing-instance", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "constrained-element-set", - "to": "element-choice-set", - "label": "uses", + "from": "allotted-resource", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "p-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "metadatum", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "complex", - "label": "locatedIn", + "from": "service-instance", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "image", - "label": "hasImage", + "from": "service-instance", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "tenant", - "to": "l3-network", - "label": "usesL3Network", + "from": "service-instance", + "to": "connector", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "volume-group", - "to": "complex", - "label": "existsIn", + "from": "service-instance", + "to": "ctag-assignment", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "cloud-region", - "label": "existsIn", + "from": "service-instance", + "to": "cvlan-tag", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "sriov-vf", - "to": "sriov-pf", - "label": "uses", + "from": "service-instance", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "customer", - "to": "service-subscription", - "label": "subscribesTo", + "from": "service-instance", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "newvce", - "to": "l-interface", - "label": "hasLInterface", + "from": "service-instance", + "to": "pnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", - "to": "allotted-resource", - "label": "bindsTo", + "from": "service-instance", + "to": "service-instance", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "allotted-resource", - "to": "l3-network", - "label": "isPartOf", + "from": "service-instance", + "to": "vlan", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "p-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "service-instance", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pserver", - "to": "availability-zone", - "label": "existsIn", + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "pserver", - "to": "complex", - "label": "locatedIn", + "from": "class-of-service", + "to": "site-pair", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", - "default": "true" + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "model-ver", - "to": "metadatum", - "label": "hasMetaData", + "from": "routing-instance", + "to": "site-pair-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "volume", - "label": "hasVolume", + "from": "sriov-vf", + "to": "sriov-pf", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "vip-ipv4-address-list", - "label": "hasIpAddress", + "from": "host-route", + "to": "subnet", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "zone", - "label": "isMemberOf", + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "service-instance", - "label": "hasInstance", + "from": "tenant", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "availability-zone", - "label": "has", + "from": "vserver", + "to": "tenant", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "site-pair", - "to": "class-of-service", - "label": "hasClassOfService", + "from": "entitlement", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "instance-group", - "label": "memberOf", + "from": "license", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "element-choice-set", - "to": "model-element", - "label": "has", + "from": "port-group", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "network-policy", - "label": "uses", + "from": "service-instance", + "to": "vce", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "vnf-image", - "label": "usesVnfImage", + "from": "vce", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" + }, + { + "from": "vce", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vlan", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "vce", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "l-interface", - "label": "hasLInterface", + "from": "vf-module", + "to": "l3-network", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "license", - "label": "has", + "from": "vf-module", + "to": "vnfc", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "${direction}", + "default": "true", + "description":"" }, { - "from": "pnf", - "to": "zone", - "label": "isMemberOf", + "from": "vf-module", + "to": "volume-group", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vnfc", - "to": "vip-ipv4-address-list", - "label": "uses", + "from": "vip-ipv4-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "lag-interface", - "to": "logical-link", - "label": "uses", + "from": "vip-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "p-interface", - "to": "sriov-pf", - "label": "has", + "from": "vip-ipv6-address-list", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l3-interface-ipv6-address-list", + "from": "vip-ipv6-address-list", "to": "subnet", - "label": "isMemberOf", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", - "default": "true" + "default": "true", + "description":"" }, { "from": "generic-vnf", - "to": "volume-group", - "label": "uses", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "l3-network", - "label": "uses", + "from": "logical-link", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "cloud-region", - "to": "group-assignment", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "group-assignment", - "to": "tenant", - "label": "has", + "from": "l3-interface-ipv6-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l-interface", + "from": "vlan", "to": "logical-link", - "label": "usesLogicalLink", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "logical-link", - "label": "sourceLInterface", + "from": "vlan", + "to": "multicast-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "false" + "default": "true", + "description":"" }, { - "from": "l-interface", - "to": "logical-link", - "label": "targetLInterface", + "from": "l3-interface-ipv4-address-list", + "to": "vnfc", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "false" + "default": "true", + "description":"" }, { - "from": "virtual-data-center", - "to": "logical-link", - "label": "contains", + "from": "l3-interface-ipv6-address-list", + "to": "vnfc", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query-element", - "to": "named-query-element", - "label": "connectsTo", + "from": "vnfc", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "connector", - "label": "uses", + "from": "vnfc", + "to": "vip-ipv4-address-list", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "vnfc", + "to": "vip-ipv6-address-list", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pserver", - "to": "cloud-region", - "label": "locatedIn", + "from": "tenant", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vf-module", - "to": "l3-network", - "label": "uses", + "from": "volume-group", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "cloud-region", - "to": "snapshot", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "cloud-region", - "to": "tenant", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "cloud-region", - "to": "image", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "model-ver", - "to": "model-element", - "label": "startsWith", + "from": "lag-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "l-interface", - "label": "hasLInterface", + "from": "p-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "pnf", - "to": "lag-interface", - "label": "has", + "from": "vpls-pe", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "vserver", - "to": "snapshot", - "label": "uses", + "from": "vpls-pe", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query-element", - "to": "property-constraint", - "label": "uses", + "from": "route-target", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-subscription", - "to": "service-instance", - "label": "hasInstance", + "from": "l-interface", + "to": "vserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "logical-link", - "label": "uses", + "from": "vf-module", + "to": "vserver", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "tenant", - "to": "service-subscription", - "label": "relatedTo", + "from": "vnfc", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "vlan", - "label": "dependsOn", + "from": "vserver", + "to": "flavor", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "metadatum", - "label": "hasMetaData", + "from": "vserver", + "to": "image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "lag-link", - "label": "usesLAGLink", + "from": "vserver", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "lag-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "vserver", + "to": "snapshot", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "named-query", - "to": "named-query-element", - "label": "startsWith", + "from": "vserver", + "to": "volume", + "label": "tosca.relationships.AttachesTo", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "${direction}", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "ctag-assignment", - "label": "uses", + "from": "zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" + "prevent-delete": "!${direction}", + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "ipsec-configuration", - "label": "uses", + "from": "allotted-resource", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "Many2One", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "generic-vnf", - "to": "site-pair-set", - "label": "hasSitePairSet", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "Many2One", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "model", + "from": "l3-network", "to": "model-ver", - "label": "has", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "Many2One", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "connector", - "to": "metadatum", - "label": "hasMetaData", + "from": "logical-link", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "Many2One", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "network-profile", - "label": "hasNetworkProfile", + "from": "service-instance", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "Many2One", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "vf-module", - "to": "volume-group", - "label": "uses", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "Many2One", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "service-instance", - "to": "configuration", - "label": "has", + "from": "configuration", + "to": "l-interface", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "logical-link", - "to": "logical-link", - "label": "uses", + "from": "configuration", + "to": "pnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "vpls-pe", - "to": "p-interface", - "label": "hasPinterface", + "from": "forwarder", + "to": "forwarding-path", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "generic-vnf", - "to": "license-key-resource", - "label": "uses", + "from": "forwarding-path", + "to": "service-instance", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" + "prevent-delete": "NONE", + "default": "true", + "description":"" }, { - "from": "l3-network", - "to": "vpn-binding", - "label": "usesVpnBinding", + "from": "forwarder", + "to": "l-interface", + "label": "org.onap.relationships.inventory.ForwardsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "complex", - "to": "l3-network", - "label": "usesL3Network", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "vlan", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "l-interface", - "label": "has", + "from": "forwarder", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "configuration", - "to": "pnf", - "label": "uses", + "from": "forwarding-path", + "to": "configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { "from": "forwarder", - "to": "p-interface", - "label": "forwardsTo", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.ForwardsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "forwarder", - "to": "l-interface", - "label": "forwardsTo", + "from": "evc", + "to": "configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "forwarder", - "to": "forwarding-path", - "label": "belongsTo", + "from": "forwarder-evc", + "to": "configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2ONE", "contains-other-v": "!${direction}", "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" }, { - "from": "forwarding-path", - "to": "service-instance", - "label": "implements", + "from": "forwarder", + "to": "p-interface", + "label": "org.onap.relationships.inventory.ForwardsTo", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description":"" } ] } diff --git a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v8.json b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v8.json index 9997468f..0e9eebb0 100644 --- a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v8.json +++ b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v8.json @@ -1,189 +1,165 @@ { "rules": [ { - "from": "ipsec-configuration", - "to": "vig-server", - "label": "hasVigServer", + "from": "availability-zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vlan", - "to": "multicast-configuration", - "label": "uses", + "from": "availability-zone", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "lag-interface", - "label": "hasLAGInterface", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-constraint", - "to": "constrained-element-set", - "label": "uses", + "from": "availability-zone", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vf-module", - "label": "has", + "from": "cloud-region", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "lag-interface", - "to": "p-interface", - "label": "usesPInterface", + "from": "cloud-region", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-element", - "to": "model-constraint", - "label": "uses", + "from": "dvs-switch", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "connector", - "to": "virtual-data-center", - "label": "contains", + "from": "flavor", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-element", - "label": "connectsTo", + "from": "group-assignment", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "tenant", - "to": "vserver", - "label": "owns", + "from": "image", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "flavor", - "label": "hasFlavor", + "from": "oam-network", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "vlan", - "label": "hasVlan", + "from": "snapshot", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "tenant", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "model", - "to": "metadatum", - "label": "hasMetaData", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vpls-pe", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "volume-group", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "vnfc", - "label": "hosts", + "from": "complex", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -193,179 +169,155 @@ "default": "true" }, { - "from": "cloud-region", - "to": "volume-group", - "label": "has", + "from": "ctag-pool", + "to": "complex", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "l3-network", - "to": "ctag-assignment", - "label": "hasCtagAssignment", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "service-instance", - "label": "hasServiceInstance", + "from": "connector", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "service-instance", - "label": "dependsOn", + "from": "metadatum", + "to": "connector", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "flavor", - "label": "has", + "from": "element-choice-set", + "to": "constrained-element-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "pserver", - "label": "runsOnPserver", + "from": "ctag-pool", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "logical-link", - "to": "pnf", - "label": "bridgedTo", + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "virtual-data-center", - "to": "generic-vnf", - "label": "hasVNF", + "from": "dvs-switch", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pnf", - "to": "p-interface", - "label": "hasPinterface", + "from": "model-element", + "to": "element-choice-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "vf-module", - "label": "isPartOf", + "from": "generic-vnf", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "complex", - "to": "ctag-pool", - "label": "hasCtagPool", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "constrained-element-set", - "to": "element-choice-set", - "label": "uses", + "from": "generic-vnf", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "generic-vnf", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "physical-link", - "label": "usesPhysicalLink", + "from": "generic-vnf", + "to": "license-key-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "image", - "label": "hasImage", + "from": "generic-vnf", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -373,35 +325,23 @@ "default": "true" }, { - "from": "pnf", - "to": "complex", - "label": "locatedIn", + "from": "vnfc", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "tenant", - "to": "l3-network", - "label": "usesL3Network", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "generic-vnf", + "to": "vnf-image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -409,225 +349,213 @@ "default": "true" }, { - "from": "volume-group", - "to": "complex", - "label": "existsIn", + "from": "generic-vnf", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "oam-network", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "generic-vnf", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "customer", - "to": "service-subscription", - "label": "subscribesTo", + "from": "lag-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "segmentation-assignment", - "label": "has", + "from": "l-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "related-lookup", - "label": "uses", + "from": "network-profile", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "p-interface", - "label": "hasPinterface", + "from": "service-instance", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "newvce", - "to": "l-interface", - "label": "hasLInterface", + "from": "site-pair-set", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "p-interface", - "to": "logical-link", - "label": "usesLogicalLink", - "direction": "OUT", - "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vserver", - "label": "runsOnVserver", + "from": "vf-module", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { "from": "pserver", - "to": "availability-zone", - "label": "existsIn", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "vpls-pe", - "to": "lag-interface", - "label": "hasLAGinterface", + "from": "tenant", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnfc", - "label": "uses", + "from": "metadatum", + "to": "image", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "service-instance", - "label": "hasInstance", + "from": "vig-server", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "model", - "label": "relatedTo", + "from": "l3-interface-ipv4-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "vnfc", - "label": "uses", + "from": "l3-interface-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pserver", - "to": "complex", - "label": "locatedIn", + "from": "l3-interface-ipv6-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "availability-zone", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "l3-interface-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "volume", - "label": "hasVolume", + "from": "ctag-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "l3-network", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -637,275 +565,299 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "service-instance", - "label": "hasInstance", + "from": "l3-network", + "to": "route-table-reference", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "l3-network", - "to": "route-table-reference", - "label": "uses", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "constrained-element-set", - "label": "connectsTo", + "from": "segmentation-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "dvs-switch", - "to": "availability-zone", - "label": "existsIn", + "from": "service-instance", + "to": "l3-network", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "subnet", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "availability-zone", - "label": "has", + "from": "lag-interface", + "to": "lag-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "complex", - "label": "locatedIn", + "from": "lag-interface", + "to": "p-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair", - "to": "class-of-service", - "label": "hasClassOfService", + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "element-choice-set", - "to": "model-element", - "label": "has", + "from": "l3-interface-ipv4-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "ctag-pool", - "to": "availability-zone", - "label": "supportsAvailabilityZone", + "from": "l3-interface-ipv6-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "network-policy", - "label": "uses", + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "port-group", - "label": "hasPortGroup", + "from": "sriov-vf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "vlan", + "to": "l-interface", + "label": "tosca.relationships.network.LinksTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "logical-link", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "complex", - "label": "locatedIn", + "from": "logical-link", + "to": "lag-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnf-image", - "label": "usesVnfImage", + "from": "logical-link", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "site-pair-set", - "to": "routing-instance", - "label": "hasRoutingInstance", + "from": "logical-link", + "to": "pnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "logical-link", + "to": "pserver", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "l-interface", - "label": "hasLInterface", + "from": "constrained-element-set", + "to": "model-constraint", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "constrained-element-set", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "model-constraint", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "vserver", - "label": "runsOnVserver", + "from": "model-element", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "named-query", + "to": "model", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "volume-group", - "label": "uses", + "from": "named-query-element", + "to": "named-query", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "pserver", - "label": "bridgedTo", + "from": "named-query-element", + "to": "model", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -913,237 +865,249 @@ "default": "true" }, { - "from": "cloud-region", - "to": "oam-network", - "label": "has", + "from": "named-query-element", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "dvs-switch", - "label": "has", + "from": "property-constraint", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "l3-network", - "label": "uses", + "from": "related-lookup", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "group-assignment", - "label": "has", + "from": "l-interface", + "to": "newvce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "group-assignment", - "to": "tenant", - "label": "has", + "from": "oam-network", + "to": "complex", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "oam-network", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "l-interface", + "to": "p-interface", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "virtual-data-center", + "from": "p-interface", "to": "logical-link", - "label": "contains", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "named-query-element", - "label": "connectsTo", + "from": "p-interface", + "to": "physical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "connector", - "label": "uses", + "from": "lag-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "lag-link", - "label": "usesLAGLink", + "from": "p-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "cloud-region", - "label": "locatedIn", + "from": "pnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "logical-link", - "to": "generic-vnf", - "label": "bridgedTo", + "from": "cvlan-tag", + "to": "port-group", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "l3-network", - "label": "uses", + "from": "lag-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "sriov-vf", - "label": "has", + "from": "p-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "model", - "label": "isA", + "from": "pserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "group-assignment", - "to": "pserver", - "label": "has", + "from": "pserver", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "snapshot", - "label": "has", + "from": "pserver", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "tenant", - "label": "has", + "from": "site-pair", + "to": "routing-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "image", - "label": "has", + "from": "metadatum", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { "from": "service-instance", - "to": "cvlan-tag", - "label": "hasIPAGFacingVLAN", + "to": "connector", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1153,93 +1117,105 @@ "default": "true" }, { - "from": "vserver", - "to": "l-interface", - "label": "hasLInterface", + "from": "service-instance", + "to": "cvlan-tag", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "lag-interface", - "label": "has", + "from": "service-instance", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "snapshot", - "label": "uses", + "from": "service-instance", + "to": "service-instance", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "ONE2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-element", - "to": "model", - "label": "isA", + "from": "service-instance", + "to": "vlan", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "property-constraint", - "label": "uses", + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "class-of-service", + "to": "site-pair", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-subscription", - "to": "service-instance", - "label": "hasInstance", + "from": "routing-instance", + "to": "site-pair-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "logical-link", - "label": "uses", + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "tenant", - "to": "service-subscription", - "label": "relatedTo", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1250,44 +1226,56 @@ }, { "from": "vserver", - "to": "pserver", - "label": "runsOnPserver", + "to": "tenant", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, + { + "from": "port-group", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, { "from": "service-instance", - "to": "vlan", - "label": "dependsOn", + "to": "vce", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "metadatum", - "label": "hasMetaData", + "from": "vce", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "vce", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1297,11 +1285,11 @@ "default": "true" }, { - "from": "logical-link", - "to": "lag-link", - "label": "usesLAGLink", + "from": "vce", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -1309,45 +1297,45 @@ "default": "true" }, { - "from": "l3-network", - "to": "subnet", - "label": "hasSubnet", + "from": "vf-module", + "to": "l3-network", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "tenant", - "label": "belongsTo", + "from": "vf-module", + "to": "vnfc", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "complex", - "label": "locatedIn", + "from": "vf-module", + "to": "volume-group", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { "from": "generic-vnf", - "to": "l3-network", - "label": "usesL3Network", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1357,57 +1345,57 @@ "default": "true" }, { - "from": "availability-zone", - "to": "complex", - "label": "groupsResourcesIn", + "from": "logical-link", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "l3-interface-ipv4-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "named-query-element", - "label": "startsWith", + "from": "l3-interface-ipv6-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "ipsec-configuration", - "label": "uses", + "from": "vlan", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "site-pair-set", - "label": "hasSitePairSet", + "from": "vlan", + "to": "multicast-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1417,191 +1405,203 @@ "default": "true" }, { - "from": "model", - "to": "model-element", - "label": "startsWith", + "from": "tenant", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "metadatum", - "label": "hasMetaData", + "from": "volume-group", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "network-profile", - "label": "hasNetworkProfile", + "from": "lag-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "volume-group", - "label": "uses", + "from": "p-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "logical-link", - "label": "uses", + "from": "vpls-pe", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "vpls-pe", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "port-group", - "to": "cvlan-tag", - "label": "hasCTag", + "from": "l-interface", + "to": "vserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "p-interface", - "label": "hasPinterface", + "from": "vf-module", + "to": "vserver", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "image", - "to": "metadatum", - "label": "hasMetaDatum", + "from": "vnfc", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license-key-resource", - "label": "uses", + "from": "vserver", + "to": "flavor", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-network", - "to": "vpn-binding", - "label": "usesVpnBinding", + "from": "vserver", + "to": "image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "complex", - "to": "l3-network", - "label": "usesL3Network", + "from": "model-element", + "to": "model", + "label": "isA", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "oam-network", - "to": "complex", - "label": "definedFor", + "from": "model", + "to": "model-element", + "label": "startsWith", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "${direction}", + "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "metadatum", + "to": "model", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "routing-instance", - "to": "site-pair", - "label": "hasSitePair", + "from": "vserver", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "vserver", + "to": "snapshot", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "ONE2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "vserver", + "to": "volume", + "label": "tosca.relationships.AttachesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", diff --git a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v9.json b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v9.json index d579d9a3..d1184e22 100644 --- a/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v9.json +++ b/aai-core/src/main/resources/dbedgerules/DbEdgeRules_v9.json @@ -1,21 +1,21 @@ { "rules": [ { - "from": "ipsec-configuration", - "to": "vig-server", - "label": "hasVigServer", + "from": "allotted-resource", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "multicast-configuration", - "label": "uses", + "from": "allotted-resource", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -25,69 +25,93 @@ "default": "true" }, { - "from": "generic-vnf", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "allotted-resource", + "to": "l3-network", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-constraint", - "to": "constrained-element-set", - "label": "uses", + "from": "allotted-resource", + "to": "vlan", + "label": "org.onap.relationships.inventory.PartOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vf-module", - "label": "has", + "from": "tunnel-xconnect", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "lag-interface", - "to": "p-interface", - "label": "usesPInterface", + "from": "availability-zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "availability-zone", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "model-element", - "to": "model-constraint", - "label": "uses", + "from": "availability-zone", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "virtual-data-center", - "label": "contains", + "from": "cloud-region", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "cloud-region", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -97,143 +121,143 @@ "default": "true" }, { - "from": "model-element", - "to": "model-element", - "label": "connectsTo", + "from": "cloud-region", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "vpn-binding", - "label": "uses", + "from": "dvs-switch", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "tenant", - "to": "vserver", - "label": "owns", + "from": "flavor", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "flavor", - "label": "hasFlavor", + "from": "group-assignment", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "vlan", - "label": "hasVlan", + "from": "image", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", + "from": "oam-network", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vpls-pe", - "to": "ctag-pool", - "label": "usesCtagPool", + "from": "snapshot", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "vnfc", - "label": "hosts", + "from": "tenant", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "instance-group", - "to": "model", - "label": "targets", + "from": "volume-group", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "pnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "complex", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "volume-group", - "label": "has", + "from": "ctag-pool", + "to": "complex", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "pnf", - "label": "uses", + "from": "connector", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -241,69 +265,93 @@ "default": "true" }, { - "from": "l3-network", - "to": "ctag-assignment", - "label": "hasCtagAssignment", + "from": "metadatum", + "to": "connector", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "service-instance", - "label": "hasServiceInstance", + "from": "element-choice-set", + "to": "constrained-element-set", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "ctag-pool", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", + "default": "true" + }, + { + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "service-instance", - "label": "dependsOn", + "from": "dvs-switch", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "flavor", - "label": "has", + "from": "model-element", + "to": "element-choice-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "instance-group", - "label": "isMemberOf", + "from": "entitlement", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "generic-vnf", - "to": "pserver", - "label": "runsOnPserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -313,9 +361,9 @@ "default": "true" }, { - "from": "logical-link", - "to": "pnf", - "label": "bridgedTo", + "from": "generic-vnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -325,35 +373,23 @@ "default": "true" }, { - "from": "virtual-data-center", - "to": "generic-vnf", - "label": "hasVNF", + "from": "generic-vnf", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "p-interface", - "label": "hasPinterface", + "from": "generic-vnf", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "vserver", - "to": "vf-module", - "label": "isPartOf", - "direction": "OUT", - "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -361,129 +397,117 @@ "default": "true" }, { - "from": "complex", - "to": "ctag-pool", - "label": "hasCtagPool", + "from": "generic-vnf", + "to": "license-key-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "constrained-element-set", - "to": "element-choice-set", - "label": "uses", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "p-interface", - "to": "l-interface", - "label": "hasLInterface", + "from": "generic-vnf", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "p-interface", - "to": "physical-link", - "label": "usesPhysicalLink", + "from": "vnfc", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-element", - "to": "model-ver", - "label": "isA", + "from": "generic-vnf", + "to": "vnf-image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "vserver", - "to": "image", - "label": "hasImage", + "from": "generic-vnf", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "complex", - "label": "locatedIn", + "from": "generic-vnf", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "tenant", - "to": "l3-network", - "label": "usesL3Network", + "from": "lag-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-interface-ipv4-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "license", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "complex", - "label": "existsIn", + "from": "l-interface", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "cloud-region", - "label": "existsIn", + "from": "network-profile", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -493,23 +517,23 @@ "default": "true" }, { - "from": "oam-network", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "service-instance", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "zone", - "label": "isMemberOf", + "from": "site-pair-set", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -517,107 +541,107 @@ "default": "true" }, { - "from": "customer", - "to": "service-subscription", - "label": "subscribesTo", + "from": "vf-module", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "segmentation-assignment", - "label": "has", + "from": "pserver", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "vce", - "to": "license", - "label": "has", + "from": "tenant", + "to": "group-assignment", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "related-lookup", - "label": "uses", + "from": "metadatum", + "to": "image", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "p-interface", - "label": "hasPinterface", + "from": "instance-group", + "to": "model", + "label": "org.onap.relationships.inventory.Targets", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "newvce", - "to": "l-interface", - "label": "hasLInterface", + "from": "vig-server", + "to": "ipsec-configuration", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", + "from": "l3-interface-ipv4-address-list", "to": "l3-network", - "label": "isPartOf", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "p-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "l3-interface-ipv4-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "vserver", - "label": "runsOnVserver", + "from": "l3-interface-ipv6-address-list", + "to": "l3-network", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -625,11 +649,11 @@ "default": "true" }, { - "from": "pserver", - "to": "availability-zone", - "label": "existsIn", + "from": "l3-interface-ipv6-address-list", + "to": "subnet", + "label": "org.onap.relationships.inventory.network.MemberOf", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -637,47 +661,47 @@ "default": "true" }, { - "from": "vpls-pe", - "to": "lag-interface", - "label": "hasLAGinterface", + "from": "ctag-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnfc", - "label": "uses", + "from": "l3-network", + "to": "network-policy", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { "from": "l3-network", - "to": "service-instance", - "label": "hasInstance", + "to": "route-table-reference", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "model", - "label": "relatedTo", + "from": "l3-network", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -685,189 +709,189 @@ "default": "true" }, { - "from": "vf-module", - "to": "vnfc", - "label": "uses", + "from": "segmentation-assignment", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "service-instance", + "to": "l3-network", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "complex", - "label": "locatedIn", + "from": "subnet", + "to": "l3-network", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "model-ver", - "to": "metadatum", - "label": "hasMetaData", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "entitlement", - "label": "has", + "from": "lag-interface", + "to": "lag-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "availability-zone", - "to": "service-capability", - "label": "supportsServiceCapability", + "from": "lag-interface", + "to": "p-interface", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "volume", - "label": "hasVolume", + "from": "l-interface", + "to": "lag-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { "from": "l3-interface-ipv4-address-list", - "to": "l3-network", - "label": "isMemberOf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "zone", - "label": "isMemberOf", + "from": "l3-interface-ipv6-address-list", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "service-instance", - "label": "hasInstance", + "from": "l-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", + "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "route-table-reference", - "label": "uses", + "from": "sriov-vf", + "to": "l-interface", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "model-element", - "to": "constrained-element-set", - "label": "connectsTo", + "from": "vlan", + "to": "l-interface", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "dvs-switch", - "to": "availability-zone", - "label": "existsIn", + "from": "logical-link", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "pserver", - "to": "lag-interface", - "label": "hasLAGInterface", + "from": "logical-link", + "to": "generic-vnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "availability-zone", - "label": "has", + "from": "logical-link", + "to": "lag-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "complex", - "label": "locatedIn", + "from": "logical-link", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "vlan", - "label": "isPartOf", + "from": "logical-link", + "to": "pnf", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -877,11 +901,11 @@ "default": "true" }, { - "from": "zone", - "to": "complex", - "label": "existsIn", + "from": "logical-link", + "to": "pserver", + "label": "org.onap.relationships.inventory.BridgedTo", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -889,285 +913,285 @@ "default": "true" }, { - "from": "site-pair", - "to": "class-of-service", - "label": "hasClassOfService", + "from": "logical-link", + "to": "vpn-binding", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "element-choice-set", - "to": "model-element", - "label": "has", + "from": "model-ver", + "to": "model", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "ctag-pool", - "to": "availability-zone", - "label": "supportsAvailabilityZone", + "from": "constrained-element-set", + "to": "model-constraint", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "l3-network", - "to": "network-policy", - "label": "uses", + "from": "constrained-element-set", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "port-group", - "label": "hasPortGroup", + "from": "model-constraint", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "complex", - "label": "locatedIn", + "from": "model-element", + "to": "model-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "vnf-image", - "label": "usesVnfImage", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "site-pair-set", - "to": "routing-instance", - "label": "hasRoutingInstance", + "from": "model-element", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "named-query", + "to": "model", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "l-interface", - "label": "hasLInterface", + "from": "named-query-element", + "to": "named-query", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "ONE2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "named-query-element", + "to": "model", + "label": "org.onap.relationships.inventory.IsA", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "allotted-resource", - "to": "generic-vnf", - "label": "isPartOf", + "from": "named-query-element", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license", - "label": "has", + "from": "property-constraint", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "pnf", - "to": "zone", - "label": "isMemberOf", + "from": "related-lookup", + "to": "named-query-element", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "l-interface", + "to": "newvce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "vce", - "to": "vserver", - "label": "runsOnVserver", + "from": "oam-network", + "to": "complex", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "subnet", - "label": "isMemberOf", + "from": "oam-network", + "to": "service-capability", + "label": "org.onap.relationships.inventory.AppliesTo", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "volume-group", - "label": "uses", + "from": "l-interface", + "to": "p-interface", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "pserver", - "label": "bridgedTo", + "from": "p-interface", + "to": "logical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "oam-network", - "label": "has", + "from": "p-interface", + "to": "physical-link", + "label": "tosca.relationships.network.LinksTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "dvs-switch", - "label": "has", + "from": "lag-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "has", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "from": "p-interface", + "to": "pnf", + "label": "tosca.relationships.network.BindsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "allotted-resource", - "label": "uses", + "from": "pnf", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "l3-network", - "label": "uses", + "from": "pnf", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1177,23 +1201,11 @@ "default": "true" }, { - "from": "cloud-region", - "to": "group-assignment", - "label": "has", - "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", - "default": "true" - }, - { - "from": "group-assignment", - "to": "tenant", - "label": "has", + "from": "pnf", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1201,83 +1213,83 @@ "default": "true" }, { - "from": "l-interface", - "to": "logical-link", - "label": "usesLogicalLink", + "from": "cvlan-tag", + "to": "port-group", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "virtual-data-center", - "to": "logical-link", - "label": "contains", + "from": "lag-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "named-query-element", - "label": "connectsTo", + "from": "p-interface", + "to": "pserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "connector", - "label": "uses", + "from": "pserver", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "lag-interface", - "to": "lag-link", - "label": "usesLAGLink", + "from": "pserver", + "to": "cloud-region", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { "from": "pserver", - "to": "cloud-region", - "label": "locatedIn", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "logical-link", - "to": "generic-vnf", - "label": "bridgedTo", + "from": "pserver", + "to": "zone", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1285,108 +1297,108 @@ "default": "true" }, { - "from": "vce", - "to": "entitlement", - "label": "has", + "from": "site-pair", + "to": "routing-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "l3-network", - "label": "uses", + "from": "allotted-resource", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "l-interface", - "to": "sriov-vf", - "label": "has", + "from": "metadatum", + "to": "service-instance", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "model", - "label": "isA", + "from": "service-instance", + "to": "allotted-resource", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "group-assignment", - "to": "pserver", - "label": "has", + "from": "service-instance", + "to": "connector", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "snapshot", - "label": "has", + "from": "service-instance", + "to": "ctag-assignment", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "tenant", - "label": "has", + "from": "service-instance", + "to": "cvlan-tag", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", - "prevent-delete": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", "default": "true" }, { - "from": "cloud-region", - "to": "image", - "label": "has", + "from": "service-instance", + "to": "instance-group", + "label": "org.onap.relationships.inventory.MemberOf", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { - "from": "model-ver", - "to": "model-element", - "label": "startsWith", + "from": "service-instance", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", + "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", @@ -1394,10 +1406,10 @@ }, { "from": "service-instance", - "to": "cvlan-tag", - "label": "hasIPAGFacingVLAN", + "to": "pnf", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1405,23 +1417,11 @@ "default": "true" }, { - "from": "vserver", - "to": "l-interface", - "label": "hasLInterface", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", - "default": "true" - }, - { - "from": "generic-vnf", - "to": "instance-group", - "label": "isMemberOf", + "from": "service-instance", + "to": "service-instance", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", @@ -1429,69 +1429,69 @@ "default": "true" }, { - "from": "pnf", - "to": "lag-interface", - "label": "has", + "from": "service-instance", + "to": "vlan", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vserver", - "to": "snapshot", - "label": "uses", + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query-element", - "to": "property-constraint", - "label": "uses", + "from": "class-of-service", + "to": "site-pair", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-subscription", - "to": "service-instance", - "label": "hasInstance", + "from": "routing-instance", + "to": "site-pair-set", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "logical-link", - "label": "uses", + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "${direction}", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { "from": "tenant", - "to": "service-subscription", - "label": "relatedTo", + "to": "l3-network", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1502,56 +1502,80 @@ }, { "from": "vserver", - "to": "pserver", - "label": "runsOnPserver", + "to": "tenant", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", "multiplicity": "MANY2ONE", - "contains-other-v": "NONE", + "contains-other-v": "!${direction}", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "service-instance", - "to": "vlan", - "label": "dependsOn", + "from": "entitlement", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", + "prevent-delete": "NONE", + "default": "true" + }, + { + "from": "license", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, + { + "from": "port-group", + "to": "vce", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", + "prevent-delete": "NONE", + "default": "true" + }, { "from": "service-instance", - "to": "metadatum", - "label": "hasMetaData", + "to": "vce", + "label": "org.onap.relationships.inventory.ComposedOf", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "instance-group", - "label": "isMemberOf", + "from": "vce", + "to": "availability-zone", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "availability-zone", - "label": "hasAvailabilityZone", + "from": "vce", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1561,11 +1585,11 @@ "default": "true" }, { - "from": "logical-link", - "to": "lag-link", - "label": "usesLAGLink", + "from": "vce", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", @@ -1573,45 +1597,45 @@ "default": "true" }, { - "from": "l3-network", - "to": "subnet", - "label": "hasSubnet", + "from": "vf-module", + "to": "l3-network", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "!${direction}", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "volume-group", - "to": "tenant", - "label": "belongsTo", + "from": "vf-module", + "to": "vnfc", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "${direction}", "default": "true" }, { - "from": "cloud-region", - "to": "complex", - "label": "locatedIn", + "from": "vf-module", + "to": "volume-group", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", "default": "true" }, { "from": "generic-vnf", - "to": "l3-network", - "label": "usesL3Network", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1621,69 +1645,57 @@ "default": "true" }, { - "from": "availability-zone", - "to": "complex", - "label": "groupsResourcesIn", + "from": "logical-link", + "to": "virtual-data-center", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "lag-interface", - "to": "l-interface", - "label": "hasLInterface", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "named-query", - "to": "named-query-element", - "label": "startsWith", + "from": "l3-interface-ipv4-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "service-instance", - "to": "ctag-assignment", - "label": "uses", + "from": "l3-interface-ipv6-address-list", + "to": "vlan", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "ONE2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "ipsec-configuration", - "label": "uses", + "from": "vlan", + "to": "logical-link", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2ONE", + "multiplicity": "MANY2MANY", "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "site-pair-set", - "label": "hasSitePairSet", + "from": "vlan", + "to": "multicast-configuration", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", @@ -1693,207 +1705,195 @@ "default": "true" }, { - "from": "model", - "to": "model-ver", - "label": "has", + "from": "tenant", + "to": "volume-group", + "label": "org.onap.relationships.inventory.DependsOn", "direction": "OUT", "multiplicity": "ONE2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "connector", - "to": "metadatum", - "label": "hasMetaData", + "from": "volume-group", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "generic-vnf", - "to": "network-profile", - "label": "hasNetworkProfile", + "from": "lag-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "vf-module", - "to": "volume-group", - "label": "uses", + "from": "p-interface", + "to": "vpls-pe", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "logical-link", - "to": "logical-link", - "label": "uses", + "from": "vpls-pe", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "SVC-INFRA": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-interface-ipv6-address-list", - "to": "l3-network", - "label": "isMemberOf", + "from": "vpls-pe", + "to": "ctag-pool", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", "multiplicity": "MANY2MANY", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "port-group", - "to": "cvlan-tag", - "label": "hasCTag", + "from": "l-interface", + "to": "vserver", + "label": "tosca.relationships.network.BindsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vpls-pe", - "to": "p-interface", - "label": "hasPinterface", + "from": "vf-module", + "to": "vserver", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "image", - "to": "metadatum", - "label": "hasMetaDatum", + "from": "vnfc", + "to": "vserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "multiplicity": "ONE2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "SVC-INFRA": "!${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "generic-vnf", - "to": "license-key-resource", - "label": "uses", + "from": "vserver", + "to": "flavor", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "l3-network", - "to": "vpn-binding", - "label": "usesVpnBinding", + "from": "vserver", + "to": "image", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "!${direction}", "default": "true" }, { - "from": "complex", - "to": "l3-network", - "label": "usesL3Network", + "from": "vserver", + "to": "pserver", + "label": "tosca.relationships.HostedOn", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "MANY2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" }, { - "from": "oam-network", - "to": "complex", - "label": "definedFor", + "from": "vserver", + "to": "snapshot", + "label": "org.onap.relationships.inventory.Uses", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2ONE", "contains-other-v": "NONE", "delete-other-v": "NONE", - "SVC-INFRA": "NONE", - "prevent-delete": "!${direction}", - "default": "true" - }, - { - "from": "vlan", - "to": "l3-interface-ipv4-address-list", - "label": "hasIpAddress", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "routing-instance", - "to": "site-pair", - "label": "hasSitePair", + "from": "vserver", + "to": "volume", + "label": "tosca.relationships.AttachesTo", "direction": "OUT", - "multiplicity": "MANY2MANY", + "multiplicity": "ONE2MANY", "contains-other-v": "${direction}", "delete-other-v": "${direction}", - "SVC-INFRA": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE", "default": "true" }, { - "from": "vlan", - "to": "l3-interface-ipv6-address-list", - "label": "hasIpAddress", + "from": "metadatum", + "to": "model-ver", + "label": "org.onap.relationships.inventory.BelongsTo", "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", - "SVC-INFRA": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "SVC-INFRA": "NONE", "prevent-delete": "NONE", "default": "true" }, { - "from": "allotted-resource", - "to": "tunnel-xconnect", - "label": "has", + "from": "zone", + "to": "complex", + "label": "org.onap.relationships.inventory.LocatedIn", "direction": "OUT", - "multiplicity": "ONE2ONE", - "contains-other-v": "${direction}", - "delete-other-v": "${direction}", + "multiplicity": "MANY2ONE", + "contains-other-v": "NONE", + "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE", + "prevent-delete": "!${direction}", "default": "true" } ] diff --git a/aai-core/src/main/resources/edgeLabelMigration.csv b/aai-core/src/main/resources/edgeLabelMigration.csv new file mode 100644 index 00000000..f675ce8d --- /dev/null +++ b/aai-core/src/main/resources/edgeLabelMigration.csv @@ -0,0 +1,212 @@ +from,to,label,direction,multiplicity,contains-other-v,delete-other-v,SVC-INFRA,prevent-delete,new from,new to,new label,new direction,new multiplicity,new contains-other-v,new delete-other-v,new SVC-INFRA,new prevent-delete,new default +allotted-resource,allotted-resource,bindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,allotted-resource,tosca.relationships.network.BindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,generic-vnf,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,generic-vnf,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l3-network,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,l3-network,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l-interface,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,allotted-resource,l-interface,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,network-policy,uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,network-policy,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,vlan,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,vlan,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,vpn-binding,belongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},allotted-resource,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +allotted-resource,tunnel-xconnect,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,tunnel-xconnect,allotted-resource,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +availability-zone,complex,groupsResourcesIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +availability-zone,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +cloud-region,availability-zone,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},availability-zone,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},cloud-region,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +cloud-region,l3-network,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,cloud-region,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +cloud-region,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,cloud-region,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +cloud-region,dvs-switch,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},dvs-switch,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,flavor,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},flavor,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,group-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},group-assignment,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,image,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},image,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,oam-network,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},oam-network,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,snapshot,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},snapshot,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,tenant,has,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},tenant,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +cloud-region,vip-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv4-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,vip-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv6-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,volume-group,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},volume-group,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +complex,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,complex,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +complex,ctag-pool,hasCtagPool,OUT,MANY2MANY,${direction},${direction},NONE,NONE,ctag-pool,complex,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +configuration,allotted-resource,uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,configuration,allotted-resource,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,T +configuration,logical-link,has,OUT,ONE2MANY,NONE,${direction},NONE,NONE,configuration,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +configuration,metadatum,owns,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +connector,virtual-data-center,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,connector,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +connector,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,connector,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +constrained-element-set,element-choice-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,element-choice-set,constrained-element-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +ctag-pool,availability-zone,supportsAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},ctag-pool,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +customer,service-subscription,subscribesTo,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-subscription,customer,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +dvs-switch,availability-zone,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},dvs-switch,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +element-choice-set,model-element,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,element-choice-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,configuration,uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,generic-vnf,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +generic-vnf,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,ipsec-configuration,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,generic-vnf,ipsec-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +generic-vnf,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,generic-vnf,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,license-key-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,license-key-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,pnf,hostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,pnf,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,pserver,runsOnPserver,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,pserver,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},NONE,vnfc,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,!${direction},!${direction},NONE,T +generic-vnf,vnf-image,usesVnfImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},generic-vnf,vnf-image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +generic-vnf,volume-group,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,vserver,runsOnVserver,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,network-profile,hasNetworkProfile,OUT,MANY2MANY,NONE,NONE,NONE,NONE,network-profile,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,${direction},NONE,service-instance,generic-vnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +generic-vnf,site-pair-set,hasSitePairSet,OUT,MANY2MANY,NONE,NONE,NONE,NONE,site-pair-set,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,vf-module,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vf-module,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +group-assignment,pserver,has,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},pserver,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,NONE,${direction},T +group-assignment,tenant,has,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +image,metadatum,hasMetaDatum,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,image,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +instance-group,model,targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},instance-group,model,org.onap.relationships.inventory.Targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +ipsec-configuration,vig-server,hasVigServer,OUT,ONE2MANY,${direction},${direction},NONE,NONE,vig-server,ipsec-configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-interface-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv4-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv4-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv4-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv4-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-interface-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv6-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv6-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv6-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv6-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-network,ctag-assignment,hasCtagAssignment,OUT,MANY2MANY,${direction},${direction},${direction},NONE,ctag-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l3-network,instance-group,memberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,network-policy,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-network,network-policy,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-network,route-table-reference,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,route-table-reference,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,vpn-binding,usesVpnBinding,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},l3-network,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +l3-network,segmentation-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,segmentation-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-network,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,l3-network,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +l3-network,subnet,hasSubnet,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,subnet,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +lag-interface,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,lag-link,tosca.relationships.network.LinksTo,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,logical-link,uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,p-interface,usesPInterface,OUT,MANY2MANY,NONE,NONE,${direction},NONE,lag-interface,p-interface,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +lag-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,lag-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +line-of-business,generic-vnf,realizedBy,OUT,MANY2MANY,NONE,NONE,NONE,NONE,line-of-business,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l-interface,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,l-interface,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,l-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},${direction},NONE,T +l-interface,logical-link,sourceLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Source,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,logical-link,targetLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Destination,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,sriov-vf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-vf,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +l-interface,vlan,hasVlan,OUT,MANY2MANY,${direction},${direction},NONE,NONE,vlan,l-interface,tosca.relationships.network.LinksTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +logical-link,cloud-region,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,generic-vnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,generic-vnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,NONE,${direction},NONE,logical-link,lag-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +logical-link,logical-link,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,logical-link,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +logical-link,pnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,pnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,pserver,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,pserver,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +logical-link,vpn-binding,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +model,model-ver,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-ver,model,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-constraint,constrained-element-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-constraint,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,constrained-element-set,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-constraint,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-element,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-ver,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},model-element,model-ver,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +model-ver,metadatum,hasMetaDatum,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-ver,model-element,startsWith,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query,model,relatedTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},named-query,model,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},T +named-query,named-query-element,startsWith,OUT,ONE2ONE,${direction},${direction},NONE,NONE,named-query-element,named-query,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,model,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},named-query-element,model,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +named-query-element,named-query-element,connectsTo,OUT,MANY2MANY,${direction},${direction},NONE,NONE,named-query-element,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,property-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,property-constraint,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,related-lookup,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,related-lookup,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +newvce,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,l-interface,newvce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +oam-network,complex,definedFor,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,complex,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +oam-network,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +operational-environment,operational-environment,managedBy,OUT,ONE2ONE,NONE,NONE,NONE,NONE,operational-environment,operational-environment,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +owning-entity,service-instance,owns,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,owning-entity,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +p-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,p-interface,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +p-interface,logical-link,usesLogicalLink,OUT,MANY2ONE,NONE,NONE,${direction},NONE,p-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +p-interface,physical-link,usesPhysicalLink,OUT,MANY2MANY,NONE,${direction},NONE,NONE,p-interface,physical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},NONE,NONE,T +p-interface,sriov-pf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-pf,p-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +platform,generic-vnf,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,platform,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,lag-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,lag-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},pnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +pnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,pnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pnf,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +port-group,cvlan-tag,hasCTag,OUT,MANY2MANY,${direction},${direction},${direction},NONE,cvlan-tag,port-group,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +project,service-instance,created,OUT,ONE2MANY,NONE,NONE,NONE,NONE,project,service-instance,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +pserver,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,availability-zone,existsIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,availability-zone,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,cloud-region,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,pserver,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +pserver,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pserver,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +routing-instance,site-pair,hasSitePair,OUT,MANY2MANY,${direction},${direction},NONE,NONE,site-pair,routing-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,has,OUT,MANY2MANY,${direction},${direction},NONE,NONE,allotted-resource,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,allotted-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,configuration,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,connector,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,connector,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,ctag-assignment,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,ctag-assignment,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,cvlan-tag,hasIPAGFacingVLAN,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,cvlan-tag,org.onap.relationships.inventory.ComposedOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,logical-link,uses,OUT,MANY2MANY,NONE,${direction},NONE,NONE,service-instance,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +service-instance,pnf,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,pnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,service-instance,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,service-instance,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,vlan,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,vlan,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,zone,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,service-instance,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +service-subscription,service-instance,hasInstance,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-instance,service-subscription,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +site-pair,class-of-service,hasClassOfService,OUT,MANY2MANY,${direction},${direction},NONE,NONE,class-of-service,site-pair,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +site-pair-set,routing-instance,hasRoutingInstance,OUT,MANY2MANY,${direction},${direction},NONE,NONE,routing-instance,site-pair-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +sriov-vf,sriov-pf,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,sriov-vf,sriov-pf,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +subnet,host-route,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,host-route,subnet,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +tenant,service-subscription,relatedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-subscription,tenant,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,vserver,owns,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},vserver,tenant,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +vce,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,port-group,hasPortGroup,OUT,MANY2MANY,${direction},${direction},${direction},NONE,port-group,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vce,service-instance,hasServiceInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,vce,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vce,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vce,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vce,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vce,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +vce,vserver,runsOnVserver,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vce,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vf-module,l3-network,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vf-module,l3-network,org.onap.relationships.inventory.DependsOn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +vf-module,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},${direction},vf-module,vnfc,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},${direction},T +vf-module,volume-group,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vf-module,volume-group,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vip-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv4-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv4-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vip-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv6-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv6-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +virtual-data-center,generic-vnf,hasVNF,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,generic-vnf,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +virtual-data-center,logical-link,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vlan,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,vlan,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +vlan,multicast-configuration,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vlan,multicast-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,l3-interface-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv4-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,l3-interface-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv6-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv4-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv4-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv6-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv6-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +volume-group,tenant,belongsTo,OUT,MANY2MANY,NONE,NONE,${direction},NONE,tenant,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +volume-group,complex,existsIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},volume-group,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vpls-pe,lag-interface,hasLAGinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,lag-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,p-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vpls-pe,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +vpls-pe,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vpls-pe,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vpn-binding,route-target,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,route-target,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vserver,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,vserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vserver,vf-module,isPartOf,OUT,MANY2ONE,NONE,NONE,${direction},NONE,vf-module,vserver,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,vnfc,hosts,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vnfc,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,flavor,hasFlavor,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,flavor,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,image,hasImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,pserver,runsOnPserver,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,pserver,tosca.relationships.HostedOn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,snapshot,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vserver,snapshot,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vserver,volume,hasVolume,OUT,MANY2MANY,${direction},${direction},${direction},NONE,vserver,volume,tosca.relationships.AttachesTo,OUT,ONE2MANY,${direction},${direction},${direction},NONE,T +zone,complex,existsIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +,,,,,,,,,allotted-resource,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,generic-vnf,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,l3-network,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,logical-link,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,service-instance,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,vf-module,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +configuration,l-interface,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,l-interface,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +configuration,pnf,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,pnf,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +forwarder,forwarding-path,belongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,forwarder,forwarding-path,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +forwarding-path,service-instance,implements,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,forwarding-path,service-instance,org.onap.relationships.inventory.AppliesTo,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,T +forwarder,l-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,l-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +forwarder,p-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,p-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T diff --git a/aai-core/src/main/resources/edgerulesTemplate.ftlh b/aai-core/src/main/resources/edgerulesTemplate.ftlh new file mode 100644 index 00000000..2223cc37 --- /dev/null +++ b/aai-core/src/main/resources/edgerulesTemplate.ftlh @@ -0,0 +1,8 @@ +{ + "rules": [ +<#list wrappedRules as rule> +<#include "ruleTemplate.ftlh"> +<#if rule_has_next>, + + ] +} \ No newline at end of file diff --git a/aai-core/src/main/resources/ruleTemplate.ftlh b/aai-core/src/main/resources/ruleTemplate.ftlh new file mode 100644 index 00000000..00865279 --- /dev/null +++ b/aai-core/src/main/resources/ruleTemplate.ftlh @@ -0,0 +1,12 @@ + { + "from": "${rule.from}", + "to": "${rule.to}", + "label": "${rule.label}", + "direction": "${rule.direction}", + "multiplicity": "${rule.multiplicity}", + "contains-other-v": "${rule.lineage}", + "delete-other-v": "${rule.deleteOtherV}", + "SVC-INFRA": "${rule.svcInfra}", + "prevent-delete": "${rule.preventDelete}", + "default": "${rule.default}" + } \ No newline at end of file diff --git a/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java new file mode 100644 index 00000000..e358dc8e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/dbmap/AAIGraphTest.java @@ -0,0 +1,79 @@ +/** + * ============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.dbmap; + +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.schema.TitanManagement; +import org.hamcrest.CoreMatchers; +import org.junit.*; +import org.onap.aai.AAISetup; +import org.onap.aai.util.AAIConstants; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.Matchers.matchesPattern; +import static org.junit.Assert.*; + +public class AAIGraphTest extends AAISetup{ + + private static final String SERVICE_NAME = "JUNIT"; + + @Before + public void setup() { + System.setProperty("aai.service.name", SERVICE_NAME); + AAIGraph.getInstance(); + } + + @Test + public void getRealtimeInstanceConnectionName() throws Exception { + + TitanManagement graphMgt = AAIGraph.getInstance().getGraph().openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName, containsString(SERVICE_NAME)); + assertThat(connectionInstanceName, containsString("realtime")); + assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_realtime_\\d+\\(current\\)$")); + graphMgt.rollback(); + } + + @Test + public void getCachedInstanceConnectionName() throws Exception { + + TitanManagement graphMgt = AAIGraph.getInstance().getGraph(DBConnectionType.CACHED).openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName, containsString(SERVICE_NAME)); + assertThat(connectionInstanceName, containsString("cached")); + assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_cached_\\d+\\(current\\)$")); + graphMgt.rollback(); + } + + @Test + public void titanGraphOpenNameTest() throws Exception{ + TitanGraph graph = TitanFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration()); + TitanManagement graphMgt = graph.openManagement(); + String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get(); + assertThat(connectionInstanceName,matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$")); + graphMgt.rollback(); + graph.close(); + } + +} \ No newline at end of file diff --git a/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java b/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java new file mode 100644 index 00000000..64856899 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/introspection/JSONStrategyTest.java @@ -0,0 +1,136 @@ +/** + * ============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.introspection; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; + +import java.util.HashSet; +import java.util.Set; + +public class JSONStrategyTest extends AAISetup{ + private JSONStrategy jsonStrategy; + private JSONStrategy jsonStrategyContainer; + private JSONStrategy jsonStrategyComplex; + + @Before + public void setup(){ + try { + JSONObject pserver = new JSONObject(); + pserver.put("hostname", "value1"); + pserver.put("numberofCpus", 4); + jsonStrategy = new JSONStrategy(pserver, "pserver-type"); + + // The values of this object are arrays containing JSONObjects + JSONArray pservers = new JSONArray(); + pservers.add(pserver); + JSONObject container = new JSONObject(); + container.put("pservers", pservers); + jsonStrategyContainer = new JSONStrategy(container, "pservers-type"); + + // The values of this object are JSONObjects + JSONObject complex = new JSONObject(); + complex.put("pserver", pserver); + jsonStrategyComplex = new JSONStrategy(complex, "pservers-type"); + } + catch (Exception e){ + System.out.println("error during setup: " + e.getMessage()); + } + } + + @Test + public void getSetTest(){ + jsonStrategy.setValue("ramInMegabytes", 1024); + Assert.assertEquals("value1", jsonStrategy.getValue("hostname")); + Assert.assertEquals(4, jsonStrategy.getValue("numberofCpus")); + Assert.assertEquals(1024, jsonStrategy.getValue("ramInMegabytes")); + } + + @Test + public void getPropertiesTest() { + Set expected = new HashSet<>(); + expected.add("hostname"); + expected.add("numberofCpus"); + Assert.assertEquals(expected, jsonStrategy.getProperties()); + } + + @Test + public void getGenericTypeTest() { + // If the values of this object are arrays, return the type within the array + Assert.assertEquals("class org.json.simple.JSONObject" , jsonStrategyContainer.getGenericTypeClass("pservers").toString()); + } + + @Test + public void getJavaClassNameTest() { + Assert.assertEquals("org.json.simple.JSONObject", jsonStrategy.getJavaClassName()); + Assert.assertEquals("org.json.simple.JSONObject", jsonStrategyContainer.getJavaClassName()); + } + @Test + public void getTypeTest() { + Assert.assertEquals("java.lang.String", jsonStrategy.getType("hostname")); + Assert.assertEquals("java.lang.Integer", jsonStrategy.getType("numberofCpus")); + } + + @Test + public void isContainerTest() { + Assert.assertTrue(jsonStrategyContainer.isContainer()); + } + + @Test + public void newInstanceOfPropertyTest() { + Assert.assertEquals("class org.json.simple.JSONArray", jsonStrategyContainer.newInstanceOfProperty("pservers").getClass().toString()); + } + + @Test(expected = NullPointerException.class) + public void newInvalidInstanceOfPropertyTest() { + Assert.assertEquals(null, jsonStrategyContainer.newInstanceOfProperty("invalid").getClass().toString()); + } + @Test + public void newInstanceOfNestedPropertyTest() { + Assert.assertEquals("class org.json.simple.JSONObject", jsonStrategyContainer.newInstanceOfNestedProperty("pservers").getClass().toString()); + } + + @Test(expected = NullPointerException.class) + public void newInvalidInstanceOfNestedPropertyTest() { + jsonStrategyContainer.newInstanceOfNestedProperty("invalid").getClass().toString(); + } + + @Test + public void isComplexTypeTest() { + // Complex: The value of this key contains a JSONObject + Assert.assertTrue(jsonStrategyComplex.isComplexType("pserver")); + Assert.assertFalse(jsonStrategyContainer.isComplexType("pservers")); + Assert.assertFalse(jsonStrategy.isComplexType("hostname")); + } + + @Test + public void isComplexGenericTypeTest() { + // Complex Generic: The value of this key contains an array of JSONObjects + Assert.assertTrue(jsonStrategyContainer.isComplexGenericType("pservers")); + Assert.assertFalse(jsonStrategyComplex.isComplexGenericType("pserver")); + Assert.assertFalse(jsonStrategy.isComplexGenericType("hostname")); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java b/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java index 0250bbb3..d5eaf0b6 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/PropertyPredicatesTest.java @@ -29,6 +29,7 @@ import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import java.util.Set; import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; @@ -43,33 +44,33 @@ public class PropertyPredicatesTest extends AAISetup { @Before public void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); - obj = loader.introspectorFromName("test-object"); + obj = loader.introspectorFromName("generic-vnf"); } @Test public void includeInTestGeneration() throws AAIUnknownObjectException { Set props = obj.getProperties(PropertyPredicates.includeInTestGeneration()); - - assertThat("props not found", props, - not(hasItems("persona-model-ver", "not-visible-test-element", "model-invariant-id", "model-version-id"))); + + assertThat("props not found", props, + not(hasItems("model-invariant-id", "model-version-id"))); } @Test public void isVisible() throws AAIUnknownObjectException { Set props = obj.getProperties(PropertyPredicates.isVisible()); - - assertThat("props not found", props, not(hasItems("persona-model-ver"))); + + assertThat("props not found", props, hasItems("model-invariant-id", "model-version-id")); } @Test public void all() throws AAIUnknownObjectException { Set props = obj.getProperties(); - - assertThat("all found", props, hasItems("persona-model-ver", "not-visible-test-element")); + + assertThat("all found", props, hasItems("model-invariant-id", "model-version-id")); } - + } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java index 4a870995..7d3cafac 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java @@ -83,9 +83,11 @@ public class DataCopyTest { loader); graph.traversal().addV("aai-node-type", "model", "model-invariant-id", "key1").as("v1") - .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue").addInE("has", "v1", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key2", "model-version", "testValue") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v1", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "model", "model-invariant-id", "key3").as("v2") - .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4").addInE("has", "v2", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "model-ver", "model-ver", "myValue", "model-version-id", "key4") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true) .next(); graph.tx().commit(); } @@ -105,7 +107,7 @@ public class DataCopyTest { public void runPopulatePersonaModelVer() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); obj.setValue("model-version-id", "key2"); @@ -123,7 +125,7 @@ public class DataCopyTest { runner.execute(obj, self); - assertEquals("value populated", "testValue", obj.getValue("persona-model-ver")); + assertEquals("value populated", "testValue", obj.getValue("persona-model-version")); g.tx().rollback(); @@ -134,7 +136,7 @@ public class DataCopyTest { public void runPopulateModelVersionId() throws URISyntaxException, AAIException, UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v9); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("persona-model-id", "key1"); obj.setValue("persona-model-version", "testValue"); @@ -187,7 +189,7 @@ public class DataCopyTest { public void expectedMissingPropertyExceptionInURI() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key1"); @@ -210,7 +212,7 @@ public class DataCopyTest { @Test public void expectedMissingPropertyExceptionForResultingObject() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); obj.setValue("model-invariant-id", "key3"); obj.setValue("model-version-id", "key4"); @@ -234,7 +236,7 @@ public class DataCopyTest { @Test public void expectNoProcessingWithNoProperties() throws AAIException, UnsupportedEncodingException { final Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); - final Introspector obj = loader.introspectorFromName("test-object"); + final Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "myId"); TransactionalGraphEngine spy = spy(dbEngine); diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java index b817cc69..684bb5b8 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java @@ -31,6 +31,7 @@ import org.junit.*; import org.junit.rules.ExpectedException; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.dbmap.DBConnectionType; import org.onap.aai.exceptions.AAIException; @@ -52,7 +53,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; -public class DataLinkTest { +public class DataLinkTest extends AAISetup { private static TitanGraph graph; private final static Version version = Version.getLatest(); @@ -71,8 +72,6 @@ public class DataLinkTest { @BeforeClass public static void setup() throws NoSuchFieldException, SecurityException, Exception { graph = TitanFactory.build().set("storage.backend","inmemory").open(); - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local"); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine( queryStyle, @@ -81,13 +80,17 @@ public class DataLinkTest { graph.traversal().addV("aai-node-type", "vpn-binding", "vpn-id", "addKey").as("v1") .addV("aai-node-type", "vpn-binding", "vpn-id", "modifyKey").as("v2") - .addV("aai-node-type", "route-target", "global-route-target", "modifyTargetKey", "route-target-role", "modifyRoleKey", "linked", true).addInE("has", "v2", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "modifyTargetKey", "route-target-role", "modifyRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "deleteKey").as("v3") - .addV("aai-node-type", "route-target", "global-route-target", "deleteTargetKey", "route-target-role", "deleteRoleKey", "linked", true).addInE("has", "v3", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "deleteTargetKey", "route-target-role", "deleteRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v3", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "getKey").as("v4") - .addV("aai-node-type", "route-target", "global-route-target", "getTargetKey", "route-target-role", "getRoleKey", "linked", true).addInE("has", "v4", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "getTargetKey", "route-target-role", "getRoleKey", "linked", true) + .addOutE("org.onap.relationships.inventory.BelongsTo", "v4", EdgeProperty.CONTAINS.toString(), true) .addV("aai-node-type", "vpn-binding", "vpn-id", "getKeyNoLink").as("v5") - .addV("aai-node-type", "route-target", "global-route-target", "getTargetKeyNoLink", "route-target-role", "getRoleKeyNoLink").addInE("has", "v5", EdgeProperty.CONTAINS.toString(), true) + .addV("aai-node-type", "route-target", "global-route-target", "getTargetKeyNoLink", "route-target-role", "getRoleKeyNoLink") + .addOutE("org.onap.relationships.inventory.BelongsTo", "v5", EdgeProperty.CONTAINS.toString(), true) .next(); graph.tx().commit(); } @@ -187,7 +190,12 @@ public class DataLinkTest { runner.execute(obj, self); assertEquals("route-target vertex not found", false, traversal.V() - .has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "deleteTargetKey").has("route-target-role", "deleteRoleKey").has("linked", true).hasNext()); + .has(AAIProperties.NODE_TYPE, "route-target") + .has("global-route-target", "deleteTargetKey") + .has("route-target-role", "deleteRoleKey") + .has("linked", true) + .hasNext() + ); g.tx().rollback(); } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java b/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java new file mode 100644 index 00000000..bb2604ec --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/introspection/tools/CreateUUIDTest.java @@ -0,0 +1,91 @@ +/** + * ============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.introspection.tools; + +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; +import org.onap.aai.introspection.*; +import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class CreateUUIDTest extends AAISetup { + + private CreateUUID createUUID; + + private Loader loader; + private Issue issue; + + @Before + public void setup(){ + createUUID = new CreateUUID(); + loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); + } + + /** + * Tests to check if the issue is not resolvable since + * the property that is being tested doesn't have the auto generated uuid + * metadata set to true in the oxm xml for the version specified + * + * @throws AAIUnknownObjectException - if the object type specified is unable to be found in the oxm + */ + @Test + public void testNonResolvableIssueIfMissingPropNameThatIsRequired() throws AAIUnknownObjectException { + + Introspector introspector = loader.introspectorFromName("pserver"); + + issue = new Issue(); + issue.setDetail("Some message"); + issue.setType(IssueType.MISSING_KEY_PROP); + issue.setPropName("hostname"); + issue.setIntrospector(introspector); + + boolean isIssue = createUUID.resolveIssue(issue); + + assertFalse(isIssue); + } + + /** + * Tests when there is a resolvable issue when the property + * looking for, model-element-uuid, has the auto generated uuid + * metadata attribute associated to it if the data is missing + * + * @throws AAIUnknownObjectException - if the object type specified is unable to be found in the oxm + */ + @Test + public void testResolvableIssueWhenMissingPropNameAllowsToUseGeneratedUUID() throws AAIUnknownObjectException { + + Introspector introspector = loader.introspectorFromName("model-element"); + + issue = new Issue(); + issue.setDetail("Some message"); + issue.setType(IssueType.MISSING_KEY_PROP); + issue.setPropName("model-element-uuid"); + issue.setIntrospector(introspector); + + boolean isIssue = createUUID.resolveIssue(issue); + assertTrue(isIssue); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java b/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java index db21f578..3bba4ee0 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/validation/IntrospectorValidationTest.java @@ -63,7 +63,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifySuccessWhenEmpty() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); validator.validate(obj); List issues = validator.getIssues(); @@ -73,7 +73,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifyRequiresSingleFieldFailure() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); obj.setValue("model-invariant-id", "id1"); validator.validate(obj); @@ -85,7 +85,7 @@ public class IntrospectorValidationTest { @Ignore @Test public void verifyRequiresSuccess() throws AAIException { - Introspector obj = loader.introspectorFromName("test-object"); + Introspector obj = loader.introspectorFromName("generic-vnf"); obj.setValue("vnf-id", "key1"); obj.setValue("model-invariant-id", "id1"); obj.setValue("model-version-id", "version-id1"); diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.java new file mode 100644 index 00000000..485a63f2 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompErrorCategoryTest.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.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; + +public class EcompErrorCategoryTest { + + EcompErrorCategory _ecompErrorCategory; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompErrorCategory= spy(EcompErrorCategory.class); + + } + @Test + public void warn(){ + String defaultCategory = "WARN"; + assertEquals(_ecompErrorCategory.convert(mockEvent), defaultCategory); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.java new file mode 100644 index 00000000..522aeb2b --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseCodeTest.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.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; + +public class EcompResponseCodeTest { + + EcompResponseCode _ecompResponseCode; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompResponseCode= spy(EcompResponseCode.class); + + } + @Test + public void getDefaultCode(){ + assertEquals(_ecompResponseCode.convert(mockEvent), LoggingContext.UNKNOWN_ERROR); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.java new file mode 100644 index 00000000..3453d2de --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/logging/EcompResponseDescriptionTest.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.logging; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import ch.qos.logback.classic.Level; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import org.junit.*; +import org.onap.aai.logging.LoggingContext.LoggingField; + +public class EcompResponseDescriptionTest { + + EcompResponseDescription _ecompResponseDescription; + ILoggingEvent mockEvent; + + @Before + public void setUp() throws Exception { + + mockEvent = mock(ILoggingEvent.class); + _ecompResponseDescription= spy(EcompResponseDescription.class); + + } + @Test + public void getDefaultDesc(){ + assertEquals(_ecompResponseDescription.convert(mockEvent), _ecompResponseDescription.DefaultDescription); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java index 7885410d..46ac5997 100644 --- a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java +++ b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java @@ -53,7 +53,7 @@ public class LoggingContextTest { } @Test - public void testRequestId() throws Exception { //AKA Transaction ID + public void testRequestId() { //AKA Transaction ID final String sUuid = "57d51eaa-edc6-4f50-a69d-f2d4d2445120"; LoggingContext.requestId(sUuid); diff --git a/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java b/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java index df9d6122..968adb3c 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/query/GraphTraversalTest.java @@ -126,7 +126,7 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("physical-location-id", "key1").has("aai-node-type", "complex") - .out("hasCtagPool") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "ctag-pool") .has("target-pe", "key2").has("availability-zone-name", "key3"); GraphTraversal expectedParent = __.start() @@ -164,14 +164,14 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag") .has("cvlan-tag", 655); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -212,13 +212,13 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag"); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -296,7 +296,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("cloud-owner", "mycloudowner").has("cloud-region-id", "mycloudregionid") .has("aai-node-type", "cloud-region") - .out("has") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "tenant") .has("tenant-name", "Tenant1"); @@ -340,7 +340,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("cloud-owner", "mycloudowner").has("cloud-region-id", "mycloudregionid") .has("aai-node-type", "cloud-region") - .out("has") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "tenant") .has("tenant-name", P.within(values)); @@ -432,14 +432,14 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") - .has("interface-id", "key2").out("hasCTag") + .has("interface-id", "key2").in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "cvlan-tag") .has("cvlan-tag", 333); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has("aai-node-type", "vce") - .out("hasPortGroup") + .in("org.onap.relationships.inventory.BelongsTo") .has("aai-node-type", "port-group") .has("interface-id", "key2"); assertEquals( @@ -527,7 +527,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "generic-vnf")) - .union(__.out("has").has(AAIProperties.NODE_TYPE, "vf-module")).has("vf-module-id", "key2"); + .union(__.in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "vf-module")).has("vf-module-id", "key2"); GraphTraversal expectedParent = __.start() .has("vnf-id", "key1").has(AAIProperties.NODE_TYPE, P.within("vce", "generic-vnf")); @@ -621,15 +621,15 @@ public class GraphTraversalTest extends AAISetup { @Test public void dbAliasedSearch() throws UnsupportedEncodingException, AAIException { - URI uri = UriBuilder.fromPath("network/test-objects").build(); + URI uri = UriBuilder.fromPath("network/generic-vnfs").build(); MultivaluedMap map = new MultivaluedHashMap<>(); map.putSingle("persona-model-customization-id", "key2"); QueryParser query = dbEnginev9.getQueryBuilder().createQueryFromURI(uri, map); GraphTraversal expected = __.start() - .has("aai-node-type", "test-object") + .has("aai-node-type", "generic-vnf") .has("model-customization-id", "key2"); GraphTraversal expectedParent = __.start() - .has("aai-node-type", "test-object"); + .has("aai-node-type", "generic-vnf"); assertEquals( "gremlin query should be " + expected.toString(), @@ -642,7 +642,7 @@ public class GraphTraversalTest extends AAISetup { assertEquals( "result type should be", - "test-object", + "generic-vnf", query.getResultType()); assertEquals( "result type should be empty", @@ -661,7 +661,7 @@ public class GraphTraversalTest extends AAISetup { QueryParser query = dbEnginev9.getQueryBuilder().createQueryFromURI(uri, map); GraphTraversal expected = __.start() .has("aai-node-type", "vpn-binding") - .where(__.out("has").has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "key2")); + .where(__.in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "key2")); GraphTraversal expectedParent = __.start() .has("aai-node-type", "vpn-binding"); @@ -693,7 +693,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver"); + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex"); @@ -727,7 +727,7 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") @@ -762,14 +762,14 @@ public class GraphTraversalTest extends AAISetup { GraphTraversal expected = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2") - .in("runsOnPserver").has("aai-node-type", "vserver") + .in("tosca.relationships.HostedOn").has("aai-node-type", "vserver") .has("vserver-id", "key3"); GraphTraversal expectedParent = __.start() .has("physical-location-id", "key1") .has("aai-node-type", "complex") - .in("locatedIn").has("aai-node-type", "pserver") + .in("org.onap.relationships.inventory.LocatedIn").has("aai-node-type", "pserver") .has("hostname", "key2"); assertEquals( diff --git a/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java b/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java index 84e9c6bc..d9dcabd3 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/query/UniqueURIQueryTest.java @@ -150,7 +150,7 @@ public class UniqueURIQueryTest extends AAISetup { String parentKey = "vce/key1/port-group/key2"; URI uri = UriBuilder.fromPath(parentURI + "/cvlan-tags").build(); QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); - GraphTraversal expected = __.start().has("aai-unique-key", parentKey).out("hasCTag").has("aai-node-type", "cvlan-tag"); + GraphTraversal expected = __.start().has("aai-unique-key", parentKey).in("org.onap.relationships.inventory.BelongsTo").has("aai-node-type", "cvlan-tag"); GraphTraversal parentExpected = __.start().has("aai-unique-key",parentKey); String parentResultType = "port-group"; String resultType = "cvlan-tag"; diff --git a/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java b/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java index 04727067..1710986b 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/relationship/RelationshipToURITest.java @@ -54,7 +54,7 @@ public class RelationshipToURITest extends AAISetup { public void onlyLink() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("only-related-link.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -67,7 +67,7 @@ public class RelationshipToURITest extends AAISetup { public void onlyData() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("only-relationship-data.json")); - URI expected = new URI("/network/test-objects/test-object/key1"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -80,7 +80,7 @@ public class RelationshipToURITest extends AAISetup { public void failV10() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-failv10-successv9.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -93,7 +93,7 @@ public class RelationshipToURITest extends AAISetup { public void successV9() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version9); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-failv10-successv9.json")); - URI expected = new URI("/network/test-objects/test-object/key2"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key2"); RelationshipToURI parse = new RelationshipToURI(loader, obj); URI uri = parse.getUri(); @@ -107,7 +107,7 @@ public class RelationshipToURITest extends AAISetup { public void failV9() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version9); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-successv10-failv9.json")); - URI expected = new URI("/network/test-objects/test-object/key1"); + URI expected = new URI("/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -122,7 +122,7 @@ public class RelationshipToURITest extends AAISetup { public void failNothingToParse() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("nothing-to-parse.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AAIIdentityMapParseException.class); thrown.expect(hasProperty("code", is("AAI_3000"))); @@ -136,7 +136,7 @@ public class RelationshipToURITest extends AAISetup { public void successV10() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("both-successv10-failv9.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); RelationshipToURI parse = new RelationshipToURI(loader, obj); @@ -152,7 +152,7 @@ public class RelationshipToURITest extends AAISetup { public void ambiguousRelationship() throws AAIException, URISyntaxException, IOException { Loader loader = LoaderFactory.createLoaderForVersion(modelType, version10); Introspector obj = loader.unmarshal("relationship", this.getJsonString("ambiguous-relationship.json")); - URI expected = new URI("/aai/v10/network/test-objects/test-object/key1"); + URI expected = new URI("/aai/v10/network/generic-vnfs/generic-vnf/key1"); thrown.expect(AmbiguousMapAAIException.class); thrown.expect(hasProperty("code", is("AAI_6146"))); diff --git a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java index bc3a684b..42d26f99 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIParserTest.java @@ -59,7 +59,7 @@ public class URIParserTest extends AAISetup { URI uri = UriBuilder.fromPath("/aai/" + loader.getVersion() + "/network/tenants/tenant/key1/vservers/vserver/key2/l-interfaces/l-interface/key3").build(); thrown.expect(AAIException.class); - thrown.expect(hasProperty("code", is("AAI_3000"))); + thrown.expect(hasProperty("code", is("AAI_3001"))); new URIToDBKey(loader, uri); } diff --git a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java index ce4933a6..ca64ec76 100644 --- a/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java +++ b/aai-core/src/test/java/org/onap/aai/parsers/uri/URIToExtensionInformationTest.java @@ -53,7 +53,7 @@ public class URIToExtensionInformationTest extends AAISetup { */ @Test public void vserversV8() throws JAXBException, AAIException, IllegalArgumentException, UnsupportedEncodingException { - URI uri = UriBuilder.fromPath("/aai/" + v8Loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/key1/vservers/vserver/key2").build(); + URI uri = UriBuilder.fromPath("/aai/" + v8Loader.getVersion() + "/cloud-infrastructure/cloud-regions/cloud-region/testOwner1/testRegion1/tenants/tenant/key1/vservers/vserver/key2").build(); URIToExtensionInformation parse = new URIToExtensionInformation(v8Loader, uri); String namespace = "cloudInfrastructure"; diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java b/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java index d478d608..b475a385 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/QueryBuilderTestAbstraction.java @@ -35,8 +35,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.exceptions.AAIException; @@ -51,19 +50,33 @@ import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; public abstract class QueryBuilderTestAbstraction extends AAISetup { - protected Loader loader; - protected Graph graph; + protected static Loader loader; + protected static Graph graph; protected GraphTraversalSource g; - + protected EdgeRules testEdgeRules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_TraversalQueryTest.json"); - @Before - public void configure() throws Exception { + + @BeforeClass + public static void setup() throws Exception { loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); graph = TitanFactory.build().set("storage.backend", "inmemory").open(); + } + + @Before + public void configure() throws Exception { g = graph.traversal(); } - + + @After + public void deConfigure() throws Exception { + g.tx().rollback(); + } + + @AfterClass + public static void teardown() throws Exception { + graph.close(); + } @Test public void createEdgeGVnfToVnfcTraversal() throws AAIException { @@ -77,7 +90,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(vnfc, tQ.next()); - g.tx().rollback(); + } @Test @@ -94,7 +107,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -111,7 +124,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -128,7 +141,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals(logicalLink, next); - g.tx().rollback(); + } @Test @@ -147,7 +160,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); - g.tx().rollback(); + } @Test @@ -172,7 +185,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("2 - Has 1 vertexes ", 1, list2.size()); assertTrue("2 - traversal results in vce ", list2.contains(vce)); - g.tx().rollback(); + } @Test @@ -191,7 +204,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 vertexes ", 1, list.size()); assertTrue("1 - traversal results in vnfc ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -213,7 +226,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); assertTrue("Has vertex on the re-uses edge ", list.contains(vnfc2)); - g.tx().rollback(); + } @Test @@ -234,7 +247,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Only returns the generic vnf vertex", list.contains(gvnf)); - g.tx().rollback(); + } @Test @@ -250,7 +263,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 vertexes ", 1, list.size()); - g.tx().rollback(); + } @Test @@ -266,7 +279,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); - g.tx().rollback(); + } @Test @@ -282,7 +295,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); - g.tx().rollback(); + } @Test @@ -302,7 +315,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 1, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -322,7 +335,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 1, list.size()); assertEquals("result has pserver ",pserver, list.get(0).iterator().next()); - g.tx().rollback(); + } @Test @@ -342,7 +355,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -362,7 +375,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { list.add(tQ.next()); assertFalse("Has next 3 ",tQ.hasNext()); assertTrue("Has all the vertexes", list.contains(v1) && list.remove(v2)); - g.tx().rollback(); + } @Test @@ -382,7 +395,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -402,7 +415,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(complex)); - g.tx().rollback(); + } @Test @@ -421,7 +434,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 edge ", 1, list.size()); assertTrue("1 - traversal results in edge ", list.contains(e)); - g.tx().rollback(); + } @Test @@ -440,7 +453,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("1 - Has 1 edge ", 1, list1.size()); assertTrue("1 - traversal results in edge ", list1.contains(e)); - g.tx().rollback(); + } @Test @@ -461,7 +474,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -482,7 +495,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -504,7 +517,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertTrue("result has default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test (expected = NoEdgeRuleFoundException.class) @@ -518,7 +531,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { QueryBuilder tQ = getNewEdgeTraversal(gvnf); tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Collections.emptyList()); - g.tx().rollback(); + } @Test @@ -538,7 +551,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 edges ", 1, list.size()); assertFalse("result does not have default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -558,7 +571,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 edges ", 2, list.size()); assertTrue("result has generic-vnf-pserver-A edge ", list.contains(e1)); assertTrue("result has generic-vnf-pserver-B edge ", list.contains(e2)); - g.tx().rollback(); + } @Test (expected = NoEdgeRuleFoundException.class) @@ -571,7 +584,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { List list = tQ.toList(); - g.tx().rollback(); + } private Vertex getVertex() throws AAIException { @@ -600,7 +613,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 1 edges ", 1, list.size()); assertFalse("result does not have default edge ", list.contains(e1)); assertTrue("result has other edge ", list.contains(e2)); - g.tx().rollback(); + } @Test @@ -620,7 +633,7 @@ public abstract class QueryBuilderTestAbstraction extends AAISetup { assertEquals("Has 2 edges ", 2, list.size()); assertTrue("result has generic-vnf-pserver-A edge ", list.contains(e1)); assertTrue("result has generic-vnf-pserver-B edge ", list.contains(e2)); - g.tx().rollback(); + } protected abstract QueryBuilder getNewEdgeTraversal(Vertex v); diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java b/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java index a3515ab9..4dfe2dbd 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/SimplePathTest.java @@ -79,9 +79,6 @@ public class SimplePathTest extends AAISetup { Vertex lint2 = graph.addVertex(T.label, "l-interface", T.id, "11", "aai-node-type", "l-interface", "interface-name", "lint2", "is-port-mirrored", "true", "in-maint", "true", "is-ip-unnumbered", "false"); - Vertex loglink2 = graph.addVertex(T.label, "logical-link", T.id, "21", "aai-node-type", "logical-link", - "link-name", "loglink2", "in-maint", "false", "link-type", "sausage"); - Vertex lint3 = graph.addVertex(T.label, "l-interface", T.id, "12", "aai-node-type", "l-interface", "interface-name", "lint3", "is-port-mirrored", "true", "in-maint", "true", "is-ip-unnumbered", "false"); @@ -91,8 +88,7 @@ public class SimplePathTest extends AAISetup { rules.addTreeEdge(g, gvnf1, lint1); rules.addEdge(g, lint1, loglink1); rules.addEdge(g, loglink1, lint2); - rules.addEdge(g, lint2, loglink2); - rules.addEdge(g, loglink2, lint3); + rules.addEdge(g, loglink1, lint3); rules.addTreeEdge(g, gvnf2, lint3); return g; diff --git a/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java b/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java index 41daf17f..81d42ddb 100644 --- a/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java +++ b/aai-core/src/test/java/org/onap/aai/query/builder/TraversalQueryTest.java @@ -75,20 +75,20 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("they are equal", expected, tQ.getQuery()); - g.tx().rollback(); + } @Test public void traversalClones() throws UnsupportedEncodingException, AAIException, URISyntaxException { QueryBuilder tQ = new TraversalQuery<>(loader, g); - QueryBuilder builder = tQ.createQueryFromURI(new URI("network/test-objects/test-object/key1")).getQueryBuilder(); - GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "test-object"); - GraphTraversal containerExpected = __.start().has("aai-node-type", "test-object"); + QueryBuilder builder = tQ.createQueryFromURI(new URI("network/generic-vnfs/generic-vnf/key1")).getQueryBuilder(); + GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf"); + GraphTraversal containerExpected = __.start().has("aai-node-type", "generic-vnf"); assertEquals("query object", expected.toString(), builder.getQuery().toString()); assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - g.tx().rollback(); + } @Test @@ -96,13 +96,21 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { QueryBuilder tQ = new TraversalQuery<>(loader, g); QueryBuilder builder = tQ.createQueryFromURI(new URI("network/generic-vnfs/generic-vnf/key1/l-interfaces/l-interface/key2")).getQueryBuilder(); - GraphTraversal expected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface").has("interface-name", "key2"); - GraphTraversal containerExpected = __.start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface"); + GraphTraversal expected = __.start() + .has("vnf-id", "key1") + .has("aai-node-type", "generic-vnf") + .in("org.onap.relationships.inventory.BelongsTo").has(AAIProperties.NODE_TYPE, "l-interface") + .has("interface-name", "key2"); + GraphTraversal containerExpected = __.start() + .has("vnf-id", "key1") + .has("aai-node-type", "generic-vnf") + .in("org.onap.relationships.inventory.BelongsTo") + .has(AAIProperties.NODE_TYPE, "l-interface"); assertEquals("query object", expected.toString(), builder.getQuery().toString()); assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - g.tx().rollback(); + } @Test @@ -121,7 +129,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 1 vertexes ", 1, list.size()); assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); - g.tx().rollback(); + } @Test @@ -146,7 +154,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("2 - Has 1 vertexes ", 1, list2.size()); assertTrue("2 - traversal results in vce ", list2.contains(vce)); - g.tx().rollback(); + } @Test @@ -165,7 +173,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("1 - Has 1 vertexes ", 1, list.size()); assertTrue("1 - traversal results in vnfc ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -187,7 +195,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertTrue("Has vertex on the default edge ", list.contains(vnfc1)); assertTrue("Has vertex on the re-uses edge ", list.contains(vnfc2)); - g.tx().rollback(); + } @Test @@ -207,7 +215,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(pserver)); - g.tx().rollback(); + } @Test @@ -227,7 +235,7 @@ public class TraversalQueryTest extends QueryBuilderTestAbstraction { assertEquals("Has 2 vertexes ", 2, list.size()); assertTrue("result has pserver ", list.contains(complex)); - g.tx().rollback(); + } diff --git a/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java b/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.java new file mode 100644 index 00000000..55fdd53d --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/CloudRegionTest.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.rest; + +import com.jayway.jsonpath.JsonPath; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.onap.aai.exceptions.AAIException; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + +/** + * CloudRegionTest is testing if you put a cloud region with all + * children nodes associated to it then you should be able to + * remove the cloud region without removing the individual child nodes first + */ +@RunWith(AAIJunitRunner.class) +public class CloudRegionTest { + + private HttpTestUtil httpTestUtil; + + @Before + public void setUp(){ + httpTestUtil = new HttpTestUtil(); + } + + @Ignore("Test is failing due to the deletion of node with children not correct will be fixed soon") + @Test + public void testPutWithAllCloudRegionChildrenNodesAndCheckIfDeleteIsSuccessful() throws IOException, AAIException { + + String cloudRegionPayload = PayloadUtil.getResourcePayload("cloud-region-with-all-children.json"); + String cloudRegionUri = "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/junit-cloud-owner/junit-cloud-region"; + + Response response = httpTestUtil.doPut(cloudRegionUri, cloudRegionPayload); + assertEquals("Expected the cloud region to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet(cloudRegionUri); + assertEquals("Expected the cloud region to be found", 200, response.getStatus()); + String jsonResponse = response.getEntity().toString(); + + JSONAssert.assertEquals(cloudRegionPayload, jsonResponse, false); + String resourceVersion = JsonPath.read(jsonResponse, "$.resource-version"); + + response = httpTestUtil.doDelete(cloudRegionUri, resourceVersion); + assertEquals("Expected the cloud region to be deleted", 204, response.getStatus()); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java b/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java new file mode 100644 index 00000000..f42eebb8 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/GenericVnfLInterfaceTest.java @@ -0,0 +1,78 @@ +/** + * ============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.rest; + +import org.json.JSONObject; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +@RunWith(AAIJunitRunner.class) +public class GenericVnfLInterfaceTest { + + private HttpTestUtil httpTestUtil; + + @Before + public void setUp(){ + httpTestUtil = new HttpTestUtil(); + } + + @Test + public void testPutTwoLInterfacesToGenericVnf() throws Exception { + + Map templateValueMap = new HashMap<>(); + templateValueMap.put("ip-address", "ipv1"); + + String resource = PayloadUtil.getTemplatePayload("generic-vnf-with-lag-interface.json", templateValueMap); + Response response = httpTestUtil.doPut("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resource); + assertEquals("Expecting the generic vnf to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet("/aai/v12/network/generic-vnfs/generic-vnf/vnf1"); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + resource = response.getEntity().toString().replaceAll("ipv1\",\"resource-version\":\"\\d+\"", "ipv2\""); + response = httpTestUtil.doPut("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resource); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + response = httpTestUtil.doGet("/aai/v12/network/generic-vnfs/generic-vnf/vnf1"); + assertEquals("Expecting the generic vnf to be updated", 200, response.getStatus()); + + String expected = PayloadUtil.getExpectedPayload("generic-vnf-with-lag-interface.json"); + JSONAssert.assertEquals(expected, response.getEntity().toString(), false); + + JSONObject jsonObject = new JSONObject(response.getEntity().toString()); + String resourceVersion = (String) jsonObject.get("resource-version"); + + response = httpTestUtil.doDelete("/aai/v12/network/generic-vnfs/generic-vnf/vnf1", resourceVersion); + assertEquals("Expecting the generic vnf to be deleted", 204, response.getStatus()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java b/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java new file mode 100644 index 00000000..3de8dfa2 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/rest/TenantTest.java @@ -0,0 +1,93 @@ +/** + * ============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.rest; + +import com.jayway.jsonpath.JsonPath; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.aai.AAIJunitRunner; +import org.onap.aai.HttpTestUtil; +import org.onap.aai.PayloadUtil; +import org.skyscreamer.jsonassert.JSONAssert; + +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import static org.junit.Assert.assertEquals; + +@RunWith(AAIJunitRunner.class) +public class TenantTest { + + private HttpTestUtil httpTestUtil; + + private Map templateValuesMap; + + @Before + public void setup(){ + httpTestUtil = new HttpTestUtil(); + templateValuesMap = new HashMap<>(); + } + + @Ignore("Test is failing due to the deletion of node with children not correct will be fixed soon") + @Test + public void testCloudRegionTenantDeleteSuccessWithoutDeletingVserver() throws Exception { + + templateValuesMap.put("cloud-region-id", UUID.randomUUID().toString()); + templateValuesMap.put("cloud-owner", UUID.randomUUID().toString()); + templateValuesMap.put("tenant-id", UUID.randomUUID().toString()); + templateValuesMap.put("vserver-id", UUID.randomUUID().toString()); + + String cloudRegionPayload = PayloadUtil.getTemplatePayload("cloud-region.json", templateValuesMap); + String cloudRegionUri = String.format("/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/%s/%s", + templateValuesMap.get("cloud-owner"), + templateValuesMap.get("cloud-region-id") + ); + + String tenantUri = cloudRegionUri + "/tenants/tenant/" + templateValuesMap.get("tenant-id"); + String tenantPayload = PayloadUtil.getTemplatePayload("tenant.json", templateValuesMap); + + Response response = httpTestUtil.doPut(cloudRegionUri, cloudRegionPayload); + assertEquals("Expected the cloud region to be created", 201, response.getStatus()); + + response = httpTestUtil.doGet(tenantUri); + assertEquals("Expected the cloud region to be created", 200, response.getStatus()); + String responseStr = response.getEntity().toString(); + + JSONAssert.assertEquals(tenantPayload, responseStr, false); + String resourceVersion = JsonPath.read(responseStr, "$.resource-version"); + + response = httpTestUtil.doDelete(tenantUri, resourceVersion); + assertEquals("Expected the cloud region to be created", 204, response.getStatus()); + + response = httpTestUtil.doGet(cloudRegionUri); + assertEquals("Expected the cloud region to be created", 200, response.getStatus()); + responseStr = response.getEntity().toString(); + resourceVersion = JsonPath.read(responseStr, "$.resource-version"); + + response = httpTestUtil.doDelete(cloudRegionUri, resourceVersion); + assertEquals("Expected the cloud region to be created", 204, response.getStatus()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java index f643fc47..0d4f4f14 100644 --- a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java +++ b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java @@ -52,6 +52,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.when; @@ -115,6 +116,31 @@ public class HttpEntryTest extends AAISetup { when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); } + private Response getResponse(HttpEntry httpEntry, Loader loader, TransactionalGraphEngine dbEngine, HttpMethod method, String uri, String content) throws UnsupportedEncodingException, AAIException { + URI uriObject = UriBuilder.fromPath(uri).build(); + QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); + String objType = uriQuery.getResultType(); + if (uri.endsWith("relationship")) { + objType = "relationship"; + } + Introspector obj = null; + if (method.equals(HttpMethod.GET)) { + obj = loader.introspectorFromName(objType); + } else { + obj = loader.unmarshal(objType, content, org.onap.aai.restcore.MediaType.getEnum("application/json")); + } + + DBRequest dbRequest = + new DBRequest.Builder(method, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") + .rawRequestContent(content).build(); + + List dbRequestList = new ArrayList<>(); + dbRequestList.add(dbRequest); + + Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); + return responsesTuple.getValue1().get(0).getValue1(); + } + @Test public void test1PutOnPserver() throws UnsupportedEncodingException, AAIException { @@ -124,99 +150,95 @@ public class HttpEntryTest extends AAISetup { Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = "{\"hostname\":\"junit-test1\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + dbEngine.commit(); + assertEquals("Expected the pserver to be created", 201, response.getStatus()); + } - Introspector obj = loader.unmarshal("pserver", content, org.onap.aai.restcore.MediaType.getEnum("application/json")); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.PUT, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + @Test + public void test2PutOnPserverNoPInterface() throws UnsupportedEncodingException, AAIException { - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = "{\"hostname\":\"junit-test2\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be created", 201, response.getStatus()); } @Test - public void test2GetOnPserver() throws UnsupportedEncodingException, AAIException { - + public void test3PutOnPInterface() { + try { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1/p-interfaces/p-interface/p1"; + String content = "{\"interface-name\":\"p1\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + dbEngine.commit(); + assertEquals("Expected the p-interface to be created", 201, response.getStatus()); + } catch (UnsupportedEncodingException | AAIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - String content = ""; - Introspector obj = loader.introspectorFromName("pserver"); + @Test + public void test4GetOnPserver() throws UnsupportedEncodingException, AAIException { - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; + String content = "{\"hostname\":\"junit-test1\", \"equip-type\":\"junit-equip-type\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be returned", 200, response.getStatus()); } @Test - public void test3MergePatchOnPserver() throws UnsupportedEncodingException, AAIException { + public void test5MergePatchOnPserver() throws UnsupportedEncodingException, AAIException { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = "{\"hostname\":\"junit-test1\", \"equip-type\":\"junit-equip-type\"}"; - - Introspector obj = loader.unmarshal("pserver", content, org.onap.aai.restcore.MediaType.getEnum("application/json")); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.MERGE_PATCH, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); - - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); - - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.MERGE_PATCH, uri, content); dbEngine.commit(); assertEquals("Expected the pserver to be updated", 200, response.getStatus()); } - private int doDelete(String resourceVersion) throws UnsupportedEncodingException, AAIException { + private int doDelete(String resourceVersion, String uri, String nodeType) throws UnsupportedEncodingException, AAIException { queryParameters.add("resource-version", resourceVersion); DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); + URI uriObject = UriBuilder.fromPath(uri).build(); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); String content = ""; - Introspector obj = loader.introspectorFromName("pserver"); + Introspector obj = loader.introspectorFromName(nodeType); DBRequest dbRequest = new DBRequest.Builder(HttpMethod.DELETE, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") @@ -232,7 +254,8 @@ public class HttpEntryTest extends AAISetup { } @Test - public void test4DeleteOnPserver() throws UnsupportedEncodingException, AAIException { + public void test6DeleteOnPserver() throws UnsupportedEncodingException, AAIException { + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); @@ -240,22 +263,31 @@ public class HttpEntryTest extends AAISetup { TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test1").build(); - - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); - + String uri = "/cloud-infrastructure/pservers/pserver/junit-test1"; String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); + dbEngine.commit(); + String msg = response.getEntity().toString(); + JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); + String resourceVersion = ""; + if ( jsonObj.isJsonObject()) { + resourceVersion = jsonObj.get("resource-version").getAsString(); + } + assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion, "/cloud-infrastructure/pservers/pserver/junit-test1", "pserver")); + } - Introspector obj = loader.introspectorFromName("pserver"); - - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + @Test + public void test7DeleteOnPserverNoPinterface() throws UnsupportedEncodingException, AAIException { - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); String msg = response.getEntity().toString(); JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); @@ -263,36 +295,79 @@ public class HttpEntryTest extends AAISetup { if ( jsonObj.isJsonObject()) { resourceVersion = jsonObj.get("resource-version").getAsString(); } - assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion)); + assertEquals("Expected the pserver to be deleted", 204, doDelete(resourceVersion, "/cloud-infrastructure/pservers/pserver/junit-test2", "pserver")); } + @Test - public void test5FailedGetOnPserver() throws UnsupportedEncodingException, AAIException { + public void test8FailedGetOnPserver() throws UnsupportedEncodingException, AAIException { DBConnectionType type = DBConnectionType.REALTIME; HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); Loader loader = httpEntry.getLoader(); TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - URI uriObject = UriBuilder.fromPath("/cloud-infrastructure/pservers/pserver/junit-test2").build(); + String uri = "/cloud-infrastructure/pservers/pserver/junit-test2"; + String content = ""; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.GET, uri, content); + dbEngine.commit(); - QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); + assertEquals("Expected the pserver to be deleted", 404, response.getStatus()); + } - String content = ""; + @Test + public void putEdgeTest() throws UnsupportedEncodingException, AAIException { - Introspector obj = loader.introspectorFromName("pserver"); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - DBRequest dbRequest = - new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, httpHeaders, uriInfo, "JUNIT-TRANSACTION") - .rawRequestContent(content).build(); + //Put pserver + String uri = "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver"; + String content = "{\"hostname\":\"junit-edge-test-pserver\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + //Put complex + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex"; + content = "{\"physical-location-id\":\"junit-edge-test-complex\",\"physical-location-type\":\"AAIDefault\",\"street1\":\"AAIDefault\",\"city\":\"AAIDefault\",\"state\":\"NJ\",\"postal-code\":\"07748\",\"country\":\"USA\",\"region\":\"US\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + + //PutEdge + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex/relationship-list/relationship"; + content = "{\"related-to\":\"pserver\",\"related-link\":\"/aai/" + Version.getLatest().toString() + "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver\",\"relationship-label\":\"org.onap.relationships.inventory.LocatedIn\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT_EDGE, uri, content); + + dbEngine.rollback(); + //System.out.println(response.getEntity().toString()); + assertEquals("Expected the pserver to be created", 200, response.getStatus()); + } - List dbRequestList = new ArrayList<>(); - dbRequestList.add(dbRequest); + @Test + public void putEdgeWrongLabelTest() throws UnsupportedEncodingException, AAIException { - Pair>> responsesTuple = httpEntry.process(dbRequestList, "JUNIT"); - Response response = responsesTuple.getValue1().get(0).getValue1(); - dbEngine.commit(); + DBConnectionType type = DBConnectionType.REALTIME; + HttpEntry httpEntry = new HttpEntry(Version.getLatest(), ModelType.MOXY, QueryStyle.TRAVERSAL, type); + Loader loader = httpEntry.getLoader(); + TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); - assertEquals("Expected the pserver to be deleted", 404, response.getStatus()); + //Put pserver + String uri = "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver"; + String content = "{\"hostname\":\"junit-edge-test-pserver\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + //Put complex + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex"; + content = "{\"physical-location-id\":\"junit-edge-test-complex\",\"physical-location-type\":\"AAIDefault\",\"street1\":\"AAIDefault\",\"city\":\"AAIDefault\",\"state\":\"NJ\",\"postal-code\":\"07748\",\"country\":\"USA\",\"region\":\"US\"}"; + getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT, uri, content); + + //PutEdge + uri = "/cloud-infrastructure/complexes/complex/junit-edge-test-complex/relationship-list/relationship"; + content = "{\"related-to\":\"pserver\",\"related-link\":\"/aai/" + Version.getLatest().toString() + "/cloud-infrastructure/pservers/pserver/junit-edge-test-pserver\",\"relationship-label\":\"junk\"}"; + Response response = getResponse(httpEntry, loader, dbEngine, HttpMethod.PUT_EDGE, uri, content); + + dbEngine.rollback(); + String msg = response.getEntity().toString(); + assertEquals("Expected the pserver to be created", 400, response.getStatus()); + assertTrue(msg.contains("ERR.5.4.6107")); + assertTrue(msg.contains("Required Edge-property not found in input data:no COUSIN edge rule between complex and pserver with label junk")); } } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java index 5fade2ed..b124e5dd 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/db/DbSerializerTest.java @@ -1,28 +1,27 @@ -/*- +/** * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * 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 - * + * + * 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.serialization.db; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -30,10 +29,7 @@ import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -41,10 +37,7 @@ import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.*; import org.junit.rules.ExpectedException; import org.onap.aai.AAISetup; import org.onap.aai.db.props.AAIProperties; @@ -69,7 +62,7 @@ public class DbSerializerTest extends AAISetup { @Rule public ExpectedException thrown = ExpectedException.none(); - protected Graph graph; + protected static Graph graph; protected final EdgeRules rules = EdgeRules.getInstance(); private final Version version = Version.getLatest(); @@ -82,22 +75,27 @@ public class DbSerializerTest extends AAISetup { private DBSerializer dbser; TransactionalGraphEngine spy; TransactionalGraphEngine.Admin adminSpy; - + + @BeforeClass + public static void init() throws Exception { + graph = TitanFactory.build().set("storage.backend", "inmemory").open(); + createGraph(); + + } + @Before public void setup() throws Exception { - graph = TitanFactory.build().set("storage.backend", "inmemory").open(); loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); dbEngine = new TitanDBEngine(queryStyle, type, loader); spy = spy(dbEngine); adminSpy = spy(dbEngine.asAdmin()); - - createGraph(); + engine = new TitanDBEngine(queryStyle, type, loader); dbser = new DBSerializer(version, engine, introspectorFactoryType, "AAI-TEST"); } - public void createGraph() throws AAIException { + public static void createGraph() throws AAIException { /* * This setus up the test graph, For future junits , add more vertices * and edges @@ -115,19 +113,63 @@ public class DbSerializerTest extends AAISetup { .next(); GraphTraversalSource g = graph.traversal(); - rules.addEdge(g, l3interipv4addresslist_1, subnet_2); - rules.addEdge(g, l3interipv6addresslist_3, subnet_4); - rules.addTreeEdge(g, subnet_5, l3network_6); + EdgeRules.getInstance().addEdge(g, l3interipv4addresslist_1, subnet_2); + EdgeRules.getInstance().addEdge(g, l3interipv6addresslist_3, subnet_4); + EdgeRules.getInstance().addTreeEdge(g, subnet_5, l3network_6); + } + + @Test + public void testFindDeletableDoesNotReturnDuplicates() throws AAIException { + EdgeRules testRules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); + + Vertex genericVnf1 = graph.addVertex("aai-node-type", "generic-vnf", "vnf-id", "vnf1", "vnf-name", "vnfName1"); + + Vertex lInterface1 = graph.addVertex("aai-node-type", "l-interface", "interface-name", "lInterface1"); + Vertex lInterface2 = graph.addVertex("aai-node-type", "l-interface", "interface-name", "lInterface2"); + + Vertex logicalLink1 = graph.addVertex("aai-node-type", "logical-link", "link-name", "logicalLink1"); + Vertex logicalLink2 = graph.addVertex("aai-node-type", "logical-link", "link-name", "logicalLink2"); + + GraphTraversalSource g = graph.traversal(); + + testRules.addTreeEdge(g, genericVnf1, lInterface1); + testRules.addTreeEdge(g, genericVnf1, lInterface2); + testRules.addEdge(g, lInterface1, logicalLink1); + testRules.addEdge(g, lInterface1, logicalLink2); + // This line will cause the logical link2 to be found twice under linterface 1 + // and also under the linterface 2 and since in the past deletable returned + // duplicates this test checks that it shouldn't return duplicates + testRules.addEdge(g, lInterface2, logicalLink2); + + when(spy.asAdmin()).thenReturn(adminSpy); + when(adminSpy.getTraversalSource()).thenReturn(g); + when(adminSpy.getReadOnlyTraversalSource()).thenReturn(g); + + List deletableVertexes = spy.getQueryEngine().findDeletable(genericVnf1); + Set vertexSet = new HashSet<>(); + + for (Vertex deletableVertex : deletableVertexes) { + if(!vertexSet.contains(deletableVertex)){ + vertexSet.add(deletableVertex); + } else { + fail("Find deletable is returning a list of duplicate vertexes"); + } + } } @After public void tearDown() throws Exception { + engine.rollback(); + } + + @AfterClass + public static void destroy() throws Exception { graph.close(); } @Test - public void subnetDelwithInEdgesIpv4Test() throws AAIException { + public void subnetDelWithInEdgesIpv4Test() throws AAIException { String expected_message = "Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv4-address-list]"; /* @@ -141,7 +183,7 @@ public class DbSerializerTest extends AAISetup { } @Test - public void subnetDelwithInEdgesIpv6Test() throws AAIException { + public void subnetDelWithInEdgesIpv6Test() throws AAIException { String expected_message = "Object is being reference by additional objects preventing it from being deleted. Please clean up references from the following types [l3-interface-ipv6-address-list]"; /* @@ -154,7 +196,7 @@ public class DbSerializerTest extends AAISetup { } @Test - public void subnetDelwithInEdgesL3network() throws AAIException { + public void subnetDelWithInEdgesL3network() throws AAIException { String expected_message = ""; /* @@ -169,7 +211,6 @@ public class DbSerializerTest extends AAISetup { public String testDelete(Vertex v) throws AAIException { - // Graph g_tx = graph.newTransaction(); GraphTraversalSource traversal = graph.traversal(); when(spy.asAdmin()).thenReturn(adminSpy); when(adminSpy.getTraversalSource()).thenReturn(traversal); @@ -181,7 +222,6 @@ public class DbSerializerTest extends AAISetup { serializer.delete(v, "resourceVersion", false); } catch (AAIException exception) { exceptionMessage = exception.getMessage(); - } return exceptionMessage; @@ -197,7 +237,7 @@ public class DbSerializerTest extends AAISetup { Vertex fromGraph = engine.tx().traversal().V().has("aai-node-type","generic-vnf").toList().get(0); assertEquals(testVertex.id(), fromGraph.id()); assertEquals("AAI-TEST", fromGraph.property(AAIProperties.SOURCE_OF_TRUTH.toString()).value()); - engine.rollback(); + } @Test @@ -205,22 +245,38 @@ public class DbSerializerTest extends AAISetup { engine.startTransaction(); DBSerializer dbser2 = new DBSerializer(Version.getLatest(), engine, introspectorFactoryType, "AAI-TEST-2"); - Graph graph = TinkerGraph.open(); Vertex vert = graph.addVertex("aai-node-type", "generic-vnf"); dbser.touchStandardVertexProperties(vert, true); - String resverStart = (String)vert.property(AAIProperties.RESOURCE_VERSION.toString()).value(); - String lastModTimeStart = (String)vert.property(AAIProperties.LAST_MOD_TS.toString()).value(); + String resverStart = (String)vert.property(AAIProperties.RESOURCE_VERSION).value(); + String lastModTimeStart = (String)vert.property(AAIProperties.LAST_MOD_TS).value(); Thread.sleep(10); //bc the resource version is set based on current time in milliseconds, //if this test runs through too fast the value may not change //causing the test to fail. sleeping ensures a different value dbser2.touchStandardVertexProperties(vert, false); - assertFalse(resverStart.equals((String)vert.property(AAIProperties.RESOURCE_VERSION.toString()).value())); - assertFalse(lastModTimeStart.equals((String)vert.property(AAIProperties.LAST_MOD_TS.toString()).value())); - assertEquals("AAI-TEST-2", (String)vert.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH.toString()).value()); - engine.rollback(); + assertFalse(resverStart.equals(vert.property(AAIProperties.RESOURCE_VERSION).value())); + assertFalse(lastModTimeStart.equals(vert.property(AAIProperties.LAST_MOD_TS).value())); + assertEquals("AAI-TEST-2", vert.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH).value()); + + } + + @Test + public void touchStandardVertexPropertiesAAIUUIDTest() throws AAIException, InterruptedException { + engine.startTransaction(); + + Graph graph = TinkerGraph.open(); + Vertex v = graph.addVertex("aai-node-type", "generic-vnf"); + + dbser.touchStandardVertexProperties(v, true); + + assertTrue(v.property(AAIProperties.AAI_UUID).isPresent()); + try { + UUID.fromString((String)v.property(AAIProperties.AAI_UUID).value()); + } catch (IllegalArgumentException e) { + fail("Vertex uuid is not valid uuid"); + } } @Test @@ -228,7 +284,7 @@ public class DbSerializerTest extends AAISetup { engine.startTransaction(); assertTrue(dbser.verifyResourceVersion("delete", "vnfc", "abc", "abc", "vnfcs/vnfc/vnfcId")); - engine.rollback(); + } @Test @@ -237,11 +293,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version passed for create of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("create", "generic-vnf", null, "old-res-ver", "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("create", "generic-vnf", null, "old-res-ver", "generic-vnfs/generic-vnf/myid"); + } @Test @@ -250,11 +303,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version not passed for update of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", null, "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", null, "generic-vnfs/generic-vnf/myid"); + } @Test @@ -263,11 +313,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("resource-version MISMATCH for update of generic-vnfs/generic-vnf/myid"); - try { - dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", "old-res-ver", "generic-vnfs/generic-vnf/myid"); - } finally { - engine.rollback(); - } + dbser.verifyResourceVersion("update", "generic-vnf", "current-res-ver", "old-res-ver", "generic-vnfs/generic-vnf/myid"); + } @Test @@ -291,7 +338,7 @@ public class DbSerializerTest extends AAISetup { cr.property("aai-node-type").remove(); URI compareFailure = new URI("/unknown-uri"); assertEquals(compareFailure, dbser.getURIForVertex(ten)); - engine.rollback(); + } @Test @@ -304,7 +351,7 @@ public class DbSerializerTest extends AAISetup { assertEquals("cloud-region", crIntro.getDbName()); assertEquals("me", crIntro.getValue("cloud-owner")); assertEquals("123", crIntro.getValue("cloud-region-id")); - engine.rollback(); + } @Test @@ -334,7 +381,7 @@ public class DbSerializerTest extends AAISetup { (String)ten.property(AAIProperties.AAI_URI.toString()).value()); assertEquals("/cloud-infrastructure/cloud-regions/cloud-region/me/123/tenants/tenant/453/vservers/vserver/vs1", (String)vs.property(AAIProperties.AAI_URI.toString()).value()); - engine.rollback(); + } @Test @@ -347,8 +394,8 @@ public class DbSerializerTest extends AAISetup { rules.addTreeEdge(engine.tx().traversal(), cr, ten); Edge e = dbser.getEdgeBetween(EdgeType.TREE, ten, cr, null); - assertEquals("has", e.label()); - engine.rollback(); + assertEquals("org.onap.relationships.inventory.BelongsTo", e.label()); + } @Test @@ -372,7 +419,7 @@ public class DbSerializerTest extends AAISetup { assertFalse(engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertFalse(engine.tx().traversal().V(vnfc).both("uses").hasNext()); - engine.rollback(); + } @Test @@ -392,11 +439,11 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-data",relData); assertTrue(dbser.createEdge(relationship, gvnf)); - assertTrue(engine.tx().traversal().V(gvnf).both("uses").hasNext()); - assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); - engine.rollback(); + assertTrue(engine.tx().traversal().V(gvnf).both("org.onap.relationships.inventory.BelongsTo").hasNext()); + assertTrue(engine.tx().traversal().V(vnfc).both("org.onap.relationships.inventory.BelongsTo").hasNext()); + } - + @Test public void createCousinEdgeThatShouldBeTreeTest() throws AAIException, UnsupportedEncodingException, URISyntaxException { engine.startTransaction(); @@ -405,31 +452,27 @@ public class DbSerializerTest extends AAISetup { Vertex vf = engine.tx().addVertex("aai-node-type","vf-module","vf-module-id","vf-id"); EdgeRules.getInstance().addTreeEdge(engine.tx().traversal(), gvnf, vf); - + Introspector relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vf-module"); relationship.setValue("related-link", dbser.getURIForVertex(vf).toString()); - //relationship.setValue("relationship-label", ""); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf2 = dbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf-1"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf-1")); - + try { dbser.serializeToDb(gvnfObj, gvnf2, uriQuery, null, "test"); } catch (AAIException e) { assertEquals("AAI_6145", e.getCode()); - } - finally { - engine.rollback(); } } - + @Test public void createEdgeNodeDoesNotExistExceptionTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); @@ -447,11 +490,8 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("Node of type vnfc. Could not find object at: /network/vnfcs/vnfc/b-name"); - try { - dbser.createEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + dbser.createEdge(relationship, gvnf); + } @Test @@ -464,7 +504,7 @@ public class DbSerializerTest extends AAISetup { gvnf.setValue("vnf-id", "myvnf"); dbser.serializeSingleVertex(gvnfVert, gvnf, "test"); assertTrue(engine.tx().traversal().V().has("aai-node-type","generic-vnf").has("vnf-id","myvnf").hasNext()); - engine.rollback(); + } @Test @@ -483,10 +523,10 @@ public class DbSerializerTest extends AAISetup { dbser.serializeSingleVertex(ten, tenIn, "test"); assertTrue(engine.tx().traversal().V().has("aai-node-type","tenant").has("tenant-id","453").has("tenant-name","mytenant").hasNext()); - engine.rollback(); + } - - + + @Test public void getVertexPropertiesRelationshipHasLabelTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); @@ -495,15 +535,21 @@ public class DbSerializerTest extends AAISetup { Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123"); EdgeRules rules = EdgeRules.getInstance(); rules.addEdge(engine.tx().traversal(), gvnf, vnfc); - + Introspector obj = loader.introspectorFromName("generic-vnf"); obj = this.dbser.dbToObject(Arrays.asList(gvnf), obj, AAIProperties.MAXIMUM_DEPTH, false, "false"); - - assertEquals("edge label between generic-vnf and vnfs is uses", "uses", obj.getWrappedValue("relationship-list").getWrappedListValue("relationship").get(0).getValue("relationship-label")); - - engine.rollback(); + + assertEquals("edge label between generic-vnf and vnfs is uses", + "org.onap.relationships.inventory.BelongsTo", + obj.getWrappedValue("relationship-list") + .getWrappedListValue("relationship") + .get(0) + .getValue("relationship-label") + ); + + } - + @Test public void getVertexPropertiesRelationshipOldVersionNoEdgeLabelTest() throws AAIException, UnsupportedEncodingException { @@ -512,7 +558,7 @@ public class DbSerializerTest extends AAISetup { Loader loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); engine.startTransaction(); - + Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","vnf-123"); Vertex vnfc = engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","vnfc-123"); EdgeRules rules = EdgeRules.getInstance(); @@ -520,19 +566,19 @@ public class DbSerializerTest extends AAISetup { Introspector obj = loader.introspectorFromName("generic-vnf"); obj = dbser.dbToObject(Arrays.asList(gvnf), obj, AAIProperties.MAXIMUM_DEPTH, false, "false"); - + assertEquals("Relationship does not contain edge-property", false, obj.getWrappedValue("relationship-list").getWrappedListValue("relationship").get(0).hasProperty("relationship-label")); - - engine.rollback(); + + } - + @Test public void createEdgeWithValidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -547,16 +593,16 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "over-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("over-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); - engine.rollback(); + } - + @Test public void createEdgeWithInvalidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -573,20 +619,17 @@ public class DbSerializerTest extends AAISetup { thrown.expect(AAIException.class); thrown.expectMessage("no COUSIN edge rule between generic-vnf and vnfc with label NA"); - try { - dbser.createEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + dbser.createEdge(relationship, gvnf); + } - + @Test public void createEdgeWithValidLabelWhenSameEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -601,20 +644,20 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("re-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("re-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(vnfc).both().count().next()); - engine.rollback(); + } - + @Test public void createEdgeWithValidLabelWhenDiffEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -630,9 +673,9 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "uses"); localDbser.createEdge(relationship, gvnf); - + relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("re-uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("re-uses").hasNext()); @@ -640,15 +683,15 @@ public class DbSerializerTest extends AAISetup { assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void createEdgeWithNoLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -662,23 +705,23 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); localDbser.createEdge(relationship, gvnf); - + assertTrue(localDbser.createEdge(relationship, gvnf)); assertTrue(engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertTrue(engine.tx().traversal().V(vnfc).both("uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithNoLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); - + DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -694,7 +737,7 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); - + assertTrue(localDbser.deleteEdge(relationship, gvnf)); assertFalse("generic-vnf has no edge uses", engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertFalse("vnfc has no edge uses", engine.tx().traversal().V(vnfc).both("uses").hasNext()); @@ -704,15 +747,15 @@ public class DbSerializerTest extends AAISetup { assertTrue("vnfc has edge re-uses", engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithValidLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -729,7 +772,7 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "re-uses"); - + assertTrue(localDbser.deleteEdge(relationship, gvnf)); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V(gvnf).both("uses").hasNext()); assertTrue("vnfc has edge uses", engine.tx().traversal().V(vnfc).both("uses").hasNext()); @@ -739,15 +782,15 @@ public class DbSerializerTest extends AAISetup { assertTrue("vnfc has edge re-uses", engine.tx().traversal().V(vnfc).both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(vnfc).both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V(gvnf).both().count().next()); - engine.rollback(); + } - + @Test public void deleteEdgeWithValidInvalidLabelWhenMultipleExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); Vertex gvnf = engine.tx().addVertex("aai-node-type","generic-vnf","vnf-id","myvnf"); @@ -764,24 +807,20 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); relationship.setValue("relationship-data",relData); relationship.setValue("relationship-label", "NA"); - + thrown.expect(AAIException.class); thrown.expectMessage("no COUSIN edge rule between generic-vnf and vnfc with label NA"); - try { - localDbser.deleteEdge(relationship, gvnf); - } finally { - engine.rollback(); - } + localDbser.deleteEdge(relationship, gvnf); } - + @Test public void serializeToDbWithLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -790,16 +829,16 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-label", "re-uses"); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertFalse("generic-vnf has no edge re-uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -810,17 +849,17 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge re-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithoutLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -829,16 +868,16 @@ public class DbSerializerTest extends AAISetup { Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -849,17 +888,17 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithInvalidLabelTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); - + engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); Introspector relationship = loader.introspectorFromName("relationship"); @@ -868,33 +907,29 @@ public class DbSerializerTest extends AAISetup { relationship.setValue("relationship-label", "NA"); Introspector relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", Collections.singletonList(relationship.getUnderlyingObject())); - + Introspector gvnfObj = loader.introspectorFromName("generic-vnf"); Vertex gvnf = localDbser.createNewVertex(gvnfObj); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - + thrown.expect(AAIException.class); thrown.expectMessage("No EdgeRule found for passed nodeTypes: generic-vnf, vnfc with label NA."); - try { - localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - } finally { - engine.rollback(); - } - engine.rollback(); + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); + } - + @Test public void serializeToDbWithLabelAndEdgeExistsTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); - + Introspector relationship; Introspector relationshipList; List relList = new ArrayList<>(); @@ -905,7 +940,7 @@ public class DbSerializerTest extends AAISetup { gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - // create relationship to vnfc + // create relationship to vnfc relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); @@ -913,10 +948,10 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + // add gvnf to graph localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + // add second relationship relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); @@ -926,9 +961,9 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -939,18 +974,18 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 2", Long.valueOf(2), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } - + @Test public void serializeToDbWithLabelDroppingRelationshipTest() throws AAIException, UnsupportedEncodingException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException { - + EdgeRules ers = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); DBSerializer localDbser = getDBSerializerWithSpecificEdgeRules(ers); - + engine.startTransaction(); engine.tx().addVertex("aai-node-type","vnfc","vnfc-name","a-name"); - + Introspector relationship; Introspector relationshipList; List relList = new ArrayList<>(); @@ -961,7 +996,7 @@ public class DbSerializerTest extends AAISetup { gvnfObj.setValue("vnf-id", "myvnf"); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(new URI("/network/generic-vnfs/generic-vnf/myvnf")); - // create relationship to vnfc + // create relationship to vnfc relationship = loader.introspectorFromName("relationship"); relationship.setValue("related-to", "vnfc"); relationship.setValue("related-link", "/network/vnfcs/vnfc/a-name"); @@ -975,18 +1010,18 @@ public class DbSerializerTest extends AAISetup { relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + // add gvnf to graph localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + // drop second relationship relList.remove(1); relationshipList = loader.introspectorFromName("relationship-list"); relationshipList.setValue("relationship", relList); gvnfObj.setValue("relationship-list", relationshipList.getUnderlyingObject()); - + localDbser.serializeToDb(gvnfObj, gvnf, uriQuery, null, "test"); - + assertTrue("vertex with vnf-id myvnf exists", engine.tx().traversal().V().has("vnf-id", "myvnf").hasNext()); assertTrue("vertex with vnfc-name a-name exists", engine.tx().traversal().V().has("vnfc-name", "a-name").hasNext()); assertTrue("generic-vnf has edge uses", engine.tx().traversal().V().has("vnf-id", "myvnf").both("uses").hasNext()); @@ -997,7 +1032,7 @@ public class DbSerializerTest extends AAISetup { assertFalse("vnfc has no edge over-uses", engine.tx().traversal().V().has("vnfc-name", "a-name").both("over-uses").hasNext()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnfc-name", "a-name").both().count().next()); assertEquals("Number of edges between vertexes is 1", Long.valueOf(1), engine.tx().traversal().V().has("vnf-id", "myvnf").both().count().next()); - engine.rollback(); + } private DBSerializer getDBSerializerWithSpecificEdgeRules(EdgeRules ers) @@ -1016,9 +1051,9 @@ public class DbSerializerTest extends AAISetup { Introspector gv = loader.introspectorFromName("generic-vnf"); gv.setValue("vnf-name", "myname"); Introspector rel = loader.introspectorFromName("relationship"); - DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, + DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, ModelType.MOXY, "AAI-TEST"); - + dbser.addRelatedToProperty(rel, gv); List relToProps = rel.getWrappedListValue("related-to-property"); assertTrue(relToProps.size() == 1); @@ -1026,40 +1061,40 @@ public class DbSerializerTest extends AAISetup { assertTrue("generic-vnf.vnf-name".equals(relToProp.getValue("property-key"))); assertTrue("myname".equals(relToProp.getValue("property-value"))); } - + @Test public void dbToObjectContainerMismatchTest() throws AAIException, UnsupportedEncodingException { - DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, + DBSerializer dbser = new DBSerializer(Version.v11, dbEngine, ModelType.MOXY, "AAI-TEST"); - + Graph vertexMaker = TinkerGraph.open(); Vertex a = vertexMaker.addVertex(T.id, "0"); Vertex b = vertexMaker.addVertex(T.id, "1"); List vertices = Arrays.asList(a,b); - + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); Introspector intro = loader.introspectorFromName("image"); //just need any non-container object - + thrown.expect(AAIException.class); thrown.expectMessage("query object mismatch: this object cannot hold multiple items."); - + dbser.dbToObject(vertices, intro, Integer.MAX_VALUE, true, "doesn't matter"); } - + @Test public void dbToObjectTest() throws AAIException, UnsupportedEncodingException { engine.startTransaction(); - - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + Vertex gv1 = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex gv2 = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id2"); List vertices = Arrays.asList(gv1, gv2); - + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.getLatest()); Introspector gvContainer = loader.introspectorFromName("generic-vnfs"); - + Introspector res = dbser.dbToObject(vertices, gvContainer, 0, true, "true"); List gvs = res.getWrappedListValue("generic-vnf"); assertTrue(gvs.size() == 2); @@ -1067,75 +1102,75 @@ public class DbSerializerTest extends AAISetup { String vnfId = i.getValue("vnf-id"); assertTrue("id1".equals(vnfId) || "id2".equals(vnfId)); } - - engine.rollback(); + + } - + @Test public void getEdgeBetweenNoLabelTest() throws AAIException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); rules.addTreeEdge(engine.tx().traversal(), gv, lint); - + Edge res = dbser.getEdgeBetween(EdgeType.TREE, gv, lint); - assertTrue("hasLInterface".equals(res.label())); - engine.rollback(); + assertEquals("org.onap.relationships.inventory.BelongsTo", res.label()); + } @Test public void deleteItemsWithTraversal() throws AAIException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); - + assertTrue(engine.tx().traversal().V().has("vnf-id", "id1").hasNext()); assertTrue(engine.tx().traversal().V().has("interface-name", "name1").hasNext()); - + dbser.deleteItemsWithTraversal(Arrays.asList(gv, lint)); - + assertTrue(!engine.tx().traversal().V().has("vnf-id", "id1").hasNext()); assertTrue(!engine.tx().traversal().V().has("interface-name", "name1").hasNext()); - - engine.rollback(); + + } - + @Test public void serializeToDbWithParentTest() throws AAIException, UnsupportedEncodingException, URISyntaxException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); Vertex gv = engine.tx().addVertex("aai-node-type", "generic-vnf", "vnf-id", "id1"); Vertex lint = engine.tx().addVertex("aai-node-type", "l-interface", "interface-name", "name1"); rules.addTreeEdge(engine.tx().traversal(), gv, lint); - + Introspector lintIntro = loader.introspectorFromName("l-interface"); lintIntro.setValue("interface-role", "actor"); URI lintURI = new URI("/network/generic-vnfs/generic-vnf/id1/l-interfaces/l-interface/name1"); QueryParser uriQuery = dbEngine.getQueryBuilder(gv).createQueryFromURI(lintURI); dbser.serializeToDb(lintIntro, lint, uriQuery, "test-identifier", "AAI-TEST"); - + assertTrue(engine.tx().traversal().V(lint).has("interface-role", "actor").hasNext()); - - engine.rollback(); + + } - + @Test public void getLatestVersionViewTest() throws AAIException, UnsupportedEncodingException { - DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, + DBSerializer dbser = new DBSerializer(Version.getLatest(), engine, ModelType.MOXY, "AAI-TEST"); - + engine.startTransaction(); - Vertex phys = engine.tx().addVertex("aai-node-type", "physical-link", "link-name", "zaldo", + Vertex phys = engine.tx().addVertex("aai-node-type", "physical-link", "link-name", "zaldo", "speed-value", "very-fast", "service-provider-bandwidth-up-units", "things"); - + Introspector res = dbser.getLatestVersionView(phys); assertTrue("zaldo".equals(res.getValue("link-name"))); assertTrue("very-fast".equals(res.getValue("speed-value"))); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java b/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java index bc6a721f..773b9cd2 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/db/EdgeRulesTest.java @@ -22,9 +22,10 @@ package org.onap.aai.serialization.db; -import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.*; import org.junit.Test; import org.onap.aai.AAISetup; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -34,13 +35,11 @@ import java.util.Map; import java.util.Set; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.T; -import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.junit.Rule; import org.junit.rules.ExpectedException; +import org.onap.aai.db.props.AAIProperties; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Version; import org.onap.aai.serialization.db.exceptions.EdgeMultiplicityException; @@ -61,7 +60,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "cloud-region", "flavor"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("out direction", rule.getDirection(), Direction.IN); } @Test @@ -69,7 +68,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "flavor", "cloud-region"); - assertEquals("in direction", rule.getDirection(), Direction.IN); + assertEquals("in direction", rule.getDirection(), Direction.OUT); } @Test @@ -77,7 +76,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "model-ver", "model-element"); - assertEquals("in direction", rule.getDirection(), Direction.IN); + assertEquals("in direction", Direction.IN, rule.getDirection()); } @Test @@ -85,21 +84,25 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "model-element", "model-ver"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("out direction", Direction.OUT, rule.getDirection()); } @Test public void verifyMultipleGet() throws AAIException { EdgeRules rules = EdgeRules.getInstance(); Map ruleMap = rules.getEdgeRules("model-element", "model-ver"); - assertEquals("has isA rule", "isA", ruleMap.get("isA").getLabel()); - assertEquals("has startsWith rule", "startsWith", ruleMap.get("startsWith").getLabel()); + assertEquals("has isA rule", "org.onap.relationships.inventory.IsA", + ruleMap.get("org.onap.relationships.inventory.IsA").getLabel()); + assertEquals("has startsWith rule", "org.onap.relationships.inventory.BelongsTo", + ruleMap.get("org.onap.relationships.inventory.BelongsTo").getLabel()); } @Test public void verifyMultipleGetSingleRule() throws AAIException { EdgeRules rules = EdgeRules.getInstance(); Map ruleMap = rules.getEdgeRules("availability-zone", "complex"); - assertEquals("has groupsResourcesIn rule", "groupsResourcesIn", ruleMap.get("groupsResourcesIn").getLabel()); + + assertEquals("has org.onap.relationships.inventory.LocatedIn rule", "org.onap.relationships.inventory.LocatedIn", + ruleMap.get("org.onap.relationships.inventory.LocatedIn").getLabel()); } @Test @@ -116,7 +119,7 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: pserver | complex", true, EdgeRules.getInstance().hasEdgeRule("pserver", "complex")); assertEquals("false: pserver | service", false, EdgeRules.getInstance().hasEdgeRule("pserver", "service")); } - + @Test public void hasTreeEdgeRuleTest() { assertEquals("true: cloud-region | tenant", true, EdgeRules.getInstance().hasTreeEdgeRule("cloud-region", "tenant")); @@ -125,7 +128,7 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: service-instance | allotted-resource", true, EdgeRules.getInstance().hasTreeEdgeRule("service-instance", "allotted-resource")); } - + @Test public void hasCousinEdgeRuleTest() { assertEquals("false: cloud-region | tenant", false, EdgeRules.getInstance().hasCousinEdgeRule("cloud-region", "tenant", null)); @@ -133,11 +136,11 @@ public class EdgeRulesTest extends AAISetup { assertEquals("true: pserver | complex", true, EdgeRules.getInstance().hasCousinEdgeRule("pserver", "complex", null)); assertEquals("true: service-instance | allotted-resource", true, EdgeRules.getInstance().hasCousinEdgeRule("service-instance", "allotted-resource", null)); assertEquals("true: logical-link | l-interface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", null)); - assertEquals("true: logical-link | l-interface : sourceLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "sourceLInterface")); - assertEquals("true: logical-link | l-interface : targetLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "targetLInterface")); + assertEquals("true: logical-link | l-interface : sourceLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "org.onap.relationships.inventory.Source")); + assertEquals("true: logical-link | l-interface : targetLInterface", true, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "org.onap.relationships.inventory.Destination")); assertEquals("false: logical-link | l-interface : blah", false, EdgeRules.getInstance().hasCousinEdgeRule("logical-link", "l-interface", "blah")); } - + @Test public void hasEdgeRuleVertexTest() { Graph graph = TinkerGraph.open(); @@ -153,11 +156,11 @@ public class EdgeRulesTest extends AAISetup { Vertex v2 = graph.addVertex("aai-node-type", "tenant"); EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, v1, v2); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getContains())); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getDeleteOtherV())); - assertEquals(true, MultiplicityRule.ONE2MANY.equals(rule.getMultiplicityRule())); - assertEquals(true, "IN".equalsIgnoreCase(rule.getServiceInfrastructure())); - assertEquals(true, "OUT".equalsIgnoreCase(rule.getPreventDelete())); + assertEquals(true, "IN".equalsIgnoreCase(rule.getContains())); + assertEquals(true, "NONE".equalsIgnoreCase(rule.getDeleteOtherV())); + assertEquals(true, MultiplicityRule.MANY2ONE.equals(rule.getMultiplicityRule())); + assertEquals(true, "OUT".equalsIgnoreCase(rule.getServiceInfrastructure())); + assertEquals(true, "IN".equalsIgnoreCase(rule.getPreventDelete())); } @Test @@ -168,7 +171,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(); GraphTraversalSource g = graph.traversal(); rules.addTreeEdge(g, v1, v2); - assertEquals(true, g.V(v1).out("has").has("aai-node-type", "tenant").hasNext()); + assertEquals(true, g.V(v1).in("org.onap.relationships.inventory.BelongsTo").has("aai-node-type", "tenant").hasNext()); Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "cloud-region"); assertEquals(null, rules.addTreeEdgeIfPossible(g, v3, v2)); @@ -182,7 +185,7 @@ public class EdgeRulesTest extends AAISetup { EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); GraphTraversalSource g = graph.traversal(); rules.addEdge(g, v1, v2); - assertEquals(true, g.V(v2).out("hasFlavor").has("aai-node-type", "flavor").hasNext()); + assertEquals(true, g.V(v2).out("org.onap.relationships.inventory.Uses").has("aai-node-type", "flavor").hasNext()); Vertex v3 = graph.addVertex(T.id, "2", "aai-node-type", "flavor"); assertEquals(null, rules.addEdgeIfPossible(g, v3, v2)); @@ -191,7 +194,7 @@ public class EdgeRulesTest extends AAISetup { @Test public void multiplicityViolationTest() throws AAIException { thrown.expect(EdgeMultiplicityException.class); - thrown.expectMessage("multiplicity rule violated: only one edge can exist with label: uses between vf-module and volume-group"); + thrown.expectMessage("multiplicity rule violated: only one edge can exist with label: org.onap.relationships.inventory.Uses between vf-module and volume-group"); Graph graph = TinkerGraph.open(); Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "vf-module"); @@ -225,7 +228,7 @@ public class EdgeRulesTest extends AAISetup { public void getAllRulesTest() { EdgeRules rules = EdgeRules.getInstance("/dbedgerules/DbEdgeRules_test.json"); Multimap allRules = rules.getAllRules(); - assertEquals(14, allRules.size()); + assertEquals(16, allRules.size()); assertEquals(true, allRules.containsKey("foo|bar")); assertEquals(true, allRules.containsKey("foo|bar")); assertEquals(true, allRules.containsKey("quux|foo")); @@ -263,6 +266,15 @@ public class EdgeRulesTest extends AAISetup { // so if any required properties are missing, the verification builds // will catch it and incorrect rules can't get merged in. for (Version v : Version.values()) { + // NOt adding descriptions prior to v12 + switch (v.toString()) { + case "v7": + case "v8": + case "v9": + case "v10": + case "v11": + continue; + } EdgeRules rules = EdgeRules.getInstance(v); rules.getAllRules(); } @@ -277,23 +289,23 @@ public class EdgeRulesTest extends AAISetup { @Test public void verifyOutDirectionUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); - EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "generic-vnf", "l3-network", "usesL3Network"); + EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "generic-vnf", "l3-network", "org.onap.relationships.inventory.Uses"); assertEquals("out direction", rule.getDirection(), Direction.OUT); } @Test - public void verifyOutDirectionLinterfaceToLinterfaceUsingLabel() throws AAIException, NoEdgeRuleFoundException { + public void verifyInDirectionLinterfaceToLinterfaceUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); EdgeRule rule = rules.getEdgeRule(EdgeType.TREE, "l-interface", "l-interface"); - assertEquals("out direction", rule.getDirection(), Direction.OUT); + assertEquals("in direction", rule.getDirection(), Direction.IN); } @Test public void verifyOutFlippedDirectionUsingLabel() throws AAIException, NoEdgeRuleFoundException { EdgeRules rules = EdgeRules.getInstance(); - EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "l3-network", "generic-vnf", "usesL3Network"); + EdgeRule rule = rules.getEdgeRule(EdgeType.COUSIN, "l3-network", "generic-vnf", "org.onap.relationships.inventory.Uses"); assertEquals("in direction", rule.getDirection(), Direction.IN); } @@ -348,4 +360,28 @@ public class EdgeRulesTest extends AAISetup { Map edgeRules = rules.getEdgeRulesWithLabels(EdgeType.COUSIN, "generic-vnf", "vnfc", labels); } + @Test + public void addEdgeVerifyAAIUUIDCousinTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "flavor"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "vserver"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + Edge e = rules.addEdge(g, v1, v2); + assertTrue(e.property(AAIProperties.AAI_UUID).isPresent()); + //assertTrue(e.property(AAIProperties.AAI_UUID).value().toString().matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")); + } + + @Test + public void addEdgeVerifyAAIUUIDTreeTest() throws AAIException { + Graph graph = TinkerGraph.open(); + Vertex v1 = graph.addVertex(T.id, "1", "aai-node-type", "tenant"); + Vertex v2 = graph.addVertex(T.id, "10", "aai-node-type", "vserver"); + EdgeRules rules = EdgeRules.getInstance(Version.getLatest()); + GraphTraversalSource g = graph.traversal(); + Edge e = rules.addTreeEdge(g, v1, v2); + assertTrue(e.property(AAIProperties.AAI_UUID).isPresent()); + //assertTrue(e.property(AAIProperties.AAI_UUID).value().toString().matches("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")); + } + } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java index 4b4a0e64..55002a6f 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/engines/query/GraphTraversalQueryEngineTest.java @@ -19,7 +19,6 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - package org.onap.aai.serialization.engines.query; import static org.junit.Assert.*; @@ -31,6 +30,8 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; import org.apache.tinkerpop.gremlin.structure.Direction; @@ -51,7 +52,7 @@ import org.onap.aai.introspection.Version; import org.onap.aai.serialization.db.EdgeRules; public class GraphTraversalQueryEngineTest extends AAISetup { - + @Test public void testFindParents() throws AAIException { //setup @@ -236,13 +237,13 @@ public class GraphTraversalQueryEngineTest extends AAISetup { GraphTraversalQueryEngine engine = new GraphTraversalQueryEngine(g); //test - List outRes = engine.findRelatedVertices(gv, Direction.OUT, "hasLInterface", "l-interface"); + List outRes = engine.findRelatedVertices(gv, Direction.IN, "org.onap.relationships.inventory.BelongsTo", "l-interface"); assertTrue(outRes.containsAll(outExpected) && outExpected.containsAll(outRes)); - - List inRes = engine.findRelatedVertices(log, Direction.IN, "usesLogicalLink", "l-interface"); + + List inRes = engine.findRelatedVertices(log, Direction.IN, "tosca.relationships.network.LinksTo", "l-interface"); assertTrue(inRes.containsAll(inExpected) && inExpected.containsAll(inRes)); - List bothRes = engine.findRelatedVertices(lint, Direction.BOTH, "usesLogicalLink", "logical-link"); + List bothRes = engine.findRelatedVertices(lint, Direction.BOTH, "tosca.relationships.network.LinksTo", "logical-link"); assertTrue(bothRes.containsAll(bothExpected) && bothExpected.containsAll(bothRes)); } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java new file mode 100644 index 00000000..a60eaf90 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ConsoleTest.java @@ -0,0 +1,83 @@ +/** + * ============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.serialization.queryformats; + +import static org.junit.Assert.*; +import org.junit.Test; +import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexException; + +import com.google.gson.JsonObject; + +public class ConsoleTest { + + + Console fM1 = new Console(); + + String param = "abcd"; + + JsonObject resultVal; + + @Test + public void classConsoleInstantiateCheck() { + + try { + Console fm1 = new Console(); + assertNotNull("Created class Object is null", fm1); + } + catch(Exception e) { + fail(); + } + } + + //Below method is expecting to throw an exception + + @Test(expected=NullPointerException.class) + public void formatObjectParamNullCheck() throws AAIFormatVertexException { + + param=null; + Console fm3 = new Console(); + resultVal = fm3.formatObject(param); + } + + @Test + public void formatObjectResultCheck() { + + try { + Console fm2 = new Console(); + + resultVal = fm2.formatObject(param); + assertNotNull("The result is null", resultVal); + + //System.out.println(resultVal); + + JsonObject jsonObj = new JsonObject(); + jsonObj.addProperty("result", "abcd"); + + assertEquals(jsonObj, resultVal); + + } + catch (Exception e) { + fail(); + } + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java new file mode 100644 index 00000000..8f418a43 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/GraphSONTest.java @@ -0,0 +1,80 @@ +/** + * ============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.serialization.queryformats; + +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.*; +import static org.junit.Assert.assertEquals; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +public class GraphSONTest { + + private Graph graph; + private Vertex v1; + + //private JsonObject jsonObj = new JsonParser().parse("{\"id\":0,\"label\":\"vertex\",\"properties\":{\"name\":[{\"id\":1,\"value\":\"Sam\"}]}}").getAsJsonObject(); + private JsonObject jsonObj = new JsonObject() ; + private JsonObject properties = new JsonObject(); + private JsonArray name = new JsonArray() ; + private JsonObject idVal = new JsonObject() ; + + @Before + public void setUp() { + + jsonObj.addProperty("id", 0); + jsonObj.addProperty("label", "vertex"); + + idVal.addProperty("id", 1); + idVal.addProperty("value", "Sam"); + + name.add(idVal); + properties.add("name",name); + jsonObj.add("properties", properties); + + graph = TinkerGraph.open(); + v1 = graph.addVertex("name", "Sam"); + + } + + @Test + public void classGraphSONTestWithVertex(){ + + GraphSON graphSonObj1 = new GraphSON(); + JsonObject obj = graphSonObj1.formatObject(v1); + + assertEquals(jsonObj, obj); + } + + @Test + public void parallelThresholdCehck(){ + + GraphSON graphSonObj2 = new GraphSON(); + assertEquals(50, graphSonObj2.parallelThreshold()); + + } + + +} diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java index a33349fd..ae76467c 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java @@ -92,7 +92,7 @@ public class RawFormatTest extends AAISetup { @Test public void verifyPserverRelatedToHasEdgeLabel () throws AAIFormatVertexException, AAIException, AAIFormatQueryResultFormatNotSupported { - assertTrue(rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("locatedIn")); + assertTrue(rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("org.onap.relationships.inventory.LocatedIn")); } @Test @@ -102,7 +102,7 @@ public class RawFormatTest extends AAISetup { @Test public void verifyComplexRelatedToHasEdgeLabel () throws AAIFormatVertexException, AAIException, AAIFormatQueryResultFormatNotSupported { - assertTrue(rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("locatedIn")); + assertTrue(rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("relationship-label").getAsString().equals("org.onap.relationships.inventory.LocatedIn")); } @Test diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java index ec89aa30..fd3a8893 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java @@ -19,7 +19,6 @@ * * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - package org.onap.aai.serialization.queryformats; import com.google.gson.JsonObject; diff --git a/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java b/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java new file mode 100644 index 00000000..b149e95f --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAICSVWriterTest.java @@ -0,0 +1,77 @@ +/** + * ============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.util; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import org.junit.Assert; +import org.junit.Test; + +public class AAICSVWriterTest { + + private final String TEMP_DIR=System.getProperty("java.io.tmpdir")+"/test.csv"; + + @Test + public void writeFile() throws IOException + { + + + FileWriter fileWriter = new FileWriter(TEMP_DIR); + AAICSVWriter aaicsvWriter = new AAICSVWriter(fileWriter, ",", '\'', null); + aaicsvWriter.writeColumn(new String[]{"id", "name", null}); + aaicsvWriter.writeColumn(null); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}, true); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}); + aaicsvWriter.writeNext(new String[]{"1", null}); + aaicsvWriter.writeNext(null); + aaicsvWriter.close(); + File file = new File(TEMP_DIR); + Assert.assertTrue("File shoud be exists", file.exists()); + } + + @Test + public void writeFile1() throws IOException + { + FileWriter fileWriter = new FileWriter(TEMP_DIR); + AAICSVWriter aaicsvWriter = new AAICSVWriter(fileWriter, ",", '\u0000', null); + aaicsvWriter.writeNext(new String[]{"1", "Test1"}, true); + aaicsvWriter.writeNext(new String[]{"1", "Tes\"t@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\t@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Test,@"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\n"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\r"}, false); + aaicsvWriter.writeNext(new String[]{"1", "Tes\u0000"}, false); + aaicsvWriter.close(); + File file = new File(TEMP_DIR); + Assert.assertTrue("File shoud be exists", file.exists()); + + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java b/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java new file mode 100644 index 00000000..fcce479a --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAIConfigCommandLinePropGetterTest.java @@ -0,0 +1,105 @@ +/** + * ============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.util; + +import static org.junit.Assert.assertEquals; + +import java.security.Permission; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.AAISetup; + +public class AAIConfigCommandLinePropGetterTest extends AAISetup { + + private SecurityManager m; + private TestSecurityManager sm; + + @Before + public void setUp() + { + m = System.getSecurityManager(); + sm = new TestSecurityManager(); + System.setSecurityManager(sm); + } + + @After + public void tearDown() + { + System.setSecurityManager(m); + } + + @Test + public void testMainNoArgs() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainReadProp() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"aai.primary.filetransfer.serverlist"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainOneArg() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"one"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } + + @Test + public void testMainMoreThanOneArg() { + try { + AAIConfigCommandLinePropGetter.main(new String[] {"one", "two"}); + } catch (SecurityException se) { + // assert main method ends with System.exit(0) + assertEquals("0", se.getMessage()); + } + } +} + +class TestSecurityManager extends SecurityManager { + @Override + public void checkPermission(Permission permission) { + if ("exitVM".equals(permission.getName())) + { + throw new SecurityException("System.exit attempted and blocked."); + } + } + @Override + public void checkExit(int status) { + throw new SecurityException(Integer.toString(status)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java b/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java new file mode 100644 index 00000000..f5daf3b0 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/AAIRSyncUtilityTest.java @@ -0,0 +1,55 @@ +/** + * ============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.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.AAISetup; + +public class AAIRSyncUtilityTest extends AAISetup { + + private static AAIRSyncUtility syncUtility; + + @BeforeClass + public static void setUp() throws Exception { + syncUtility = new AAIRSyncUtility(); + } + + @Test(expected = NullPointerException.class) + public void testDoCommandNullCommands() throws Exception { + syncUtility.doCommand(null); + } + + @Test(expected = Exception.class) + public void testDoCommandEmptyCommands() throws Exception { + List commands = new ArrayList(); + syncUtility.doCommand(commands); + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java new file mode 100644 index 00000000..bb754c0e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java @@ -0,0 +1,78 @@ +/** + * ============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.util; + +import static org.junit.Assert.*; + +import java.io.File; + +import org.junit.Test; +import org.mockito.Mockito; + +public class FileWatcherTest { + + class FileWatcherExtension extends FileWatcher { + + public FileWatcherExtension(File file) { + super(file); + } + + @Override + protected void onChange(File file) { + System.out.println("do nothing"); + } + } + + @Test + public void testFileWatcher() { + File file = new File("helloworld"); + file.setLastModified(new Long(123)); + FileWatcher fileWatcher = new FileWatcherExtension(file); + assertNotNull(fileWatcher); + file.deleteOnExit(); + } + + @Test(expected=NullPointerException.class) + public void testFileWatcher_nullConstructor() { + FileWatcher fileWatcher = new FileWatcherExtension(null); + assertNull(fileWatcher); + } + + @Test + public void testRun() { + // verify that code is reachable outside of conditional check in run() + File file = new File("helloworld"); + file.setLastModified(new Long(100)); + FileWatcher fileWatcher = new FileWatcherExtension(file); + fileWatcher.run(); + file.deleteOnExit(); + } + + @Test + public void testOnChange() throws Exception { + FileWatcher fileWatcher = Mockito.mock(FileWatcher.class, Mockito.CALLS_REAL_METHODS); + + fileWatcher.onChange(Mockito.any(File.class)); + + Mockito.verify(fileWatcher).onChange(Mockito.any(File.class)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java b/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java index 9a36680b..9e1e33a5 100644 --- a/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java +++ b/aai-core/src/test/java/org/onap/aai/util/GenerateXsdTest.java @@ -21,35 +21,271 @@ */ package org.onap.aai.util; -import org.junit.Test; -import org.onap.aai.introspection.Version; +import static org.junit.Assert.*; -public class GenerateXsdTest { +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; - @Test - public void testGenerationOfXsdAndYaml() throws Exception { +import org.hamcrest.CoreMatchers; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; - GenerateXsd generateXsd = new GenerateXsd(); - System.setProperty("gen_version", Version.getLatest().toString()); - System.setProperty("gen_type", "XSD"); - System.setProperty("yamlresponses_url", ""); - System.setProperty("yamlresponses_label", ""); +import org.onap.aai.introspection.Version; - generateXsd.main(new String[]{}); - System.setProperty("gen_version", Version.getLatest().toString()); - System.setProperty("gen_type", "YAML"); +public class GenerateXsdTest { + private static final int maxSizeForXml = 20000; + private String testXML; + + @Before + public void setUp() throws Exception { + //PowerMockito.mockStatic(GenerateXsd.class); + StringBuilder sb = new StringBuilder(maxSizeForXml); + addNamespace(sb); + addRelationshipList(sb); + addRelationship(sb); + addRelatedToProperty(sb); + addRelationshipData(sb); + addBusiness(sb); + addCustomers(sb); + addCustomer(sb); + addServiceSubscriptions(sb); + addServiceSubscription(sb); + addEndOfXML(sb); + testXML = sb.toString(); + } + + private void addNamespace(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationshipList(StringBuilder sb ) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("/n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationship(StringBuilder sb ) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append(""); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelatedToProperty(StringBuilder sb) { + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addRelationshipData(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addBusiness(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addCustomers(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addCustomer(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addServiceSubscriptions(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + private void addServiceSubscription(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + sb.append("\n"); + } + + private void addEndOfXML(StringBuilder sb){ + sb.append("\n"); + sb.append("\n"); + } + + + @Test + public void test_processOxmFile() { + - String wikiLink = System.getProperty("aai.wiki.link"); + GenerateXsd generateXsd = new GenerateXsd(); + + //GenerateXsd generateXsdSpy = PowerMockito.spy(generateXsd); - if(wikiLink == null){ - wikiLink = "https://wiki.onap.org/"; - } + //generateXsdSpy.processOxmFile(null, Version.getLatest(), testXML); - System.setProperty("yamlresponses_url", wikiLink); - System.setProperty("yamlresponses_label", "Response codes found in [response codes]"); + String xsdResult = generateXsd.processOxmFile(null, Version.getLatest(), testXML); + + String relationshipListExpected = " \n \n \n \n \n \n "; + String relatedToPropertyExpected = " \n \n \n \n \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Key part of a key/value pair\")\r\n \r\n \r\n \n" + + " \n \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Value part of a key/value pair\")\r\n \r\n \r\n \n \n \n "; + assertNotNull(xsdResult); + } + @Test + public void test_generateSwaggerFromOxmFile( ) { + - generateXsd.main(new String[]{}); - } + GenerateXsd generateXsd = new GenerateXsd(); + String customerOperation = " /business/customers/customer/{global-customer-id}:\n get:\n tags:\n - Business\n summary: returns customer"; + String relationshipListDefinition = " relationship-list:\n properties:\n relationship:\n type: array\n items: \n $ref: \"#/definitions/relationship\""; + String swaggerResult = generateXsd.generateSwaggerFromOxmFile(null, testXML); + assertNotNull(swaggerResult); + } } diff --git a/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java b/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java new file mode 100644 index 00000000..918f8974 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/HbaseSaltPrefixerTest.java @@ -0,0 +1,72 @@ +/** + * ============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.util; + +import static org.junit.Assert.*; + + +import org.junit.Test; + + +public class HbaseSaltPrefixerTest { + + HbaseSaltPrefixer obj = HbaseSaltPrefixer.getInstance(); + + //Sample key value used for testing + String key = "foo1234"; + + String result = obj.prependSalt(key); + + @Test + public void classInstantiateCheck() { + try { + assertNotNull("Created class Object is not null", obj); + } + catch(Exception e) { + fail(); + } + } + + @Test + public void prependSaltResult_NullCheck () { + try { + assertNotNull("result is not null", result); + } + catch(NullPointerException e) { + fail(); + } + } + + @Test + public void prependSaltResult_PrefixSuccessChecks () { + try { + // Ensure that '-' has been prepended + assertFalse(result.startsWith("-")); + // Ensure that *something* has been prepended + assertFalse(result.equalsIgnoreCase(key)); + } + catch (Exception e) { + fail(); + } + } + +} diff --git a/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java b/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.java new file mode 100644 index 00000000..c05ffefc --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/KeyValueListTest.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.util; + +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +public class KeyValueListTest { + KeyValueList kv; + KeyValueList kv1; + + @Before + public void setup() { + String key = "key"; + String value = "value"; + kv = new KeyValueList(); + kv.setKey(key); + kv.setValue(value); + kv.setAdditionalProperty("name1", "val1"); + kv1 = new KeyValueList(); + kv1.setKey("key1"); + kv1.setValue("value1"); + } + + @Test + public void getSetTest() { + assertEquals("key", kv.getKey()); + assertEquals("value", kv.getValue()); + } + + @Test + public void additionalPropertyTest() { + assertEquals("Additional properties added", "val1", kv.getAdditionalProperties().get("name1")); + } + + @Test + public void hashCodeTest() { + assertEquals("Hashing function returns the same code", kv.hashCode(), kv.hashCode()); + assertNotEquals("Hashing function returns different code for different objects", kv.hashCode(), kv1.hashCode()); + } + + @Test + public void equalsTest() { + KeyValueList kv2 = new KeyValueList(); + kv2.setKey("key"); + kv2.setValue("value"); + kv2.setAdditionalProperty("name1", "val1"); + assertTrue("Equal KeyValueList objects", kv.equals(kv2)); + assertFalse("Non-equal KeyValueList objects", kv.equals(kv1)); + } + + @Test + public void toStringTest() { + assertNotEquals("Different objects should return different strings", kv.toString(), kv1.toString()); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java b/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java new file mode 100644 index 00000000..dae2c22d --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/MapperUtilTest.java @@ -0,0 +1,72 @@ +/** + * ============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.util; + +import org.json.JSONObject; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class MapperUtilTest { + + public class SampleClass { + private String color; + private String shape; + + public SampleClass(String c, String s){ + color = c; + shape = s; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getShape() { + return shape; + } + + public void setShape(String shape) { + this.shape = shape; + } + } + + private JSONObject expectedJson; + + @Before + public void setup(){ + expectedJson = new JSONObject(); + } + + @Test + public void writeAsJSONStringTest() throws Exception { + expectedJson.put("color", "black"); + expectedJson.put("shape", "box"); + SampleClass sample = new SampleClass("black", "box"); + assertEquals(expectedJson.toString(), MapperUtil.writeAsJSONString(sample)); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java b/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.java new file mode 100644 index 00000000..7121a82b --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/PojoUtilsTest.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.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; +import java.time.Month; + +import org.junit.Test; +import org.mockito.Mockito; + +public class PojoUtilsTest { + + @Test + public void testGetJsonFromObject_Clazz_MockTest() throws Exception { + + String obj = "helloWorld"; + PojoUtils pojoUtils = Mockito.mock(PojoUtils.class); + Mockito.doCallRealMethod().when(pojoUtils).getJsonFromObject(Mockito.anyString()); + + pojoUtils.getJsonFromObject(obj); + + Mockito.verify(pojoUtils, Mockito.times(1)).getJsonFromObject(Mockito.anyString(), Mockito.eq(false), Mockito.eq(true)); + } + + @Test + public void testGetJsonFromObject_Clazz() throws Exception { + + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + LocalDateTime date = LocalDateTime.of(2017, Month.SEPTEMBER, 18, 10, 55, 0, 300); + + String res = pojoUtils.getJsonFromObject(date); + + assertNotNull(res); + assertTrue(res.contains("\"dayOfMonth\" : 18")); + assertTrue(res.contains("\"dayOfWeek\" : \"MONDAY\"")); + assertTrue(res.contains("\"dayOfYear\" : 261")); + assertTrue(res.contains("\"hour\" : 10")); + assertTrue(res.contains("\"minute\" : 55")); + assertTrue(res.contains("\"month\" : \"SEPTEMBER\"")); + assertTrue(res.contains("\"monthValue\" : 9")); + assertTrue(res.contains("\"nano\" : 300")); + assertTrue(res.contains("\"second\" : 0")); + assertTrue(res.contains("\"year\" : 2017")); + } + + @Test + public void testGetJsonFromObject_Clazz_null() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + + String res = pojoUtils.getJsonFromObject(null); + + assertNotNull(res); + assertEquals("null", res); + } + + @Test + public void testGetJsonFromObject_null() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + + String res = pojoUtils.getJsonFromObject(null, false, true); + + assertNotNull(res); + assertEquals("null", res); + } + + @Test + public void testGetJsonFromObject() throws Exception { + PojoUtils pojoUtils = PojoUtilsTest.getInstance(); + LocalDateTime date = LocalDateTime.of(2017, Month.SEPTEMBER, 18, 10, 55, 0, 300); + + String res = pojoUtils.getJsonFromObject(date, false, false); + assertNotNull(res); + + res = pojoUtils.getJsonFromObject(date, true, false); + assertNotNull(res); + + res = pojoUtils.getJsonFromObject(date, true, true); + assertNotNull(res); + } + + static PojoUtils getInstance() { + return new PojoUtils(); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java b/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java new file mode 100644 index 00000000..e296b5e1 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/RestURLEncoderTest.java @@ -0,0 +1,63 @@ +/** + * ============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.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +import org.junit.Test; + +public class RestURLEncoderTest { + + @Test + public void testEncodeURL() throws Exception { + + String url = "nodeKeyTest&more-string strings"; + String encodedUrl = "nodeKeyTest%26more-string%20strings"; + + String res = RestURLEncoder.encodeURL(url); + assertEquals(encodedUrl, res); + } + + @Test + public void testEncodeURL_plusSign() throws Exception { + + String url = "nodeKeyTest+more+string"; + String encodedUrl = "nodeKeyTest%2Bmore%2Bstring"; + + String res = RestURLEncoder.encodeURL(url); + assertEquals(encodedUrl, res); + } + + @Test + public void testEncodeURL_noException() throws Exception { + // no exception expected, none thrown: passes. + try { + String encodeResult = RestURLEncoder.encodeURL(""); + + assertNotNull("Result is not null", encodeResult); + } catch (Exception e) { + fail(); + } + } +} diff --git a/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java b/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java new file mode 100644 index 00000000..5c87b29e --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/util/StoreNotificationEventTest.java @@ -0,0 +1,235 @@ +/** + * ============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.util; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Map; + +import javax.json.Json; +import javax.json.JsonObject; + +import org.eclipse.persistence.dynamic.DynamicEntity; +import org.eclipse.persistence.dynamic.DynamicType; +import org.eclipse.persistence.jaxb.JAXBContextProperties; +import org.eclipse.persistence.jaxb.JAXBMarshaller; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.AAISetup; +import org.onap.aai.dmaap.AAIDmaapEventJMSProducer; +import org.onap.aai.domain.notificationEvent.NotificationEvent.EventHeader; +import org.onap.aai.exceptions.AAIException; +import org.onap.aai.introspection.Introspector; +import org.onap.aai.introspection.Loader; +import org.onap.aai.introspection.LoaderFactory; +import org.onap.aai.introspection.ModelType; +import org.onap.aai.introspection.Version; + +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; + +public class StoreNotificationEventTest extends AAISetup { + + private static AAIDmaapEventJMSProducer producer; + private static StoreNotificationEvent sne; + + @BeforeClass + public static void setUp() throws Exception { + producer = Mockito.mock(AAIDmaapEventJMSProducer.class); + sne = new StoreNotificationEvent(producer, "transiationId", "sourceOfTruth"); + } + + @Test(expected = AAIException.class) + public void testStoreEventNullObj() throws AAIException { + sne.storeEvent(new EventHeader(), null); + } + + @Test(expected = AAIException.class) + public void testStoreEventInvalidObjForPojoUtils() throws AAIException { + sne.storeEvent(new EventHeader(), new Object()); + } + + @Test + public void testStoreEventEmptyEventHeader() throws AAIException, JsonGenerationException, JsonMappingException, IOException { + JsonObject object = Json.createObjectBuilder().add("hello", "world").build(); + String res = sne.storeEvent(new EventHeader(), object); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\"")); + assertTrue(res.contains("\"timestamp\"")); + assertTrue(res.contains("\"source-name\" : \"" + AAIConfig.get("aai.notificationEvent.default.sourceName") + "\"")); + assertTrue(res.contains("\"domain\" : \"" + AAIConfig.get("aai.notificationEvent.default.domain") + "\"")); + assertTrue(res.contains("\"sequence-number\" : \"" + AAIConfig.get("aai.notificationEvent.default.sequenceNumber") + "\"")); + assertTrue(res.contains("\"severity\" : \"" + AAIConfig.get("aai.notificationEvent.default.severity") + "\"")); + assertTrue(res.contains("\"event-type\" : \"" + AAIConfig.get("aai.notificationEvent.default.eventType") + "\"")); + assertTrue(res.contains("\"version\" : \"" + AAIConfig.get("aai.notificationEvent.default.version") + "\"")); + assertTrue(res.contains("\"action\" : \"UNK\"")); + assertTrue(res.contains("\"entity-link\" : \"UNK\"")); + assertTrue(res.contains("\"entity\"")); + assertTrue(res.contains("\"hello\"")); + assertTrue(res.contains("\"chars\" : \"world\"")); + assertTrue(res.contains("\"string\" : \"world\"")); + assertTrue(res.contains("\"valueType\" : \"STRING\"")); + } + + @Test + public void testStoreEvent() throws AAIException, JsonGenerationException, JsonMappingException, IOException { + JsonObject object = Json.createObjectBuilder().add("hello", "world").build(); + EventHeader eh = new EventHeader(); + eh.setId("123"); + eh.setTimestamp("current-time"); + eh.setEntityLink("entity-link"); + eh.setAction("action!"); + eh.setEventType("surprise"); + eh.setDomain("PROD"); + eh.setSourceName("source"); + eh.setSequenceNumber("23"); + eh.setSeverity("ALERT"); + eh.setVersion("v11"); + + String res = sne.storeEvent(eh, object); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\" : \"123\"")); + assertTrue(res.contains("\"timestamp\" : \"current-time\"")); + assertTrue(res.contains("\"source-name\" : \"source\"")); + assertTrue(res.contains("\"domain\" : \"PROD\"")); + assertTrue(res.contains("\"sequence-number\" : \"23\"")); + assertTrue(res.contains("\"severity\" : \"ALERT\"")); + assertTrue(res.contains("\"event-type\" : \"surprise\"")); + assertTrue(res.contains("\"version\" : \"v11\"")); + assertTrue(res.contains("\"action\" : \"action!\"")); + assertTrue(res.contains("\"entity-link\" : \"entity-link\"")); + assertTrue(res.contains("\"entity\"")); + assertTrue(res.contains("\"hello\"")); + assertTrue(res.contains("\"chars\" : \"world\"")); + assertTrue(res.contains("\"string\" : \"world\"")); + assertTrue(res.contains("\"valueType\" : \"STRING\"")); + } + + @Test(expected=AAIException.class) + public void testStoreDynamicEventNullObj() throws AAIException { + DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class); + DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class); + sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, null); + } + + @Test(expected = AAIException.class) + public void testStoreDynamicEventAAIException() throws Exception { + DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class); + DynamicEntity obj = Mockito.mock(DynamicEntity.class); + DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class); + ClassLoader cl = getClass().getClassLoader(); + InputStream is = cl.getResourceAsStream("bundleconfig-local/etc/oxm/aai_oxm_v11.xml"); + Map properties = new HashMap(); + properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, is); + DynamicJAXBContext notificationJaxbContextReal = DynamicJAXBContextFactory.createContextFromOXM(cl, properties); + DynamicType dtReal = notificationJaxbContextReal.getDynamicType("inventory.aai.onap.org.v11.NotificationEvent"); + DynamicType dt = Mockito.mock(DynamicType.class); + DynamicEntity notificationEventReal = dtReal.newDynamicEntity(); + JAXBMarshaller marshaller = Mockito.mock(JAXBMarshaller.class); + + Mockito.when(notificationJaxbContext.getDynamicType(Mockito.anyString())).thenReturn(dt); + Mockito.when(dt.newDynamicEntity()).thenReturn(notificationEventReal); + Mockito.when(notificationJaxbContext.createMarshaller()).thenReturn(marshaller); + Mockito.doNothing().when(marshaller).marshal(Mockito.any(DynamicJAXBContext.class), Mockito.any(StringWriter.class)); + + sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, obj); + } + + @Test(expected = AAIException.class) + public void testStoreEventIntrospectorNullObj() throws Exception { + Loader loader = Mockito.mock(Loader.class); + sne.storeEvent(loader, null, null); + } + + @Test + public void testStoreEventIntrospector() throws Exception { + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); + Introspector eventHeader = loader.introspectorFromName("notification-event-header"); + eventHeader.setValue("id", "123"); + eventHeader.setValue("timestamp", "current-time"); + eventHeader.setValue("entity-link", "entity-link"); + eventHeader.setValue("action", "action!"); + eventHeader.setValue("event-type", "surprise"); + eventHeader.setValue("domain", "PROD"); + eventHeader.setValue("source-name", "source"); + eventHeader.setValue("sequence-number", "23"); + eventHeader.setValue("severity", "ALERT"); + eventHeader.setValue("version", "v11"); + + Introspector obj = loader.introspectorFromName("notification-event"); + + String res = sne.storeEvent(loader, eventHeader, obj); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\":\"123\"")); + assertTrue(res.contains("\"timestamp\":\"current-time\"")); + assertTrue(res.contains("\"source-name\":\"source\"")); + assertTrue(res.contains("\"domain\":\"PROD\"")); + assertTrue(res.contains("\"sequence-number\":\"23\"")); + assertTrue(res.contains("\"severity\":\"ALERT\"")); + assertTrue(res.contains("\"event-type\":\"surprise\"")); + assertTrue(res.contains("\"version\":\"v11\"")); + assertTrue(res.contains("\"action\":\"action!\"")); + assertTrue(res.contains("\"entity-link\":\"entity-link\"")); + assertTrue(res.contains("\"notification-event\"")); + } + + @Test + public void testStoreEventIntrospectorEmptyEventHeader() throws Exception { + Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11); + Introspector eventHeader = loader.introspectorFromName("notification-event-header"); + Introspector obj = loader.introspectorFromName("notification-event"); + + String res = sne.storeEvent(loader, eventHeader, obj); + + assertNotNull(res); + assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\"")); + assertTrue(res.contains("\"event-header\"")); + assertTrue(res.contains("\"id\"")); + assertTrue(res.contains("\"timestamp\"")); + assertTrue(res.contains("\"source-name\":\"" + AAIConfig.get("aai.notificationEvent.default.sourceName") + "\"")); + assertTrue(res.contains("\"domain\":\"" + AAIConfig.get("aai.notificationEvent.default.domain") + "\"")); + assertTrue(res.contains("\"sequence-number\":\"" + AAIConfig.get("aai.notificationEvent.default.sequenceNumber") + "\"")); + assertTrue(res.contains("\"severity\":\"" + AAIConfig.get("aai.notificationEvent.default.severity") + "\"")); + assertTrue(res.contains("\"event-type\":\"" + AAIConfig.get("aai.notificationEvent.default.eventType") + "\"")); + assertTrue(res.contains("\"version\":\"" + AAIConfig.get("aai.notificationEvent.default.version") + "\"")); + assertTrue(res.contains("\"action\":\"UNK\"")); + assertTrue(res.contains("\"entity-link\":\"UNK\"")); + assertTrue(res.contains("\"notification-event\"")); + } +} diff --git a/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java b/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java new file mode 100644 index 00000000..ebcaf750 --- /dev/null +++ b/aai-core/src/test/java/org/onap/aai/workarounds/LegacyURITransformerTest.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright (C) 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========================================================= + */ + +package org.onap.aai.workarounds; + +import org.junit.Test; +import org.onap.aai.AAISetup; +import org.onap.aai.introspection.Version; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; + +import static org.junit.Assert.assertEquals; + + +public class LegacyURITransformerTest extends AAISetup { + + private LegacyURITransformer uriTransformer = LegacyURITransformer.getInstance(); + private String fromSuccess = "http://myhostname.com:8443/aai/{version}/cloud-infrastructure/tenants/tenant/key1/vservers/vserver/key2"; + private String toSuccess = "http://myhostname.com:8443/aai/servers/{version}/key1/vservers/key2"; + + + /** + * V 5. + * @throws URISyntaxException + * + * @throws MalformedURLException the malformed URL exception + */ + @Test + public void v5() throws URISyntaxException { + testSpec(Version.v8, fromSuccess, fromSuccess); + } + + + /** + * Test spec. + * + * @param version the version + * @param toExpected the to expected + * @param fromExpected the from expected + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public void testSpec(Version version, String toExpected, String fromExpected) throws URISyntaxException { + + URI toExpectedUri = new URI(toExpected.replace("{version}",version.toString())); + URI fromExpectedUri = new URI(fromExpected.replace("{version}",version.toString())); + + URI result = toLegacyURISpec(version, fromExpectedUri); + + assertEquals("to", toExpectedUri, result); + + result = fromLegacyURISpec(version, toExpectedUri); + + assertEquals("from", fromExpectedUri, result); + } + + + /** + * To legacy URL spec. + * + * @param version the version + * @param url the url + * @return the url + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public URI toLegacyURISpec(Version version, URI uri) throws URISyntaxException { + return uri; + } + + /** + * From legacy URL spec. + * + * @param version the version + * @param url the url + * @return the url + * @throws URISyntaxException + * @throws MalformedURLException the malformed URL exception + */ + public URI fromLegacyURISpec(Version version, URI uri) throws URISyntaxException { + return uri; + } + + +} diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties index c91976f3..d484a415 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -20,10 +20,74 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. # -aai.server.url.base=https://baseurl:8443/aai/ +#################################################################### +# REMEMBER TO THINK ABOUT ENVIRONMENTAL DIFFERENCES AND CHANGE THE +# TEMPLATE AND *ALL* DATAFILES +#################################################################### + +aai.config.checktime=1000 + +# this could come from siteconfig.pl? +aai.config.nodename=AutomaticallyOverwritten + +aai.logging.hbase.interceptor=true +aai.logging.hbase.enabled=true +aai.logging.hbase.logrequest=true +aai.logging.hbase.logresponse=true + +aai.logging.trace.enabled=true +aai.logging.trace.logrequest=false +aai.logging.trace.logresponse=false + +aai.transaction.logging=true +aai.transaction.logging.get=true +aai.transaction.logging.post=true + +aai.server.url.base=https://localhost:8443/aai/ +aai.server.url=https://localhost:8443/aai/v12/ +aai.global.callback.url=https://localhost:8443/aai/ + +aai.default.api.version=v12 aai.resourceversion.enableflag=true -aai.logging.maxStackTraceEntries=10 -aai.default.api.version=v9 + +aai.notification.current.version=v12 +aai.notificationEvent.default.status=UNPROCESSED +aai.notificationEvent.default.eventType=AAI-EVENT +aai.notificationEvent.default.domain=devINT1 +aai.notificationEvent.default.sourceName=aai +aai.notificationEvent.default.sequenceNumber=0 +aai.notificationEvent.default.severity=NORMAL +aai.notificationEvent.default.version=v12 + + +# Used by Model-processing code +aai.model.delete.sleep.per.vtx.msec=500 +aai.model.query.resultset.maxcount=50 +aai.model.query.timeout.sec=90 + +# Used by Data Grooming +aai.grooming.default.max.fix=150 +aai.grooming.default.sleep.minutes=7 + +# Used by DupeTool +aai.dupeTool.default.max.fix=25 +aai.dupeTool.default.sleep.minutes=7 + +aai.model.proc.max.levels=50 +aai.edgeTag.proc.max.levels=50 + +# Used by the ForceDelete tool +aai.forceDel.protected.nt.list=cloud-region +aai.forceDel.protected.edge.count=10 +aai.forceDel.protected.descendant.count=10 + +# Used for CTAG-Pool generation +aai.ctagPool.rangeString.vplsPe1=2001-2500 +aai.ctagPool.rangeString.vplsPe2=2501-3000 + +aai.dmaap.workload.enableEventProcessing=true + +aai.realtime.clients=JUNIT aai.server.rebind=g aai.run.migrations=false diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties index 11416ca4..da9f5e5b 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties +++ b/aai-core/src/test/resources/bundleconfig-local/etc/appprops/error.properties @@ -49,18 +49,13 @@ AAI_4008=5:4:ERROR:4008:500:3002:Output parsing error AAI_4009=4:0:ERROR:4009:400:3000:Invalid X-FromAppId in header AAI_4010=4:0:ERROR:4010:400:3000:Invalid X-TransactionId in header AAI_4011=5:4:ERROR:4011:500:3002:Missing data for REST error response -AAI_4012=5:4:ERROR:4012:500:3002:Bad rule data in RestRules -AAI_4013=5:4:ERROR:4013:500:3002:Error connecting to AAI REST API AAI_4014=4:0:ERROR:4014:400:3000:Invalid Accept header AAI_4015=4:0:ERROR:4015:400:3000:You must provide at least one indexed property AAI_4016=4:0:ERROR:4016:400:3000:The depth parameter must be a number or the string "all" AAI_4017=5:2:INFO:4017:400:3000:Could not set property AAI_4018=5:2:ERROR:4018:400:3000:Unable to convert the string to integer -#--- aaidbmap: 5101-5199 -AAI_5101=5:4:FATAL:5101:500:3002:Could not connect to database +#--- aaidbmap: 5102-5199 AAI_5102=5:4:FATAL:5102:500:3002:Graph database is null after open -AAI_5103=5:4:ERROR:5103:500:3002:Unexpected error during commit -AAI_5104=5:4:ERROR:5104:500:3002:Unexpected error during rollback AAI_5105=5:4:ERROR:5105:500:3002:Unexpected error reading/updating database AAI_5106=5:4:WARN:5106:404:3001:Node not found AAI_5107=5:2:WARN:5107:400:3000:Required information missing @@ -148,6 +143,7 @@ AAI_7401=5:4:ERROR:7401:500:3002:Error connecting to AAI REST API AAI_7402=5:4:ERROR:7402:500:3002:Unexpected error AAI_7403=5:4:WARN:7403:400:3001:Request error AAI_7404=5:4:INFO:7404:404:3001:Node not found +AAI_7405=5:4:WARN:7405:200:0:UUID not formatted correctly, generating UUID #--- aaiauth: 9101-9199 AAI_9101=5:0:WARN:9101:403:3300:User is not authorized to perform function diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml index d3c46600..51eaa349 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v10.xml @@ -23,5819 +23,5416 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml index ecbfefb8..90d023ce 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v11.xml @@ -24,7 +24,7 @@ --> - + @@ -33,7 +33,7 @@ - + @@ -229,6 +229,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -258,7 +522,7 @@ - + @@ -296,6 +560,22 @@ + + + + + + + + + + + + + + + + @@ -311,9 +591,12 @@ + + + - + @@ -582,6 +865,11 @@ + + + + + @@ -593,7 +881,7 @@ - + @@ -743,7 +1031,23 @@ - + + + + + + + + + + + + + + + + + @@ -899,7 +1203,7 @@ - + @@ -953,7 +1257,7 @@ - + @@ -968,6 +1272,17 @@ + + + + + + + + + + + @@ -975,8 +1290,7 @@ - - + @@ -1030,7 +1344,7 @@ - + @@ -1275,6 +1589,7 @@ + @@ -1602,6 +1917,16 @@ + + + + + + + + + + @@ -1669,6 +1994,11 @@ + + + + + @@ -1680,7 +2010,13 @@ + + + + + + @@ -1839,7 +2175,7 @@ - + @@ -1898,34 +2234,39 @@ - - + + + + + - + + + + + + - - + + + + + - + - - + + - - - - - - - - - - - + + + + + @@ -1934,24 +2275,12 @@ - - - - - - - - - - - - + + + + + - - - - - @@ -1981,6 +2310,7 @@ + @@ -1988,6 +2318,7 @@ + @@ -2070,6 +2401,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2134,10 +2573,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2145,6 +2621,7 @@ + @@ -2195,11 +2672,6 @@ - - - - - @@ -2226,7 +2698,7 @@ - + @@ -2262,7 +2734,7 @@ - + @@ -2296,8 +2768,8 @@ - - + + @@ -2413,9 +2885,99 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2436,6 +2998,12 @@ + + + + + + @@ -2453,7 +3021,7 @@ - + @@ -2470,6 +3038,7 @@ + @@ -2477,6 +3046,7 @@ + @@ -2612,7 +3182,6 @@ - @@ -2739,11 +3308,6 @@ - - - - - @@ -2754,14 +3318,19 @@ - + - + - + - + + + + + + @@ -2770,7 +3339,6 @@ - @@ -2780,48 +3348,14 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2964,7 +3498,7 @@ - + @@ -3167,14 +3701,14 @@ - + - + - + - + @@ -3209,15 +3743,31 @@ + + + + + + + + + + + + + + + + - + @@ -3309,6 +3859,7 @@ + @@ -3316,6 +3867,7 @@ + @@ -3518,14 +4070,24 @@ - + + + + + + + + + + + - + - + - + @@ -3533,6 +4095,12 @@ + + + + + + @@ -3565,6 +4133,11 @@ + + + + + @@ -3593,9 +4166,10 @@ + - + @@ -3613,6 +4187,22 @@ + + + + + + + + + + + + + + + + @@ -3680,6 +4270,21 @@ + + + + + + + + + + + + + + + @@ -3731,6 +4336,7 @@ + @@ -3738,6 +4344,7 @@ + @@ -3776,6 +4383,7 @@ + @@ -3786,6 +4394,7 @@ + @@ -3797,7 +4406,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -3814,6 +4443,8 @@ + + @@ -3865,6 +4496,7 @@ + @@ -3872,6 +4504,7 @@ + @@ -3995,7 +4628,7 @@ - + @@ -4245,7 +4878,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -4355,7 +5008,7 @@ - + @@ -4385,7 +5038,7 @@ - + @@ -4497,11 +5150,10 @@ - - - - - + + + + @@ -5041,7 +5693,7 @@ - + @@ -5049,7 +5701,7 @@ - + @@ -5107,6 +5759,23 @@ + + + + + + + + + + + + + + + + + @@ -5139,6 +5808,7 @@ + @@ -5211,6 +5881,7 @@ + @@ -5218,6 +5889,7 @@ + @@ -5473,368 +6145,218 @@ - + - + - + - + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + - - + - + - - + - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + - + - + - + - + - - - - + - + - - - - + - + - - - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml index 30fe6b6f..2364cf82 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v12.xml @@ -225,7 +225,7 @@ - + @@ -501,6 +501,7 @@ + @@ -519,7 +520,7 @@ - + @@ -582,7 +583,7 @@ - + @@ -670,7 +671,7 @@ - + @@ -1950,6 +1951,11 @@ + + + + + @@ -2633,22 +2639,22 @@ - + - + - + - + @@ -2871,395 +2877,31 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + @@ -3271,7 +2913,7 @@ - + @@ -3293,26 +2935,36 @@ - + - + - - + + - + + + + + + + + + + + @@ -3320,14 +2972,15 @@ + + - - + + - @@ -3372,7 +3025,7 @@ - + @@ -5064,6 +4717,11 @@ + + + + + @@ -5494,8 +5152,10 @@ - - + + + + @@ -5505,6 +5165,7 @@ + @@ -5562,7 +5223,7 @@ - + @@ -5582,6 +5243,11 @@ + + + + + @@ -6309,22 +5975,22 @@ - + - + - + - + @@ -6711,5 +6377,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml deleted file mode 100644 index eba7c4b9..00000000 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v2.xml +++ /dev/null @@ -1,1729 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml index 7474362f..d666b738 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v8.xml @@ -24,30 +24,332 @@ --> - + - - + + - + + + + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,13 +358,13 @@ - - - - - + + + + + @@ -119,5 +421,4235 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml index bfd67319..ecffb2fc 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml +++ b/aai-core/src/test/resources/bundleconfig-local/etc/oxm/aai_oxm_v9.xml @@ -23,5580 +23,5308 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + - + - + - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + - + - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json index 241cc146..c6407e2c 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/ambiguous-relationship.json @@ -1,10 +1,10 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key1" },{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key2" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json index 0f0378d9..5bafc9ff 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-failv10-successv9.json @@ -1,8 +1,8 @@ { - "related-to": "test-object", - "related-link": "/aai/v10/network/test-objects/test-objet/key1", + "related-to": "generic-vnf", + "related-link": "/aai/v10/network/generic-vnfs/test-objet/key1", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key2" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json index 490bbd30..3afe6bb7 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/both-successv10-failv9.json @@ -1,6 +1,6 @@ { - "related-to": "test-object", - "related-link": "http://localhost/aai/v10/network/test-objects/test-object/key1", + "related-to": "generic-vnf", + "related-link": "http://localhost/aai/v10/network/generic-vnfs/generic-vnf/key1", "relationship-data" : [{ "relationship-key" : "test-obect.vnf-id", "relationship-value":"key2" diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json index ea5ff2fe..b24834af 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/nothing-to-parse.json @@ -1,4 +1,4 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [] } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json index 15e383aa..4cc103e8 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-related-link.json @@ -1,4 +1,4 @@ { - "related-to": "test-object", - "related-link": "http://localhost/aai/v10/network/test-objects/test-object/key1" + "related-to": "generic-vnf", + "related-link": "http://localhost/aai/v10/network/generic-vnfs/generic-vnf/key1" } \ No newline at end of file diff --git a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json index dc7445e0..b9fccc9c 100644 --- a/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json +++ b/aai-core/src/test/resources/bundleconfig-local/etc/relationship/only-relationship-data.json @@ -1,7 +1,7 @@ { - "related-to": "test-object", + "related-to": "generic-vnf", "relationship-data" : [{ - "relationship-key" : "test-object.vnf-id", + "relationship-key" : "generic-vnf.vnf-id", "relationship-value":"key1" }] } \ No newline at end of file diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json index 0b79192a..515831e9 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_TraversalQueryTest.json @@ -10,7 +10,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "vnfc", @@ -21,7 +22,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "vce", @@ -33,7 +35,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "pserver", @@ -45,7 +48,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -57,7 +61,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -68,7 +73,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "complex", @@ -80,7 +86,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "complex", @@ -91,7 +98,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "l-interface", @@ -103,7 +111,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "l-interface", @@ -115,7 +124,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "l-interface", @@ -127,7 +137,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "pserver", @@ -139,7 +150,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" } ] } diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json index 76059ed6..9888ed76 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test.json @@ -9,7 +9,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -20,7 +21,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -31,7 +33,8 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "quux", @@ -42,7 +45,8 @@ "contains-other-v": "!${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-parent", @@ -53,7 +57,8 @@ "contains-other-v": "${direction}", "delete-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-cousin", @@ -64,7 +69,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "test-child", @@ -75,8 +81,9 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" - }, + "prevent-delete": "NONE", + "description": "Hard to describe" + }, { "from": "a", "to": "b", @@ -87,7 +94,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default": "false" + "default": "false", + "description": "Hard to describe" }, { "from": "a", @@ -99,7 +107,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default" : "true" + "default" : "true", + "description": "Hard to describe" }, { "from": "z", @@ -110,7 +119,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "y", @@ -122,7 +132,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "NONE", "prevent-delete": "NONE", - "default" : "true" + "default" : "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -134,7 +145,8 @@ "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", "prevent-delete": "NONE", - "default": "true" + "default": "true", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -145,7 +157,8 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "generic-vnf", @@ -156,6 +169,30 @@ "contains-other-v": "NONE", "delete-other-v": "${direction}", "SVC-INFRA": "${direction}", + "prevent-delete": "NONE", + "description": "Hard to describe", + "prevent-delete": "NONE" + }, + { + "from": "l-interface", + "to": "logical-link", + "label": "usesLogicalLink", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "NONE", + "delete-other-v": "${direction}", + "SVC-INFRA": "${direction}", + "prevent-delete": "NONE" + }, + { + "from": "generic-vnf", + "to": "l-interface", + "label": "hasLInterface", + "direction": "OUT", + "multiplicity": "Many2Many", + "contains-other-v": "${direction}", + "delete-other-v": "NONE", + "SVC-INFRA": "${direction}", "prevent-delete": "NONE" } ] diff --git a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json index d4b7f7f3..f9d401f2 100644 --- a/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json +++ b/aai-core/src/test/resources/dbedgerules/DbEdgeRules_test_broken.json @@ -8,7 +8,8 @@ "multiplicity": "One2Many", "contains-other-v": "NONE", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "foo", @@ -19,7 +20,8 @@ "contains-other-v": "${direction}", "delete-other-v": "${direction}", "SVC-INFRA": "NONE", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" }, { "from": "quux", @@ -29,7 +31,8 @@ "multiplicity": "One2Many", "contains-other-v": "!${direction}", "delete-other-v": "${direction}", - "prevent-delete": "NONE" + "prevent-delete": "NONE", + "description": "Hard to describe" } ] } \ No newline at end of file diff --git a/aai-core/src/test/resources/edgeLabelMigration.csv b/aai-core/src/test/resources/edgeLabelMigration.csv new file mode 100644 index 00000000..53639e55 --- /dev/null +++ b/aai-core/src/test/resources/edgeLabelMigration.csv @@ -0,0 +1,212 @@ +from,to,label,direction,multiplicity,contains-other-v,delete-other-v,SVC-INFRA,prevent-delete,new from,new to,new label,new direction,new multiplicity,new contains-other-v,new delete-other-v,new SVC-INFRA,new prevent-delete,new default +allotted-resource,allotted-resource,bindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,allotted-resource,tosca.relationships.network.BindsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,generic-vnf,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,generic-vnf,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l3-network,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,l3-network,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,l-interface,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,allotted-resource,l-interface,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,network-policy,uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,allotted-resource,network-policy,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +allotted-resource,vlan,isPartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,allotted-resource,vlan,org.onap.relationships.inventory.PartOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +allotted-resource,vpn-binding,belongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},allotted-resource,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +allotted-resource,tunnel-xconnect,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,tunnel-xconnect,allotted-resource,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +availability-zone,complex,groupsResourcesIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +availability-zone,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},availability-zone,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +cloud-region,availability-zone,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},availability-zone,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +cloud-region,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},cloud-region,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +cloud-region,l3-network,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,cloud-region,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +cloud-region,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,cloud-region,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +cloud-region,dvs-switch,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},dvs-switch,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,flavor,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},flavor,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,group-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},group-assignment,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,image,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},image,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,oam-network,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},oam-network,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,snapshot,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},snapshot,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,tenant,has,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},tenant,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +cloud-region,vip-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv4-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,vip-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vip-ipv6-address-list,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +cloud-region,volume-group,has,OUT,ONE2MANY,${direction},${direction},NONE,${direction},volume-group,cloud-region,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,NONE,!${direction},T +complex,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,complex,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +complex,ctag-pool,hasCtagPool,OUT,MANY2MANY,${direction},${direction},NONE,NONE,ctag-pool,complex,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +configuration,allotted-resource,uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,configuration,allotted-resource,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,${direction},NONE,NONE,T +configuration,logical-link,has,OUT,ONE2MANY,NONE,${direction},NONE,NONE,configuration,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +configuration,metadatum,owns,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +connector,virtual-data-center,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,connector,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +connector,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,connector,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +constrained-element-set,element-choice-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,element-choice-set,constrained-element-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +ctag-pool,availability-zone,supportsAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},ctag-pool,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +customer,service-subscription,subscribesTo,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-subscription,customer,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +dvs-switch,availability-zone,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},dvs-switch,availability-zone,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +element-choice-set,model-element,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,element-choice-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,configuration,uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,generic-vnf,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +generic-vnf,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,ipsec-configuration,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,generic-vnf,ipsec-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +generic-vnf,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,${direction},NONE,generic-vnf,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,license-key-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},generic-vnf,license-key-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +generic-vnf,pnf,hostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,generic-vnf,pnf,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,pserver,runsOnPserver,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},generic-vnf,pserver,tosca.relationships.HostedOn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +generic-vnf,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},NONE,vnfc,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,!${direction},!${direction},NONE,T +generic-vnf,vnf-image,usesVnfImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},generic-vnf,vnf-image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +generic-vnf,volume-group,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,vserver,runsOnVserver,OUT,ONE2MANY,NONE,NONE,${direction},NONE,generic-vnf,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +generic-vnf,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +generic-vnf,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +generic-vnf,network-profile,hasNetworkProfile,OUT,MANY2MANY,NONE,NONE,NONE,NONE,network-profile,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,${direction},NONE,service-instance,generic-vnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +generic-vnf,site-pair-set,hasSitePairSet,OUT,MANY2MANY,NONE,NONE,NONE,NONE,site-pair-set,generic-vnf,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +generic-vnf,vf-module,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,vf-module,generic-vnf,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +group-assignment,pserver,has,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},pserver,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,NONE,${direction},T +group-assignment,tenant,has,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,group-assignment,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +image,metadatum,hasMetaDatum,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,image,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +instance-group,model,targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},instance-group,model,org.onap.relationships.inventory.Targets,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +ipsec-configuration,vig-server,hasVigServer,OUT,ONE2MANY,${direction},${direction},NONE,NONE,vig-server,ipsec-configuration,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-interface-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv4-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv4-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv4-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv4-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-interface-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-interface-ipv6-address-list,instance-group,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-interface-ipv6-address-list,l3-network,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-interface-ipv6-address-list,l3-network,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-interface-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},l3-interface-ipv6-address-list,subnet,org.onap.relationships.inventory.network.MemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +l3-network,ctag-assignment,hasCtagAssignment,OUT,MANY2MANY,${direction},${direction},${direction},NONE,ctag-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l3-network,instance-group,memberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,network-policy,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,l3-network,network-policy,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +l3-network,route-table-reference,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l3-network,route-table-reference,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l3-network,vpn-binding,usesVpnBinding,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},l3-network,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +l3-network,segmentation-assignment,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,segmentation-assignment,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +l3-network,service-instance,hasInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,l3-network,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +l3-network,subnet,hasSubnet,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,subnet,l3-network,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +lag-interface,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,lag-link,tosca.relationships.network.LinksTo,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,logical-link,uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,lag-interface,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +lag-interface,p-interface,usesPInterface,OUT,MANY2MANY,NONE,NONE,${direction},NONE,lag-interface,p-interface,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +lag-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,lag-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +line-of-business,generic-vnf,realizedBy,OUT,MANY2MANY,NONE,NONE,NONE,NONE,line-of-business,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,l-interface,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +l-interface,l-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,l-interface,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +l-interface,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,l-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},${direction},NONE,T +l-interface,logical-link,sourceLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Source,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,logical-link,targetLInterface,OUT,MANY2MANY,NONE,${direction},${direction},NONE,logical-link,l-interface,org.onap.relationships.inventory.Destination,OUT,ONE2MANY,NONE,!${direction},!${direction},NONE,F +l-interface,sriov-vf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-vf,l-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +l-interface,vlan,hasVlan,OUT,MANY2MANY,${direction},${direction},NONE,NONE,vlan,l-interface,tosca.relationships.network.LinksTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +logical-link,cloud-region,existsIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,generic-vnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,generic-vnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,lag-link,usesLAGLink,OUT,MANY2MANY,NONE,NONE,${direction},NONE,logical-link,lag-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +logical-link,logical-link,uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,logical-link,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +logical-link,pnf,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,pnf,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +logical-link,pserver,bridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,pserver,org.onap.relationships.inventory.BridgedTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +logical-link,vpn-binding,uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},logical-link,vpn-binding,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +model,model-ver,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-ver,model,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-constraint,constrained-element-set,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-constraint,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,constrained-element-set,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,constrained-element-set,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-constraint,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-element,connectsTo,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-element,model-ver,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},model-element,model-ver,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +model-ver,metadatum,hasMetaDatum,OUT,ONE2MANY,${direction},${direction},NONE,NONE,metadatum,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +model-ver,model-element,startsWith,OUT,ONE2MANY,${direction},${direction},NONE,NONE,model-element,model-ver,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query,model,relatedTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},named-query,model,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,!${direction},T +named-query,named-query-element,startsWith,OUT,ONE2ONE,${direction},${direction},NONE,NONE,named-query-element,named-query,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,model,isA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},named-query-element,model,org.onap.relationships.inventory.IsA,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +named-query-element,named-query-element,connectsTo,OUT,MANY2MANY,${direction},${direction},NONE,NONE,named-query-element,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,property-constraint,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,property-constraint,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +named-query-element,related-lookup,uses,OUT,ONE2MANY,${direction},${direction},NONE,NONE,related-lookup,named-query-element,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +newvce,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,l-interface,newvce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +oam-network,complex,definedFor,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,complex,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +oam-network,service-capability,supportsServiceCapability,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},oam-network,service-capability,org.onap.relationships.inventory.AppliesTo,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +operational-environment,operational-environment,managedBy,OUT,ONE2ONE,NONE,NONE,NONE,NONE,operational-environment,operational-environment,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +owning-entity,service-instance,owns,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,owning-entity,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +p-interface,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,p-interface,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +p-interface,logical-link,usesLogicalLink,OUT,MANY2ONE,NONE,NONE,${direction},NONE,p-interface,logical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +p-interface,physical-link,usesPhysicalLink,OUT,MANY2MANY,NONE,${direction},NONE,NONE,p-interface,physical-link,tosca.relationships.network.LinksTo,OUT,MANY2ONE,NONE,${direction},NONE,NONE,T +p-interface,sriov-pf,has,OUT,ONE2ONE,${direction},${direction},NONE,NONE,sriov-pf,p-interface,org.onap.relationships.inventory.BelongsTo,OUT,ONE2ONE,!${direction},!${direction},NONE,NONE,T +platform,generic-vnf,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,platform,generic-vnf,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,lag-interface,has,OUT,ONE2MANY,${direction},${direction},${direction},NONE,lag-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pnf,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pnf,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},pnf,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +pnf,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,pnf,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +pnf,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pnf,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +port-group,cvlan-tag,hasCTag,OUT,MANY2MANY,${direction},${direction},${direction},NONE,cvlan-tag,port-group,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +project,service-instance,created,OUT,ONE2MANY,NONE,NONE,NONE,NONE,project,service-instance,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +pserver,lag-interface,hasLAGInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,lag-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,p-interface,pserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +pserver,availability-zone,existsIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,availability-zone,org.onap.relationships.inventory.MemberOf,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,cloud-region,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,pserver,cloud-region,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +pserver,complex,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},pserver,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +pserver,zone,isMemberOf,OUT,MANY2ONE,NONE,NONE,NONE,NONE,pserver,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +routing-instance,site-pair,hasSitePair,OUT,MANY2MANY,${direction},${direction},NONE,NONE,site-pair,routing-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,has,OUT,MANY2MANY,${direction},${direction},NONE,NONE,allotted-resource,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,metadatum,hasMetaData,OUT,MANY2MANY,${direction},${direction},NONE,NONE,metadatum,service-instance,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +service-instance,allotted-resource,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,allotted-resource,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,configuration,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,configuration,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,connector,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,connector,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,ctag-assignment,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,ctag-assignment,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,cvlan-tag,hasIPAGFacingVLAN,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,cvlan-tag,org.onap.relationships.inventory.ComposedOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-instance,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +service-instance,logical-link,uses,OUT,MANY2MANY,NONE,${direction},NONE,NONE,service-instance,logical-link,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,${direction},NONE,NONE,T +service-instance,pnf,uses,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,pnf,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,service-instance,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,service-instance,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,vlan,dependsOn,OUT,ONE2MANY,NONE,NONE,NONE,NONE,service-instance,vlan,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +service-instance,zone,locatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,service-instance,zone,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},NONE,T +service-subscription,service-instance,hasInstance,OUT,MANY2MANY,${direction},${direction},!${direction},NONE,service-instance,service-subscription,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},${direction},NONE,T +site-pair,class-of-service,hasClassOfService,OUT,MANY2MANY,${direction},${direction},NONE,NONE,class-of-service,site-pair,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +site-pair-set,routing-instance,hasRoutingInstance,OUT,MANY2MANY,${direction},${direction},NONE,NONE,routing-instance,site-pair-set,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +sriov-vf,sriov-pf,uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,sriov-vf,sriov-pf,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,NONE,NONE,T +subnet,host-route,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,host-route,subnet,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +tenant,service-subscription,relatedTo,OUT,MANY2MANY,NONE,NONE,NONE,NONE,service-subscription,tenant,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,l3-network,usesL3Network,OUT,MANY2MANY,NONE,NONE,NONE,NONE,tenant,l3-network,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +tenant,vserver,owns,OUT,ONE2MANY,${direction},${direction},!${direction},${direction},vserver,tenant,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},NONE,${direction},!${direction},T +vce,entitlement,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,entitlement,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,license,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,license,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vce,port-group,hasPortGroup,OUT,MANY2MANY,${direction},${direction},${direction},NONE,port-group,vce,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vce,service-instance,hasServiceInstance,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,service-instance,vce,org.onap.relationships.inventory.ComposedOf,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vce,availability-zone,hasAvailabilityZone,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vce,availability-zone,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vce,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vce,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},T +vce,vserver,runsOnVserver,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vce,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,${direction},NONE,T +vf-module,l3-network,uses,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vf-module,l3-network,org.onap.relationships.inventory.DependsOn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +vf-module,vnfc,uses,OUT,ONE2MANY,NONE,${direction},${direction},${direction},vf-module,vnfc,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,${direction},${direction},T +vf-module,volume-group,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vf-module,volume-group,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vip-ipv4-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv4-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv4-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv4-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +vip-ipv6-address-list,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vip-ipv6-address-list,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vip-ipv6-address-list,subnet,isMemberOf,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},vip-ipv6-address-list,subnet,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},T +virtual-data-center,generic-vnf,hasVNF,OUT,MANY2MANY,NONE,NONE,!${direction},NONE,generic-vnf,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,${direction},NONE,T +virtual-data-center,logical-link,contains,OUT,MANY2MANY,NONE,NONE,NONE,NONE,logical-link,virtual-data-center,org.onap.relationships.inventory.LocatedIn,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vlan,l3-interface-ipv4-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv4-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,l3-interface-ipv6-address-list,hasIpAddress,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l3-interface-ipv6-address-list,vlan,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vlan,logical-link,usesLogicalLink,OUT,MANY2MANY,NONE,${direction},${direction},NONE,vlan,logical-link,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,${direction},${direction},NONE,T +vlan,multicast-configuration,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vlan,multicast-configuration,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,l3-interface-ipv4-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv4-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,l3-interface-ipv6-address-list,hasIpAddress,OUT,ONE2MANY,${direction},${direction},NONE,NONE,l3-interface-ipv6-address-list,vnfc,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vnfc,instance-group,isMemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,instance-group,org.onap.relationships.inventory.MemberOf,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv4-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv4-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vnfc,vip-ipv6-address-list,uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vnfc,vip-ipv6-address-list,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +volume-group,tenant,belongsTo,OUT,MANY2MANY,NONE,NONE,${direction},NONE,tenant,volume-group,org.onap.relationships.inventory.DependsOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +volume-group,complex,existsIn,OUT,MANY2MANY,NONE,NONE,${direction},!${direction},volume-group,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vpls-pe,lag-interface,hasLAGinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,lag-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,p-interface,hasPinterface,OUT,MANY2MANY,${direction},${direction},NONE,NONE,p-interface,vpls-pe,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vpls-pe,complex,locatedIn,OUT,MANY2MANY,NONE,NONE,NONE,!${direction},vpls-pe,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +vpls-pe,ctag-pool,usesCtagPool,OUT,MANY2MANY,NONE,NONE,NONE,NONE,vpls-pe,ctag-pool,org.onap.relationships.inventory.Uses,OUT,MANY2MANY,NONE,NONE,NONE,NONE,T +vpn-binding,route-target,has,OUT,ONE2MANY,${direction},${direction},NONE,NONE,route-target,vpn-binding,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +vserver,l-interface,hasLInterface,OUT,MANY2MANY,${direction},${direction},${direction},NONE,l-interface,vserver,tosca.relationships.network.BindsTo,OUT,MANY2ONE,!${direction},!${direction},!${direction},NONE,T +vserver,vf-module,isPartOf,OUT,MANY2ONE,NONE,NONE,${direction},NONE,vf-module,vserver,org.onap.relationships.inventory.Uses,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,vnfc,hosts,OUT,MANY2MANY,NONE,NONE,${direction},NONE,vnfc,vserver,tosca.relationships.HostedOn,OUT,ONE2MANY,NONE,NONE,!${direction},NONE,T +vserver,flavor,hasFlavor,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,flavor,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,image,hasImage,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,image,org.onap.relationships.inventory.Uses,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,pserver,runsOnPserver,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},vserver,pserver,tosca.relationships.HostedOn,OUT,MANY2ONE,NONE,NONE,${direction},!${direction},T +vserver,snapshot,uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,vserver,snapshot,org.onap.relationships.inventory.Uses,OUT,ONE2ONE,NONE,NONE,${direction},NONE,T +vserver,volume,hasVolume,OUT,MANY2MANY,${direction},${direction},${direction},NONE,vserver,volume,tosca.relationships.AttachesTo,OUT,ONE2MANY,${direction},${direction},${direction},NONE,T +zone,complex,existsIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},zone,complex,org.onap.relationships.inventory.LocatedIn,OUT,MANY2ONE,NONE,NONE,NONE,!${direction},T +,,,,,,,,,allotted-resource,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,generic-vnf,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,l3-network,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,logical-link,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,service-instance,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +,,,,,,,,,vf-module,model-ver,org.onap.relationships.inventory.IsA,OUT,Many2One,NONE,NONE,NONE,NONE,T +configuration,l-interface,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,l-interface,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +configuration,pnf,has,OUT,ONE2MANY,NONE,NONE,NONE,NONE,configuration,pnf,org.onap.relationships.inventory.AppliesTo,OUT,ONE2MANY,NONE,NONE,NONE,NONE,T +forwarder,forwarding-path,belongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,forwarder,forwarding-path,org.onap.relationships.inventory.BelongsTo,OUT,MANY2ONE,!${direction},!${direction},NONE,NONE,T +forwarding-path,service-instance,implements,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,forwarding-path,service-instance,org.onap.relationships.inventory.AppliesTo,OUT,MANY2ONE,NONE,!${direction},NONE,NONE,T +forwarder,l-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,l-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T +forwarder,p-interface,forwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,forwarder,p-interface,org.onap.relationships.inventory.ForwardsTo,OUT,ONE2ONE,NONE,NONE,NONE,NONE,T diff --git a/aai-core/src/test/resources/logback.xml b/aai-core/src/test/resources/logback.xml index 959ef63f..37425b97 100644 --- a/aai-core/src/test/resources/logback.xml +++ b/aai-core/src/test/resources/logback.xml @@ -130,7 +130,7 @@ ${logDirectory}/rest/audit.log - ${logDirectory}/rest/audit-${Pid}.%d{yyyy-MM-dd}.log.zip + ${logDirectory}/rest/audit-${lrmRVer}-${lrmRO}-${Pid}.%d{yyyy-MM-dd}.log.zip ${logDirectory}/rest/perform.log - ${logDirectory}/rest/perform-${Pid}.%d{yyyy-MM-dd}.log.zip + ${logDirectory}/rest/perform-${lrmRVer}-${lrmRO}-${Pid}.%d{yyyy-MM-dd}.log.zip - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml b/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml deleted file mode 100644 index 06dc6e03..00000000 --- a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v8.xml +++ /dev/null @@ -1,3079 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml b/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml deleted file mode 100644 index aec9b83d..00000000 --- a/aai-core/src/test/resources/org/openecomp/aai/introspection/aai_oxm_v9.xml +++ /dev/null @@ -1,599 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json b/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json new file mode 100644 index 00000000..3c656da1 --- /dev/null +++ b/aai-core/src/test/resources/payloads/expected/generic-vnf-with-lag-interface.json @@ -0,0 +1,27 @@ +{ + "vnf-id": "vnf1", + "vnf-type": "someval", + "vnf-name": "someval", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "ipv1" + }, + { + "l3-interface-ipv6-address": "ipv2" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json b/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json new file mode 100644 index 00000000..97372dd8 --- /dev/null +++ b/aai-core/src/test/resources/payloads/resource/cloud-region-with-all-children.json @@ -0,0 +1,310 @@ +{ + "cloud-owner" : "junit-cloud-owner", + "cloud-region-id" : "junit-cloud-region", + "cloud-type" : "P9P1X6U9eDXR", + "owner-defined-type" : "OUrR8kI6Br", + "cloud-region-version" : "Nyr", + "identity-url" : "JHqvA1M", + "cloud-zone" : "Y5UfJUM", + "complex-name" : "QLP", + "sriov-automation" : false, + "tenants" : { + "tenant" : [ { + "tenant-id" : "tenant1", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "vserver1", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } + } ] + }, + "flavors" : { + "flavor" : [ { + "flavor-id" : "a7208e23-b517-4ccb-a3ab-00952aa89480-vk250x", + "flavor-name" : "JGWnOD", + "flavor-vcpus" : 803, + "flavor-ram" : 920, + "flavor-disk" : 438, + "flavor-ephemeral" : 41, + "flavor-swap" : "KiuHc7", + "flavor-is-public" : false, + "flavor-selflink" : "pXtX", + "flavor-disabled" : false + } ] + }, + "group-assignments" : { + "group-assignment" : [ { + "group-id" : "30c1bb60-1b71-4b46-910f-d33c7905a779-vk250x", + "group-type" : "bRh", + "group-name" : "hg11sdvW", + "group-description" : "df3w60RR" + } ] + }, + "snapshots" : { + "snapshot" : [ { + "snapshot-id" : "26c013f4-c119-4ddd-89cf-e9b2729f87e5-vk250x", + "snapshot-name" : "0J3q8ZjyPGH", + "snapshot-architecture" : "wMu9Tvile", + "snapshot-os-distro" : "2Vv4Pqzu", + "snapshot-os-version" : "Vim0fyf404YVW", + "application" : "oxkCtHUk", + "application-vendor" : "tTpXkD", + "application-version" : "aOqn", + "snapshot-selflink" : "GCapKV9Tq", + "prev-snapshot-id" : "Imnj21xW5Hez" + }, { + "snapshot-id" : "ee2e8769-2dcf-4a3c-90bd-a0ba91c97f13-vk250x", + "snapshot-name" : "zRh94rw3pc1", + "snapshot-architecture" : "FxVDY", + "snapshot-os-distro" : "QZnKXjI5LDBSi", + "snapshot-os-version" : "u0Bl2moOJ7bb", + "application" : "dlXZPm9B7", + "application-vendor" : "89tls6", + "application-version" : "c05X", + "snapshot-selflink" : "rmExWmnDIZu3", + "prev-snapshot-id" : "5chZxlmHfhe" + } ] + }, + "images" : { + "image" : [ { + "image-id" : "691210f6-f3f2-488f-993c-a9c9570fb71f-vk250x", + "image-name" : "GsPzYlduuWk", + "image-architecture" : "vNdK4fYJf", + "image-os-distro" : "ZxYe", + "image-os-version" : "SVBBpHEc", + "application" : "GgBxi1zv8h2KG", + "application-vendor" : "x6NtDNUj", + "application-version" : "VOZYqE04K9", + "image-selflink" : "gOzbbHZtkuh", + "metadata" : { + "metadatum" : [ { + "metaname" : "b9565dfa-ed1f-4d35-90c6-bb56a48d9b2a-vk250x", + "metaval" : "nyq5IHmI" + } ] + } + }, { + "image-id" : "1f00c00a-9ab7-44a0-9961-bcf5f806fef8-vk250x", + "image-name" : "WChNCg3ThQ1Of", + "image-architecture" : "oL2m4nUPPG6j", + "image-os-distro" : "kf7", + "image-os-version" : "DxTTyv4S16e", + "application" : "Y0dytCJ2ouDk", + "application-vendor" : "F7E7a", + "application-version" : "8wkd3Cy", + "image-selflink" : "5N5A", + "metadata" : { + "metadatum" : [ { + "metaname" : "a5c4c98f-0b36-4f70-a235-5135e8e644f1-vk250x", + "metaval" : "vupk3k29rdN" + }, { + "metaname" : "e6084e48-df73-4854-a2be-522087b5f6a3-vk250x", + "metaval" : "l9VaEeP" + } ] + } + } ] + }, + "dvs-switches" : { + "dvs-switch" : [ { + "switch-name" : "b01222d9-f9f9-493d-8ee0-9ab7c095d5a0-vk250x", + "vcenter-url" : "NNtc" + }, { + "switch-name" : "7abed153-9fb5-4c05-87aa-ead0feb35b16-vk250x", + "vcenter-url" : "YSS" + } ] + }, + "oam-networks" : { + "oam-network" : [ { + "network-uuid" : "af2371f8-0fa6-4d4d-90c8-9c5d3ba3e01e-vk250x", + "network-name" : "cVevT9o20HAs4", + "cvlan-tag" : 560, + "ipv4-oam-gateway-address" : "F565rGb", + "ipv4-oam-gateway-address-prefix-length" : 540 + } ] + }, + "availability-zones" : { + "availability-zone" : [ { + "availability-zone-name" : "9761e922-fd2a-4c96-9a13-4e62e1daccdc-vk250x", + "hypervisor-type" : "qijdeI", + "operational-status" : "C0KkUiJ" + } ] + }, + "vip-ipv4-address-list" : [ { + "vip-ipv4-address" : "08b4a6c1-c702-4449-8791-caaa5341c6d9-vk250x", + "vip-ipv4-prefix-length" : 185, + "vlan-id-inner" : 969, + "vlan-id-outer" : 414, + "is-floating" : true, + "neutron-network-id" : "S7r90cEZ", + "neutron-subnet-id" : "2NwjH" + } ], + "vip-ipv6-address-list" : [ { + "vip-ipv6-address" : "f01dbad0-10c5-491c-a6e5-d972c9b99f56-vk250x", + "vip-ipv6-prefix-length" : 365, + "vlan-id-inner" : 326, + "vlan-id-outer" : 927, + "is-floating" : true, + "neutron-network-id" : "ULEl0", + "neutron-subnet-id" : "eyt9" + } ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json b/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json new file mode 100644 index 00000000..fee82181 --- /dev/null +++ b/aai-core/src/test/resources/payloads/resource/l-interface-with-ipv6.json @@ -0,0 +1,22 @@ +{ + "vnf-id": "vnf1", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "ipv6-1" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/templates/cloud-region.json b/aai-core/src/test/resources/payloads/templates/cloud-region.json new file mode 100644 index 00000000..176214af --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/cloud-region.json @@ -0,0 +1,310 @@ +{ + "cloud-owner" : "${cloud-owner}", + "cloud-region-id" : "${cloud-region-id}", + "cloud-type" : "P9P1X6U9eDXR", + "owner-defined-type" : "OUrR8kI6Br", + "cloud-region-version" : "Nyr", + "identity-url" : "JHqvA1M", + "cloud-zone" : "Y5UfJUM", + "complex-name" : "QLP", + "sriov-automation" : false, + "tenants" : { + "tenant" : [ { + "tenant-id" : "${tenant-id}", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "${vserver-id}", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } + } ] + }, + "flavors" : { + "flavor" : [ { + "flavor-id" : "a7208e23-b517-4ccb-a3ab-00952aa89480-vk250x", + "flavor-name" : "JGWnOD", + "flavor-vcpus" : 803, + "flavor-ram" : 920, + "flavor-disk" : 438, + "flavor-ephemeral" : 41, + "flavor-swap" : "KiuHc7", + "flavor-is-public" : false, + "flavor-selflink" : "pXtX", + "flavor-disabled" : false + } ] + }, + "group-assignments" : { + "group-assignment" : [ { + "group-id" : "30c1bb60-1b71-4b46-910f-d33c7905a779-vk250x", + "group-type" : "bRh", + "group-name" : "hg11sdvW", + "group-description" : "df3w60RR" + } ] + }, + "snapshots" : { + "snapshot" : [ { + "snapshot-id" : "26c013f4-c119-4ddd-89cf-e9b2729f87e5-vk250x", + "snapshot-name" : "0J3q8ZjyPGH", + "snapshot-architecture" : "wMu9Tvile", + "snapshot-os-distro" : "2Vv4Pqzu", + "snapshot-os-version" : "Vim0fyf404YVW", + "application" : "oxkCtHUk", + "application-vendor" : "tTpXkD", + "application-version" : "aOqn", + "snapshot-selflink" : "GCapKV9Tq", + "prev-snapshot-id" : "Imnj21xW5Hez" + }, { + "snapshot-id" : "ee2e8769-2dcf-4a3c-90bd-a0ba91c97f13-vk250x", + "snapshot-name" : "zRh94rw3pc1", + "snapshot-architecture" : "FxVDY", + "snapshot-os-distro" : "QZnKXjI5LDBSi", + "snapshot-os-version" : "u0Bl2moOJ7bb", + "application" : "dlXZPm9B7", + "application-vendor" : "89tls6", + "application-version" : "c05X", + "snapshot-selflink" : "rmExWmnDIZu3", + "prev-snapshot-id" : "5chZxlmHfhe" + } ] + }, + "images" : { + "image" : [ { + "image-id" : "691210f6-f3f2-488f-993c-a9c9570fb71f-vk250x", + "image-name" : "GsPzYlduuWk", + "image-architecture" : "vNdK4fYJf", + "image-os-distro" : "ZxYe", + "image-os-version" : "SVBBpHEc", + "application" : "GgBxi1zv8h2KG", + "application-vendor" : "x6NtDNUj", + "application-version" : "VOZYqE04K9", + "image-selflink" : "gOzbbHZtkuh", + "metadata" : { + "metadatum" : [ { + "metaname" : "b9565dfa-ed1f-4d35-90c6-bb56a48d9b2a-vk250x", + "metaval" : "nyq5IHmI" + } ] + } + }, { + "image-id" : "1f00c00a-9ab7-44a0-9961-bcf5f806fef8-vk250x", + "image-name" : "WChNCg3ThQ1Of", + "image-architecture" : "oL2m4nUPPG6j", + "image-os-distro" : "kf7", + "image-os-version" : "DxTTyv4S16e", + "application" : "Y0dytCJ2ouDk", + "application-vendor" : "F7E7a", + "application-version" : "8wkd3Cy", + "image-selflink" : "5N5A", + "metadata" : { + "metadatum" : [ { + "metaname" : "a5c4c98f-0b36-4f70-a235-5135e8e644f1-vk250x", + "metaval" : "vupk3k29rdN" + }, { + "metaname" : "e6084e48-df73-4854-a2be-522087b5f6a3-vk250x", + "metaval" : "l9VaEeP" + } ] + } + } ] + }, + "dvs-switches" : { + "dvs-switch" : [ { + "switch-name" : "b01222d9-f9f9-493d-8ee0-9ab7c095d5a0-vk250x", + "vcenter-url" : "NNtc" + }, { + "switch-name" : "7abed153-9fb5-4c05-87aa-ead0feb35b16-vk250x", + "vcenter-url" : "YSS" + } ] + }, + "oam-networks" : { + "oam-network" : [ { + "network-uuid" : "af2371f8-0fa6-4d4d-90c8-9c5d3ba3e01e-vk250x", + "network-name" : "cVevT9o20HAs4", + "cvlan-tag" : 560, + "ipv4-oam-gateway-address" : "F565rGb", + "ipv4-oam-gateway-address-prefix-length" : 540 + } ] + }, + "availability-zones" : { + "availability-zone" : [ { + "availability-zone-name" : "9761e922-fd2a-4c96-9a13-4e62e1daccdc-vk250x", + "hypervisor-type" : "qijdeI", + "operational-status" : "C0KkUiJ" + } ] + }, + "vip-ipv4-address-list" : [ { + "vip-ipv4-address" : "08b4a6c1-c702-4449-8791-caaa5341c6d9-vk250x", + "vip-ipv4-prefix-length" : 185, + "vlan-id-inner" : 969, + "vlan-id-outer" : 414, + "is-floating" : true, + "neutron-network-id" : "S7r90cEZ", + "neutron-subnet-id" : "2NwjH" + } ], + "vip-ipv6-address-list" : [ { + "vip-ipv6-address" : "f01dbad0-10c5-491c-a6e5-d972c9b99f56-vk250x", + "vip-ipv6-prefix-length" : 365, + "vlan-id-inner" : 326, + "vlan-id-outer" : 927, + "is-floating" : true, + "neutron-network-id" : "ULEl0", + "neutron-subnet-id" : "eyt9" + } ] +} \ No newline at end of file diff --git a/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json b/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json new file mode 100644 index 00000000..fc025bb2 --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/generic-vnf-with-lag-interface.json @@ -0,0 +1,24 @@ +{ + "vnf-id": "vnf1", + "vnf-type": "someval", + "vnf-name": "someval", + "lag-interfaces": { + "lag-interface": [ + { + "interface-name": "lag1", + "l-interfaces": { + "l-interface": [ + { + "interface-name": "int1", + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "${ip-address}" + } + ] + } + ] + } + } + ] + } +} diff --git a/aai-core/src/test/resources/payloads/templates/tenant.json b/aai-core/src/test/resources/payloads/templates/tenant.json new file mode 100644 index 00000000..ce0f5588 --- /dev/null +++ b/aai-core/src/test/resources/payloads/templates/tenant.json @@ -0,0 +1,169 @@ +{ + "tenant-id" : "${tenant-id}", + "tenant-name" : "yhgVBcv3Pr", + "tenant-context" : "De4NNayqFBO", + "vservers" : { + "vserver" : [ { + "vserver-id" : "${vserver-id}", + "vserver-name" : "P3SJ347Uyv", + "vserver-name2" : "1dHd", + "prov-status" : "PR04shorWQ", + "vserver-selflink" : "v7dU8H", + "in-maint" : false, + "is-closed-loop-disabled" : true, + "volumes" : { + "volume" : [ { + "volume-id" : "61cbb17e-8e5f-4545-a8ea-13a0e9c9871f-vk250x", + "volume-selflink" : "mYkfJ9rGv" + }, { + "volume-id" : "d98083a6-b235-4e54-b19b-2ebfa1604246-vk250x", + "volume-selflink" : "69RRsreL4" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "top-linterface", + "interface-role" : "3W1FAJGSQ", + "v6-wan-link-ip" : "WugWw3N", + "selflink" : "Of4j0pU", + "interface-id" : "eoW", + "macaddr" : "XNbbIy33", + "network-name" : "ZETDv5sGhiS", + "management-option" : "qR3RyCxgEU", + "interface-description" : "ksuRPpWDEH7", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "20Q0ZE6n5iB0", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "KjPXyH", + "vlans" : { + "vlan" : [ { + "vlan-interface" : "8d225c33-7494-4173-939f-0e1e8741344d-vk250x", + "vlan-id-inner" : 884, + "vlan-id-outer" : 992, + "speed-value" : "RyFPm", + "speed-units" : "ZrckmLff7b", + "vlan-description" : "zjAeUFgeagpf", + "backdoor-connection" : "gANMvUquB", + "vpn-key" : "l0rV7bb2Sc", + "orchestration-status" : "WVnLpbzIx", + "in-maint" : false, + "prov-status" : "tYMRi6df", + "is-ip-unnumbered" : false, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "2e7d62a5-ff93-446f-9fa3-b4ba585e742b-vk250x", + "l3-interface-ipv4-prefix-length" : 640, + "vlan-id-inner" : 652, + "vlan-id-outer" : 868, + "is-floating" : true, + "neutron-network-id" : "dJ8Fqs4ZTRn", + "neutron-subnet-id" : "HC6ji9DO8" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "818cd2e5-8dac-4a49-aa2e-4f97d4e98594-vk250x", + "l3-interface-ipv6-prefix-length" : 910, + "vlan-id-inner" : 116, + "vlan-id-outer" : 661, + "is-floating" : true, + "neutron-network-id" : "vSpYqFg5Tfe", + "neutron-subnet-id" : "bqkOUZSlVF" + }, { + "l3-interface-ipv6-address" : "915a8e5d-9d39-4f99-a350-c48f48ac8f46-vk250x", + "l3-interface-ipv6-prefix-length" : 593, + "vlan-id-inner" : 554, + "vlan-id-outer" : 762, + "is-floating" : false, + "neutron-network-id" : "b7PM", + "neutron-subnet-id" : "u51Ma93" + } ] + } ] + }, + "sriov-vfs" : { + "sriov-vf" : [ { + "pci-id" : "01ca7dbe-e270-4545-a045-72e9e3fcb44b-vk250x", + "vf-vlan-filter" : "f9YNFlqrfHi", + "vf-mac-filter" : "HQhFdXpL1v", + "vf-vlan-strip" : true, + "vf-vlan-anti-spoof-check" : false, + "vf-mac-anti-spoof-check" : false, + "vf-mirrors" : "SqknCX", + "vf-broadcast-allow" : true, + "vf-unknown-multicast-allow" : false, + "vf-unknown-unicast-allow" : false, + "vf-insert-stag" : true, + "vf-link-status" : "MsSX9hug4u1", + "neutron-network-id" : "f4jq6yFxVVtC" + } ] + }, + "l-interfaces" : { + "l-interface" : [ { + "interface-name" : "nested-linterface1", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + },{ + "interface-name" : "nested-linterface2", + "interface-role" : "ZjOYJKIE4j9W1", + "v6-wan-link-ip" : "63RKRTd", + "selflink" : "5xF", + "interface-id" : "akNmnDyijrHla", + "macaddr" : "XLZCof4", + "network-name" : "yJt", + "management-option" : "FJ6qVt", + "interface-description" : "fCHE1Glz", + "is-port-mirrored" : false, + "in-maint" : false, + "prov-status" : "vuTb", + "is-ip-unnumbered" : false, + "allowed-address-pairs" : "5Lzn9" + } ] + }, + "l3-interface-ipv4-address-list" : [ { + "l3-interface-ipv4-address" : "fc25fa49-ec46-43f5-bd39-c1c9067d2962-vk250x", + "l3-interface-ipv4-prefix-length" : 339, + "vlan-id-inner" : 644, + "vlan-id-outer" : 701, + "is-floating" : true, + "neutron-network-id" : "IEpYVl", + "neutron-subnet-id" : "7uWdipdgtC4Qc" + }, { + "l3-interface-ipv4-address" : "402d29fe-baf4-47e3-9208-e12a75e25349-vk250x", + "l3-interface-ipv4-prefix-length" : 370, + "vlan-id-inner" : 971, + "vlan-id-outer" : 142, + "is-floating" : false, + "neutron-network-id" : "sRi62ZY3IrKkq", + "neutron-subnet-id" : "PeV5RhIfV2Ib7" + } ], + "l3-interface-ipv6-address-list" : [ { + "l3-interface-ipv6-address" : "c9befce1-5617-4525-b217-105a57f6bd59-vk250x", + "l3-interface-ipv6-prefix-length" : 333, + "vlan-id-inner" : 275, + "vlan-id-outer" : 324, + "is-floating" : true, + "neutron-network-id" : "em6Lc6ovvWsdx", + "neutron-subnet-id" : "pyx4f" + }, { + "l3-interface-ipv6-address" : "18aa594c-143b-4564-ac0c-72144aecbb66-vk250x", + "l3-interface-ipv6-prefix-length" : 350, + "vlan-id-inner" : 893, + "vlan-id-outer" : 37, + "is-floating" : false, + "neutron-network-id" : "lhiR1", + "neutron-subnet-id" : "kdfoiCb7JYBuh" + } ] + } ] + } + } ] + } +} \ No newline at end of file -- cgit 1.2.3-korg