aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.gitignore1
-rw-r--r--checkstyle/pom.xml2
-rwxr-xr-xcps-application/pom.xml2
-rw-r--r--cps-bom/pom.xml2
-rwxr-xr-xcps-dependencies/pom.xml2
-rw-r--r--cps-events/pom.xml2
-rw-r--r--cps-ncmp-events/pom.xml2
-rw-r--r--cps-ncmp-rest-stub/pom.xml2
-rw-r--r--cps-ncmp-rest/pom.xml2
-rw-r--r--cps-ncmp-service/pom.xml2
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyCmHandleQueryService.java29
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java7
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java38
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy103
-rwxr-xr-xcps-parent/pom.xml2
-rw-r--r--cps-path-parser/pom.xml2
-rwxr-xr-xcps-rest/pom.xml2
-rw-r--r--cps-ri/pom.xml2
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServiceDeletePerfTest.groovy52
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy4
-rw-r--r--cps-service/pom.xml2
-rw-r--r--docs/conf.yaml25
-rwxr-xr-xdocs/design.rst6
-rw-r--r--docs/modeling.rst1
-rw-r--r--docs/ncmp-inventory-querying.rst158
-rwxr-xr-xdocs/release-notes.rst35
-rw-r--r--integration-test/pom.xml2
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy2
-rw-r--r--jacoco-report/pom.xml2
-rw-r--r--pom.xml2
-rw-r--r--releases/3.2.6-container.yaml8
-rw-r--r--releases/3.2.6.yaml4
-rw-r--r--spotbugs/pom.xml2
-rw-r--r--test-tools/.gitignore1
-rwxr-xr-xtest-tools/test-deregistration.sh19
-rwxr-xr-xversion.properties2
36 files changed, 372 insertions, 159 deletions
diff --git a/.gitignore b/.gitignore
index 4f80c2b8a..fbd729606 100755
--- a/.gitignore
+++ b/.gitignore
@@ -33,4 +33,3 @@ tmp/
/docs/docs/
/docs/.vscode/
-/metrics-reports/
diff --git a/checkstyle/pom.xml b/checkstyle/pom.xml
index 25097d612..71ff88cc8 100644
--- a/checkstyle/pom.xml
+++ b/checkstyle/pom.xml
@@ -26,7 +26,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.cps</groupId>
<artifactId>checkstyle</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<profiles>
<profile>
diff --git a/cps-application/pom.xml b/cps-application/pom.xml
index a17e6bd5a..cf5de3ccf 100755
--- a/cps-application/pom.xml
+++ b/cps-application/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-bom/pom.xml b/cps-bom/pom.xml
index fe2106f97..88c78faee 100644
--- a/cps-bom/pom.xml
+++ b/cps-bom/pom.xml
@@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.cps</groupId>
<artifactId>cps-bom</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<packaging>pom</packaging>
<description>This artifact contains dependencyManagement declarations of all published CPS components.</description>
diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml
index 9b8867222..506ed9f18 100755
--- a/cps-dependencies/pom.xml
+++ b/cps-dependencies/pom.xml
@@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.cps</groupId>
<artifactId>cps-dependencies</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
diff --git a/cps-events/pom.xml b/cps-events/pom.xml
index 545dc14f7..8fa2380ca 100644
--- a/cps-events/pom.xml
+++ b/cps-events/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ncmp-events/pom.xml b/cps-ncmp-events/pom.xml
index d5ba1224d..890fa0eff 100644
--- a/cps-ncmp-events/pom.xml
+++ b/cps-ncmp-events/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ncmp-rest-stub/pom.xml b/cps-ncmp-rest-stub/pom.xml
index 6a268161f..c6eb0d7a5 100644
--- a/cps-ncmp-rest-stub/pom.xml
+++ b/cps-ncmp-rest-stub/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml
index 3d104a39d..bbf6b961a 100644
--- a/cps-ncmp-rest/pom.xml
+++ b/cps-ncmp-rest/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ncmp-service/pom.xml b/cps-ncmp-service/pom.xml
index 57cd1c6fd..1d7ca3813 100644
--- a/cps-ncmp-service/pom.xml
+++ b/cps-ncmp-service/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyCmHandleQueryService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyCmHandleQueryService.java
index 91e98e866..f29fd687b 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyCmHandleQueryService.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyCmHandleQueryService.java
@@ -26,26 +26,39 @@ import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
public interface NetworkCmProxyCmHandleQueryService {
/**
- * Query and return cm handles that match the given query parameters.
+ * Query and return cm handle ids that match the given query parameters.
+ * Supported query types:
+ * public properties
+ * modules
+ * cps-path
*
* @param cmHandleQueryServiceParameters the cm handle query parameters
- * @return collection of cm handles
+ * @return collection of cm handle ids
*/
- Collection<NcmpServiceCmHandle> queryCmHandles(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
+ Collection<String> queryCmHandleIds(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
/**
- * Query and return cm handles that match the given query parameters.
+ * Query and return cm handle ids that match the given query parameters.
+ * Supported query types:
+ * public properties
+ * private (additional) properties
+ * dmi-names
+ * The inventory interface also allows conditions on private (additional) properties and dmi names
*
* @param cmHandleQueryServiceParameters the cm handle query parameters
* @return collection of cm handle ids
*/
- Collection<String> queryCmHandleIds(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
+ Collection<String> queryCmHandleIdsForInventory(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
/**
- * Query and return cm handles that match the given query parameters.
+ * Query and return cm handle objects that match the given query parameters.
+ * Supported query types:
+ * public properties
+ * modules
+ * cps-path
*
* @param cmHandleQueryServiceParameters the cm handle query parameters
- * @return collection of cm handle ids
+ * @return collection of cm handles
*/
- Collection<String> queryCmHandleIdsForInventory(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
+ Collection<NcmpServiceCmHandle> queryCmHandles(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java
index 8acaa0abe..e2330a713 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java
@@ -69,7 +69,7 @@ public class ModuleSyncWatchdog {
while (!moduleSyncWorkQueue.isEmpty()) {
if (batchCounter.get() <= asyncTaskParallelismLevel) {
final Collection<DataNode> nextBatch = prepareNextBatch();
- log.debug("Processing module sync batch of {}. {} batch(es) active.",
+ log.info("Processing module sync batch of {}. {} batch(es) active.",
nextBatch.size(), batchCounter.get());
asyncTaskExecutor.executeTask(() ->
moduleSyncTasks.performModuleSync(nextBatch, batchCounter),
@@ -118,15 +118,16 @@ public class ModuleSyncWatchdog {
final Collection<DataNode> nextBatchCandidates = new HashSet<>(MODULE_SYNC_BATCH_SIZE);
final Collection<DataNode> nextBatch = new HashSet<>(MODULE_SYNC_BATCH_SIZE);
moduleSyncWorkQueue.drainTo(nextBatchCandidates, MODULE_SYNC_BATCH_SIZE);
- log.debug("nextBatchCandidates size : {}", nextBatchCandidates.size());
+ log.info("nextBatchCandidates size : {}", nextBatchCandidates.size());
for (final DataNode batchCandidate : nextBatchCandidates) {
final String cmHandleId = String.valueOf(batchCandidate.getLeaves().get("id"));
final boolean alreadyAddedToInProgressMap = VALUE_FOR_HAZELCAST_IN_PROGRESS_MAP.equals(
moduleSyncStartedOnCmHandles.putIfAbsent(cmHandleId, VALUE_FOR_HAZELCAST_IN_PROGRESS_MAP,
SynchronizationCacheConfig.MODULE_SYNC_STARTED_TTL_SECS, TimeUnit.SECONDS));
if (alreadyAddedToInProgressMap) {
- log.debug("module sync for {} already in progress by other instance", cmHandleId);
+ log.info("module sync for {} already in progress by other instance", cmHandleId);
} else {
+ log.info("Adding cmHandle : {} to current batch", cmHandleId);
nextBatch.add(batchCandidate);
}
}
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java
index 705c9d266..231ba75b5 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java
@@ -24,7 +24,6 @@ import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.time.OffsetDateTime;
import java.util.Map;
-import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.api.CpsAdminService;
@@ -45,6 +44,8 @@ public class SubscriptionModelLoader implements ModelLoader {
private final CpsAdminService cpsAdminService;
private final CpsModuleService cpsModuleService;
private final CpsDataService cpsDataService;
+ private static final String SUBSCRIPTION_MODEL_FILENAME = "subscription.yang";
+ private static final String SUBSCRIPTION_MODEL_RESOURCE_PATH = "model/" + SUBSCRIPTION_MODEL_FILENAME;
private static final String SUBSCRIPTION_DATASPACE_NAME = "NCMP-Admin";
private static final String SUBSCRIPTION_ANCHOR_NAME = "AVC-Subscriptions";
private static final String SUBSCRIPTION_SCHEMASET_NAME = "subscriptions";
@@ -59,10 +60,10 @@ public class SubscriptionModelLoader implements ModelLoader {
* @param applicationReadyEvent the event to respond to
*/
@Override
- public void onApplicationEvent(@NonNull final ApplicationReadyEvent applicationReadyEvent) {
+ public void onApplicationEvent(final ApplicationReadyEvent applicationReadyEvent) {
try {
if (subscriptionModelLoaderEnabled) {
- onboardSubscriptionModel();
+ onboardSubscriptionModel(createYangResourceToContentMap());
} else {
log.info("Subscription Model Loader is disabled");
}
@@ -75,21 +76,18 @@ public class SubscriptionModelLoader implements ModelLoader {
/**
* Method to onboard subscription model for NCMP.
*/
- private void onboardSubscriptionModel() {
- final Map<String, String> yangResourceContentMap = createYangResourceToContentMap();
- if (!yangResourceContentMap.get("subscription.yang").isEmpty()) {
- createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, yangResourceContentMap);
- createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME);
- createTopLevelDataNode(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_ANCHOR_NAME,
- SUBSCRIPTION_REGISTRY_DATANODE_NAME);
- }
+ private void onboardSubscriptionModel(final Map<String, String> yangResourceContentMap) {
+ createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, yangResourceContentMap);
+ createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME);
+ createTopLevelDataNode(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_ANCHOR_NAME,
+ SUBSCRIPTION_REGISTRY_DATANODE_NAME);
}
@Override
public boolean createSchemaSet(final String dataspaceName,
- final String schemaSetName,
- final Map<String, String> yangResourceContentMap) {
+ final String schemaSetName,
+ final Map<String, String> yangResourceContentMap) {
try {
cpsModuleService.createSchemaSet(dataspaceName, schemaSetName, yangResourceContentMap);
} catch (final AlreadyDefinedException exception) {
@@ -129,24 +127,24 @@ public class SubscriptionModelLoader implements ModelLoader {
try {
cpsDataService.saveData(dataspaceName, anchorName, nodeData, OffsetDateTime.now());
} catch (final AlreadyDefinedException exception) {
- log.info("Creating new data node {} failed as data node already exists", dataNodeName);
+ log.info("Creating new data node '{}' failed as data node already exists", dataNodeName);
} catch (final Exception exception) {
log.debug("Creating data node for subscription model failed: {}", exception.getMessage());
throw new NcmpStartUpException("Creating data node failed", exception.getMessage());
}
}
- private String getFileContentAsString() {
- try (InputStream inputStream = getClass().getClassLoader()
- .getResourceAsStream("model/subscription.yang")) {
+ private String getFileContentAsString(final String fileName) {
+ try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(fileName)) {
return new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
} catch (final Exception exception) {
- log.debug("Onboarding failed as unable to read file: {}", exception.getCause().toString());
- throw new NcmpStartUpException("Onboarding failed as unable to read file: {}", exception.getMessage());
+ final String message = String.format("Onboarding failed as unable to read file: %s", fileName);
+ log.debug(message);
+ throw new NcmpStartUpException(message, exception.getMessage());
}
}
private Map<String, String> createYangResourceToContentMap() {
- return Map.of("subscription.yang", getFileContentAsString());
+ return Map.of(SUBSCRIPTION_MODEL_FILENAME, getFileContentAsString(SUBSCRIPTION_MODEL_RESOURCE_PATH));
}
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
index 907208228..aa8bc53c9 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
@@ -35,6 +35,7 @@ import org.onap.cps.spi.exceptions.SchemaSetNotFoundException
import org.springframework.boot.SpringApplication
import org.slf4j.LoggerFactory
import org.springframework.boot.context.event.ApplicationReadyEvent
+import org.springframework.context.annotation.AnnotationConfigApplicationContext
import spock.lang.Specification
class SubscriptionModelLoaderSpec extends Specification {
@@ -44,30 +45,31 @@ class SubscriptionModelLoaderSpec extends Specification {
def mockCpsDataService = Mock(CpsDataService)
def objectUnderTest = new SubscriptionModelLoader(mockCpsAdminService, mockCpsModuleService, mockCpsDataService)
- def SUBSCRIPTION_DATASPACE_NAME = objectUnderTest.SUBSCRIPTION_DATASPACE_NAME;
- def SUBSCRIPTION_ANCHOR_NAME = objectUnderTest.SUBSCRIPTION_ANCHOR_NAME;
- def SUBSCRIPTION_SCHEMASET_NAME = objectUnderTest.SUBSCRIPTION_SCHEMASET_NAME;
- def SUBSCRIPTION_REGISTRY_DATANODE_NAME = objectUnderTest.SUBSCRIPTION_REGISTRY_DATANODE_NAME;
-
def sampleYangContentMap = ['subscription.yang':'module subscription { *sample content* }']
- def applicationReadyEvent = new ApplicationReadyEvent(new SpringApplication(), null, null, null)
+ def applicationContext = new AnnotationConfigApplicationContext()
+
+ def applicationReadyEvent = new ApplicationReadyEvent(new SpringApplication(), null, applicationContext, null)
+ def yangResourceToContentMap
def logger
def appender
@BeforeEach
void setup() {
+ yangResourceToContentMap = objectUnderTest.createYangResourceToContentMap()
logger = (Logger) LoggerFactory.getLogger(objectUnderTest.getClass())
appender = new ListAppender()
logger.setLevel(Level.DEBUG)
appender.start()
logger.addAppender(appender)
+ applicationContext.refresh()
}
@AfterEach
void teardown() {
- ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders();
+ ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders()
+ applicationContext.close()
}
def 'Onboard subscription model successfully via application ready event'() {
@@ -76,16 +78,40 @@ class SubscriptionModelLoaderSpec extends Specification {
and: 'the application is ready'
objectUnderTest.onApplicationEvent(applicationReadyEvent)
then: 'the module service to create schema set is called once'
- 1 * mockCpsModuleService.createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME,sampleYangContentMap)
+ 1 * mockCpsModuleService.createSchemaSet('NCMP-Admin', 'subscriptions',sampleYangContentMap)
and: 'the admin service to create an anchor set is called once'
- 1 * mockCpsAdminService.createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME)
+ 1 * mockCpsAdminService.createAnchor('NCMP-Admin', 'subscriptions', 'AVC-Subscriptions')
and: 'the data service to create a top level datanode is called once'
- 1 * mockCpsDataService.saveData(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_ANCHOR_NAME, '{"' + SUBSCRIPTION_REGISTRY_DATANODE_NAME + '":{}}', _)
+ 1 * mockCpsDataService.saveData('NCMP-Admin', 'AVC-Subscriptions', '{"subscription-registry":{}}', _)
+ }
+
+ def 'No subscription model onboarding when subscription model loader is disabled' () {
+ when: 'model loader is disabled'
+ objectUnderTest.subscriptionModelLoaderEnabled = false
+ and: 'application is ready'
+ objectUnderTest.onApplicationEvent(applicationReadyEvent)
+ then: 'the module service to create schema set was not called'
+ 0 * mockCpsModuleService.createSchemaSet(*_)
+ and: 'the admin service to create an anchor set was not called'
+ 0 * mockCpsAdminService.createAnchor(*_)
+ and: 'the data service to create a top level datanode was not called'
+ 0 * mockCpsDataService.saveData(*_)
+ }
+
+ def 'Exception occurred while schema set creation' () {
+ given: 'creating a schema set throws an exception'
+ mockCpsModuleService.createSchemaSet(*_) >> { throw new DataValidationException(*_) }
+ and: 'model loader is enabled'
+ objectUnderTest.subscriptionModelLoaderEnabled = true
+ when: 'application is ready'
+ objectUnderTest.onApplicationEvent(applicationReadyEvent)
+ then: 'the admin service to create an anchor set was not called'
+ 0 * mockCpsAdminService.createAnchor(*_)
+ and: 'the data service to create a top level datanode was not called'
+ 0 * mockCpsDataService.saveData(*_)
}
def 'Create schema set from model file'() {
- given: 'the method to create yang resource to content map returns the correct map'
- def yangResourceToContentMap = objectUnderTest.createYangResourceToContentMap()
when: 'the method to create schema set is called with the following parameters'
objectUnderTest.createSchemaSet("myDataspace", "mySchemaSet", yangResourceToContentMap)
then: 'yang resource to content map is as expected'
@@ -95,25 +121,20 @@ class SubscriptionModelLoaderSpec extends Specification {
}
def 'Create schema set fails due to AlreadyDefined exception'() {
- given: 'the method to create yang resource to content map returns the correct map'
- def yangResourceToContentMap = objectUnderTest.createYangResourceToContentMap()
- and: 'creating a schema set throws an exception as it already exists'
- mockCpsModuleService.createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, yangResourceToContentMap) >>
- { throw AlreadyDefinedException.forSchemaSet(SUBSCRIPTION_SCHEMASET_NAME, "sampleContextName", null) }
+ given: 'creating a schema set throws an exception as it already exists'
+ mockCpsModuleService.createSchemaSet('NCMP-Admin', 'subscriptions', yangResourceToContentMap) >>
+ { throw AlreadyDefinedException.forSchemaSet('subscriptions', "sampleContextName", null) }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'the admin service to create an anchor set is then called once'
- 1 * mockCpsAdminService.createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME)
+ 1 * mockCpsAdminService.createAnchor('NCMP-Admin', 'subscriptions', 'AVC-Subscriptions')
}
def 'Create schema set fails due to any other exception'() {
- given: 'the method to create yang resource to content map returns the correct map'
- def yangResourceToContentMap = objectUnderTest.createYangResourceToContentMap()
- and: 'creating a schema set throws an exception'
- mockCpsModuleService.createSchemaSet(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, yangResourceToContentMap) >>
- { throw new NcmpStartUpException("Creating schema set failed", ""); }
+ given: 'creating a schema set throws an exception'
+ mockCpsModuleService.createSchemaSet(*_) >> { throw new NcmpStartUpException("Creating schema set failed", "") }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'the log message contains the correct exception message'
def debugMessage = appender.list[0].toString()
assert debugMessage.contains("Creating schema set failed")
@@ -123,20 +144,23 @@ class SubscriptionModelLoaderSpec extends Specification {
def 'Create anchor fails due to AlreadyDefined exception'() {
given: 'creating anchor throws an exception as it already exists'
- mockCpsAdminService.createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME) >>
- { throw AlreadyDefinedException.forSchemaSet(SUBSCRIPTION_SCHEMASET_NAME, "sampleContextName", null) }
+ mockCpsAdminService.createAnchor(*_) >>
+ { throw AlreadyDefinedException.forSchemaSet('subscriptions', "sampleContextName", null) }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'no exception thrown'
noExceptionThrown()
+ and: 'the log message contains the correct exception message'
+ def infoMessage = appender.list[0].toString()
+ assert infoMessage.contains("already exists")
}
def 'Create anchor fails due to any other exception'() {
given: 'creating an anchor failed'
- mockCpsAdminService.createAnchor(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME, SUBSCRIPTION_ANCHOR_NAME) >>
- { throw new SchemaSetNotFoundException(SUBSCRIPTION_DATASPACE_NAME, SUBSCRIPTION_SCHEMASET_NAME) }
+ mockCpsAdminService.createAnchor(*_) >>
+ { throw new SchemaSetNotFoundException('NCMP-Admin', 'subscriptions') }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'the log message contains the correct exception message'
def debugMessage = appender.list[0].toString()
assert debugMessage.contains("Schema Set not found")
@@ -147,11 +171,14 @@ class SubscriptionModelLoaderSpec extends Specification {
def 'Create top level node fails due to an AlreadyDefined exception'() {
given: 'the saving of the node data will throw an Already Defined exception'
mockCpsDataService.saveData(*_) >>
- { AlreadyDefinedException.forDataNode('/xpath', "sampleContextName", null) }
+ { throw AlreadyDefinedException.forDataNode('/xpath', "sampleContextName", null) }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'no exception thrown'
noExceptionThrown()
+ and: 'the log message contains the correct exception message'
+ def infoMessage = appender.list[0].toString()
+ assert infoMessage.contains("already exists")
}
def 'Create top level node fails due to any other exception'() {
@@ -159,7 +186,7 @@ class SubscriptionModelLoaderSpec extends Specification {
mockCpsDataService.saveData(*_) >>
{ throw new DataValidationException("Invalid JSON", "JSON Data is invalid") }
when: 'the method to onboard model is called'
- objectUnderTest.onboardSubscriptionModel()
+ objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'the log message contains the correct exception message'
def debugMessage = appender.list[0].toString()
assert debugMessage.contains("Creating data node for subscription model failed: Invalid JSON")
@@ -169,8 +196,8 @@ class SubscriptionModelLoaderSpec extends Specification {
def 'Get file content as string'() {
when: 'the method to get yang content is called'
- def response = objectUnderTest.getFileContentAsString()
- then: 'the response is as expected'
- assert response == 'module subscription { *sample content* }'
+ objectUnderTest.getFileContentAsString('NonExistingFile')
+ then: 'exception is thrown'
+ thrown(NcmpStartUpException)
}
-} \ No newline at end of file
+}
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index e333b26c2..193a04e7d 100755
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
diff --git a/cps-path-parser/pom.xml b/cps-path-parser/pom.xml
index 29a60666a..0784ccbbf 100644
--- a/cps-path-parser/pom.xml
+++ b/cps-path-parser/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml
index fd55d6def..c27e515b7 100755
--- a/cps-rest/pom.xml
+++ b/cps-rest/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml
index f17bf1809..ba743f28b 100644
--- a/cps-ri/pom.xml
+++ b/cps-ri/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServiceDeletePerfTest.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServiceDeletePerfTest.groovy
index 42698a65d..428088135 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServiceDeletePerfTest.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServiceDeletePerfTest.groovy
@@ -41,22 +41,22 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
recordAndAssertPerformance('Setup', 10_000, setupDurationInMillis)
}
- def 'Delete 5 children with grandchildren'() {
+ def 'Delete 10 children with grandchildren'() {
when: 'child nodes are deleted'
stopWatch.start()
- (1..5).each {
+ (1..10).each {
def childPath = "${PERF_TEST_PARENT}/perf-test-child-${it}".toString()
objectUnderTest.deleteDataNode(PERF_DATASPACE, PERF_ANCHOR, childPath)
}
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 150 milliseconds'
- recordAndAssertPerformance('Delete 5 children', 150, deleteDurationInMillis)
+ then: 'delete duration is under 300 milliseconds'
+ recordAndAssertPerformance('Delete 10 children', 300, deleteDurationInMillis)
}
def 'Batch delete 100 children with grandchildren'() {
given: 'a list of xpaths to delete'
- def xpathsToDelete = (6..105).collect {
+ def xpathsToDelete = (11..110).collect {
"${PERF_TEST_PARENT}/perf-test-child-${it}".toString()
}
when: 'child nodes are deleted'
@@ -64,21 +64,21 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
objectUnderTest.deleteDataNodes(PERF_DATASPACE, PERF_ANCHOR, xpathsToDelete)
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 250 milliseconds'
- recordAndAssertPerformance('Batch delete 100 children', 250, deleteDurationInMillis)
+ then: 'delete duration is under 300 milliseconds'
+ recordAndAssertPerformance('Batch delete 100 children', 300, deleteDurationInMillis)
}
def 'Delete 50 grandchildren (that have no descendants)'() {
when: 'target nodes are deleted'
stopWatch.start()
(1..50).each {
- def grandchildPath = "${PERF_TEST_PARENT}/perf-test-child-106/perf-test-grand-child-${it}".toString()
+ def grandchildPath = "${PERF_TEST_PARENT}/perf-test-child-111/perf-test-grand-child-${it}".toString()
objectUnderTest.deleteDataNode(PERF_DATASPACE, PERF_ANCHOR, grandchildPath)
}
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 600 milliseconds'
- recordAndAssertPerformance('Delete 50 grandchildren', 600, deleteDurationInMillis)
+ then: 'delete duration is under 700 milliseconds'
+ recordAndAssertPerformance('Delete 50 grandchildren', 700, deleteDurationInMillis)
}
def 'Batch delete 500 grandchildren (that have no descendants)'() {
@@ -86,7 +86,7 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
def xpathsToDelete = []
for (int childIndex = 0; childIndex < 10; childIndex++) {
xpathsToDelete.addAll((1..50).collect {
- "${PERF_TEST_PARENT}/perf-test-child-${107+childIndex}/perf-test-grand-child-${it}".toString()
+ "${PERF_TEST_PARENT}/perf-test-child-${112+childIndex}/perf-test-grand-child-${it}".toString()
})
}
when: 'target nodes are deleted'
@@ -109,22 +109,22 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
recordAndAssertPerformance('Setup lists', 6_000, setupDurationInMillis)
}
- def 'Delete 5 whole lists'() {
+ def 'Delete 10 whole lists'() {
when: 'lists are deleted'
stopWatch.start()
- (1..5).each {
+ (1..10).each {
def childPath = "${PERF_TEST_PARENT}/perf-test-list-${it}".toString()
objectUnderTest.deleteListDataNode(PERF_DATASPACE, PERF_ANCHOR, childPath)
}
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 130 milliseconds'
- recordAndAssertPerformance('Delete 5 whole lists', 130, deleteDurationInMillis)
+ then: 'delete duration is under 300 milliseconds'
+ recordAndAssertPerformance('Delete 10 whole lists', 300, deleteDurationInMillis)
}
def 'Batch delete 100 whole lists'() {
given: 'a list of xpaths to delete'
- def xpathsToDelete = (6..105).collect {
+ def xpathsToDelete = (11..110).collect {
"${PERF_TEST_PARENT}/perf-test-list-${it}".toString()
}
when: 'lists are deleted'
@@ -140,13 +140,13 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
when: 'list elements are deleted'
stopWatch.start()
(1..10).each {
- def grandchildPath = "${PERF_TEST_PARENT}/perf-test-list-106[@key='${it}']".toString()
+ def grandchildPath = "${PERF_TEST_PARENT}/perf-test-list-111[@key='${it}']".toString()
objectUnderTest.deleteListDataNode(PERF_DATASPACE, PERF_ANCHOR, grandchildPath)
}
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 180 milliseconds'
- recordAndAssertPerformance('Delete 10 lists elements', 180, deleteDurationInMillis)
+ then: 'delete duration is under 200 milliseconds'
+ recordAndAssertPerformance('Delete 10 lists elements', 200, deleteDurationInMillis)
}
def 'Batch delete 500 list elements'() {
@@ -154,7 +154,7 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
def xpathsToDelete = []
for (int childIndex = 0; childIndex < 10; childIndex++) {
xpathsToDelete.addAll((1..50).collect {
- "${PERF_TEST_PARENT}/perf-test-list-${107+childIndex}[@key='${it}']".toString()
+ "${PERF_TEST_PARENT}/perf-test-list-${112+childIndex}[@key='${it}']".toString()
})
}
when: 'list elements are deleted'
@@ -162,8 +162,8 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
objectUnderTest.deleteDataNodes(PERF_DATASPACE, PERF_ANCHOR, xpathsToDelete)
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 70 milliseconds'
- recordAndAssertPerformance('Batch delete 500 lists elements', 70, deleteDurationInMillis)
+ then: 'delete duration is under 100 milliseconds'
+ recordAndAssertPerformance('Batch delete 500 lists elements', 100, deleteDurationInMillis)
}
@Sql([CLEAR_DATA, PERF_TEST_DATA])
@@ -176,8 +176,8 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
objectUnderTest.deleteDataNode(PERF_DATASPACE, PERF_ANCHOR, PERF_TEST_PARENT)
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 220 milliseconds'
- recordAndAssertPerformance('Delete one large node', 220, deleteDurationInMillis)
+ then: 'delete duration is under 300 milliseconds'
+ recordAndAssertPerformance('Delete one large node', 300, deleteDurationInMillis)
}
@Sql([CLEAR_DATA, PERF_TEST_DATA])
@@ -190,8 +190,8 @@ class CpsDataPersistenceServiceDeletePerfTest extends CpsPersistencePerfSpecBase
objectUnderTest.deleteDataNodes(PERF_DATASPACE, PERF_ANCHOR, [PERF_TEST_PARENT])
stopWatch.stop()
def deleteDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'delete duration is under 220 milliseconds'
- recordAndAssertPerformance('Batch delete one large node', 220, deleteDurationInMillis)
+ then: 'delete duration is under 300 milliseconds'
+ recordAndAssertPerformance('Batch delete one large node', 300, deleteDurationInMillis)
}
@Sql([CLEAR_DATA, PERF_TEST_DATA])
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
index 98ff211a6..7f1fb20f7 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
@@ -131,8 +131,8 @@ class CpsDataPersistenceServicePerfTest extends CpsPersistencePerfSpecBase {
objectUnderTest.updateDataNodesAndDescendants(PERF_DATASPACE, PERF_ANCHOR, dataNodes)
stopWatch.stop()
def updateDurationInMillis = stopWatch.getTotalTimeMillis()
- then: 'update duration is under 500 milliseconds'
- recordAndAssertPerformance('Update data nodes with descendants', 500, updateDurationInMillis)
+ then: 'update duration is under 600 milliseconds'
+ recordAndAssertPerformance('Update data nodes with descendants', 600, updateDurationInMillis)
}
def 'Update data nodes without descendants'() {
diff --git a/cps-service/pom.xml b/cps-service/pom.xml
index a4f683049..86fef3643 100644
--- a/cps-service/pom.xml
+++ b/cps-service/pom.xml
@@ -29,7 +29,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/docs/conf.yaml b/docs/conf.yaml
deleted file mode 100644
index 8425e089e..000000000
--- a/docs/conf.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation
-# ================================================================================
-# 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
----
-project_cfg: onap
-project: onap
-
-# Change this to ReleaseBranchName to modify the header
-default-version: latest
-#
diff --git a/docs/design.rst b/docs/design.rst
index 738175937..c6413c294 100755
--- a/docs/design.rst
+++ b/docs/design.rst
@@ -77,3 +77,9 @@ NCMP CM Handle Querying
The CM Handle searches endpoints can be used to query for CM Handles or CM Handle IDs.
This endpoint is described in detail in :doc:`ncmp-cmhandle-querying`.
+
+NCMP Inventory CM Handle Querying
+=================================
+
+The CM Handle searches ncmp inventory endpoints can be used to query for CM Handles or CM Handle IDs.
+This endpoint is described in detail in :doc:`ncmp-inventory-querying`.
diff --git a/docs/modeling.rst b/docs/modeling.rst
index aa5bbc98c..95fa9dded 100644
--- a/docs/modeling.rst
+++ b/docs/modeling.rst
@@ -128,4 +128,5 @@ Querying CM Handles
:maxdepth: 1
ncmp-cmhandle-querying.rst
+ ncmp-inventory-querying.rst
cps-scheduled-processes.rst
diff --git a/docs/ncmp-inventory-querying.rst b/docs/ncmp-inventory-querying.rst
new file mode 100644
index 000000000..349b98496
--- /dev/null
+++ b/docs/ncmp-inventory-querying.rst
@@ -0,0 +1,158 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2023 Nordix Foundation
+
+.. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
+.. _inventoryquerying:
+
+
+Inventory Query Endpoints
+#########################
+
+.. toctree::
+ :maxdepth: 1
+
+Introduction
+============
+
+For querying the NCMP Inventory we have one Post endpoint:
+
+- ncmpInventory/v1/ch/searches Returns all CM Handles which match the query properties provided. Gives a JSON payload of the **details** of all matching CM Handles.
+
+If no matching CM Handles are found an empty array is returned.
+
+Request Body
+============
+
+Currently this endpoint allows three criteria to be query on:
+
+- *hasAllProperties* returns CM Handles which have the public properties provided.
+
+- *hasAllAdditionalProperties* returns CM Handles which have the private or additional properties (key and value) provided.
+
+- *cmHandleWithDmiPlugin* returns CM Handles which match the CPS Dmi Plugin provided.
+
+Not all request body combinations have been validated and as such request bodies which do not conform to the structure as documented here can produce results in which all CM Handles are returned.
+
+Casing conventions: 'camelCasing' and 'kebab-casing'
+----------------------------------------------------
+
+.. note::
+ By convention REST JSON return bodies use 'camelCasing'. By convention field names in yang modelled data use 'kebab-casing'. Therefore some inconsistencies can be seen in the JSON use in CPS REST interfaces. For CM Handle related endpoints we return data in 'camelCasing'. But for *cmHandleWithCpsPath*, the query is accessing yang modelled field names and as such needs to use 'kebab-casing'. Therefore the dmi-registry field names should be referenced when using the *cmHandleWithCpsPath* condition: :doc:`modeling`
+
+Request Body example using all available query criteria. This query would return all CM Handles which have the specified public properties of Color yellow, Shape circle, Size small, have the specified private/additional properties of Price 5, Year 2022 and Quantity 12 and have related to DMI plugin dmiPlugin1:
+
+.. code-block:: json
+
+ {
+ "cmHandleQueryParameters": [
+ {
+ "conditionName": "hasAllProperties",
+ "conditionParameters": [
+ {
+ "Color": "yellow"
+ },
+ {
+ "Shape": "circle"
+ },
+ {
+ "Size": "small"
+ }
+ ]
+ },
+ {
+ "conditionName": "hasAllAdditionalProperties",
+ "conditionParameters": [
+ {
+ "Price": "5"
+ },
+ {
+ "Year": "2022"
+ },
+ {
+ "Quantity": "12"
+ }
+ ]
+ },
+ {
+ "conditionName": "cmHandleWithDmiPlugin",
+ "conditionParameters": [
+ {
+ "dmiPluginName": "dmiPlugin1"
+ }
+ ]
+ }
+ ]
+ }
+
+Has all Properties
+------------------
+
+With the *hasAllProperties* condition, we can provide a list of property keys and values. The CM Handles returned will have these public properties. The parameter names must be as below with key and value for each property. The returned CM Handle must have all supplied properties. For the example request, a CM Handle will be returned if it has properties where there is a key of "Color" with value "yellow", a key of "Shape" with value "circle" and a key of "Size" with value "small".
+
+.. code-block:: json
+
+ {
+ "cmHandleQueryParameters": [
+ {
+ "conditionName": "hasAllProperties",
+ "conditionParameters": [
+ {
+ "Color": "yellow"
+ },
+ {
+ "Shape": "circle"
+ },
+ {
+ "Size": "small"
+ }
+ ]
+ }
+ ]
+ }
+
+Has all additional Properties
+-----------------------------
+
+With the *hasAllAdditionalProperties* condition, we can provide a list of property keys and values. The CM Handles returned will have these additional properties. The parameter names must be as below with key and value for each property. The returned CM Handle must have all supplied properties. For the example request, a CM Handle will be returned if it has properties where there is a key of "Price" with value "5", a key of "Year" with value "2022" and a key of "Quantity" with value "12".
+
+.. code-block:: json
+
+ {
+ "cmHandleQueryParameters": [
+ {
+ "conditionName": "hasAllAdditionalProperties",
+ "conditionParameters": [
+ {
+ "Price": "5"
+ },
+ {
+ "Year": "2022"
+ },
+ {
+ "Quantity": "12"
+ }
+ ]
+ }
+ ]
+ }
+
+Has all DMI Plugins
+-------------------
+
+With the *cmHandleWithDmiPlugin* condition, we can provide a dmiPluginName. The CM Handles returned will have this DMI Plugin Name value in at least one of the following related leaves: dmi-service-name, dmi-data-service-name and dmi-model-service-name. For the example request a CM Handle will be returned if it has my-dmi-plugin as a value in at least one of the aforementioned leaves.
+
+.. code-block:: json
+
+ {
+ "cmHandleQueryParameters": [
+ {
+ "conditionName": "cmHandleWithDmiPlugin",
+ "conditionParameters": [
+ {
+ "dmi-service-name": "my-dmi-plugin"
+ }
+ ]
+ }
+ ]
+ }
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index 571300e02..715886092 100755
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -16,6 +16,35 @@ CPS Release Notes
.. * * * LONDON * * *
.. ======================
+Version: 3.2.7
+==============
+
+Release Data
+------------
+
++--------------------------------------+--------------------------------------------------------+
+| **CPS Project** | |
+| | |
++--------------------------------------+--------------------------------------------------------+
+| **Docker images** | onap/cps-and-ncmp:3.2.7 |
+| | |
++--------------------------------------+--------------------------------------------------------+
+| **Release designation** | 3.2.7 London |
+| | |
++--------------------------------------+--------------------------------------------------------+
+| **Release date** | Not been released yet |
+| | |
++--------------------------------------+--------------------------------------------------------+
+
+Bug Fixes
+---------
+3.2.7
+ - None
+
+Features
+--------
+ - None
+
Version: 3.2.6
==============
@@ -32,19 +61,19 @@ Release Data
| **Release designation** | 3.2.6 London |
| | |
+--------------------------------------+--------------------------------------------------------+
-| **Release date** | 2023 March 10 |
+| **Release date** | 2023 March 22 |
| | |
+--------------------------------------+--------------------------------------------------------+
Bug Fixes
---------
3.2.6
- - `CPS-1396 <https://jira.onap.org/browse/CPS-1396>`_ Query data nodes across all anchors under one dataspace
- `CPS-1526 <https://jira.onap.org/browse/CPS-1526>`_ Fix response message for PATCH operation
+ - `CPS-1563 <https://jira.onap.org/browse/CPS-1563>`_ Fix 500 response error on id-searches with empty parameters
Features
--------
- - None
+ - `CPS-1396 <https://jira.onap.org/browse/CPS-1396>`_ Query data nodes across all anchors under one dataspace
Version: 3.2.5
==============
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index 42946da23..1d37fc1b0 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
index 25cd70431..4afdabe92 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
@@ -64,7 +64,7 @@ abstract class PerfTestBase extends CpsIntegrationSpecBase {
def record = String.format('%2d.%-40s limit%,7d took %,7d ms ', PERFORMANCE_RECORD.size() + 1, shortTitle, thresholdInMs, recordedTimeInMs)
record += pass ? 'PASS' : 'FAIL'
PERFORMANCE_RECORD.add(record)
- assert recordedTimeInMs != thresholdInMs
+ assert recordedTimeInMs <= thresholdInMs
return true
}
}
diff --git a/jacoco-report/pom.xml b/jacoco-report/pom.xml
index d2851b52c..ddaf14b15 100644
--- a/jacoco-report/pom.xml
+++ b/jacoco-report/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 81c70d66f..099769870 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.onap.cps</groupId>
<artifactId>cps-aggregator</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>cps</name>
diff --git a/releases/3.2.6-container.yaml b/releases/3.2.6-container.yaml
new file mode 100644
index 000000000..e980ad0e3
--- /dev/null
+++ b/releases/3.2.6-container.yaml
@@ -0,0 +1,8 @@
+distribution_type: container
+container_release_tag: 3.2.6
+project: cps
+log_dir: cps-maven-docker-stage-master/893/
+ref: f5a3a2177ee328ac842883a89c75169c9a651f53
+containers:
+ - name: 'cps-and-ncmp'
+ version: '3.2.6-20230323T104142Z'
diff --git a/releases/3.2.6.yaml b/releases/3.2.6.yaml
new file mode 100644
index 000000000..c9f212092
--- /dev/null
+++ b/releases/3.2.6.yaml
@@ -0,0 +1,4 @@
+distribution_type: maven
+log_dir: cps-maven-stage-master/899/
+project: cps
+version: 3.2.6 \ No newline at end of file
diff --git a/spotbugs/pom.xml b/spotbugs/pom.xml
index 4e3dee3c5..e2d57747a 100644
--- a/spotbugs/pom.xml
+++ b/spotbugs/pom.xml
@@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.cps</groupId>
<artifactId>spotbugs</artifactId>
- <version>3.2.6-SNAPSHOT</version>
+ <version>3.2.7-SNAPSHOT</version>
<properties>
<nexusproxy>https://nexus.onap.org</nexusproxy>
diff --git a/test-tools/.gitignore b/test-tools/.gitignore
new file mode 100644
index 000000000..28b8c3477
--- /dev/null
+++ b/test-tools/.gitignore
@@ -0,0 +1 @@
+/metrics-reports/
diff --git a/test-tools/test-deregistration.sh b/test-tools/test-deregistration.sh
index bf38e3b24..d0cbbf1d2 100755
--- a/test-tools/test-deregistration.sh
+++ b/test-tools/test-deregistration.sh
@@ -70,15 +70,14 @@ remove_handles_and_record_time() {
--location 'http://localhost:8883/ncmpInventory/v1/ch' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
--header 'Content-Type: application/json' \
- --header 'Cookie: JSESSIONID=node018g80wfn6qfk9yihx8pne7bc31.node0' \
--data @$REMOVE_REQUEST >> $REPORT_FILE
}
create_request_bodies() {
local CREATE_SIZE=$1
local REMOVE_SIZE=$2
- echo -n '{"dmiPlugin": "http://ncmp-dmi-plugin-stub:8783","createdCmHandles":[' > $CREATE_REQUEST
- echo -n '{"dmiPlugin": "http://ncmp-dmi-plugin-stub:8783","removedCmHandles":[' > $REMOVE_REQUEST
+ echo -n '{"dmiPlugin": "http://ncmp-dmi-plugin-stub:8080","createdCmHandles":[' > $CREATE_REQUEST
+ echo -n '{"dmiPlugin": "http://ncmp-dmi-plugin-stub:8080","removedCmHandles":[' > $REMOVE_REQUEST
for i in $(seq 1 $CREATE_SIZE); do
local CMHANDLE=$(uuidgen | tr -d '-')
echo -n "{\"cmHandle\": \"$CMHANDLE\",\"cmHandleProperties\":{\"neType\":\"RadioNode\"}}" \
@@ -141,22 +140,16 @@ test_deregistration() {
cleanup() {
rm -f "$CREATE_REQUEST" "$REMOVE_REQUEST"
stop_docker
+ popd
}
trap cleanup EXIT
+pushd -- "$(dirname -- "${BASH_SOURCE[0]}")"
+
mkdir -p $(dirname $REPORT_FILE)
echo -e "Removed\tTotal\tTime" > $REPORT_FILE
-# Delete N/N: 100/100, 200/200... 20000/20000
-for number_to_delete in 100 200 300 400 500 600 700 800 900 1000 2000 3000 4000 5000 10000 15000 20000; do
+for number_to_delete in 100 500 1000 5000 10000 20000; do
test_deregistration $number_to_delete $number_to_delete
done
-# Delete N/C: 1000/5000, 2000/5000... 5000/5000
-for number_to_delete in 1000 2000 3000 4000 5000; do
- test_deregistration $number_to_delete 5000
-done
-# Delete C/N: 1000/1000, 1000/2000... 1000/5000
-for total in 1000 2000 3000 4000 5000; do
- test_deregistration 1000 $total
-done
diff --git a/version.properties b/version.properties
index 0dccb1c8b..169b25336 100755
--- a/version.properties
+++ b/version.properties
@@ -22,7 +22,7 @@
major=3
minor=2
-patch=6
+patch=7
base_version=${major}.${minor}.${patch}