summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
authorMnushkin, Dmitry <dmitry.mnushkin@att.com>2019-07-26 13:17:12 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-07-26 13:17:20 -0400
commit3b5f5ddb3cbc57227a2e416b38b4e20535ac9b4b (patch)
treec58a47f310a60dc3994efdb540b118b22301f25c /bpmn/MSOCommonBPMN/src/main
parentf5a69be34850dc102c02514a8126e79f00226fa6 (diff)
validate model info for existing service with
verify modelVersionId equals during SI AAI validation correct SI name in junit test update SI name in junit test comparison add name/module id verifications for other objects add back junit file after merge from remote format jnit file after verify job failure updated test input values for clarity update name verifications with related ID values adding junit for Configuration name verification updated aai verify call, service dup error msg removed aai depth 2 and refactored private test method implement SI name verification with 3 additional fields fix formatting comment line length limitation Issue-ID: SO-2161 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I43f5cb0601dfa8b41f474615b639fce0572f5613
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
index f8d5402260..dcb9e08d0b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
@@ -31,6 +31,7 @@ import java.util.Map;
import java.util.Optional;
import org.onap.aai.domain.yang.CloudRegion;
import org.onap.aai.domain.yang.Configuration;
+import org.onap.aai.domain.yang.Configurations;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.GenericVnfs;
import org.onap.aai.domain.yang.InstanceGroup;
@@ -50,6 +51,7 @@ import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFou
import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
@@ -575,4 +577,53 @@ public class BBInputSetupUtils {
}
return Optional.empty();
}
+
+ public ServiceInstances getAAIServiceInstancesGloballyByName(String serviceInstanceName) {
+
+ return injectionHelper.getAaiClient()
+ .get(ServiceInstances.class, AAIUriFactory.createNodesUri(AAIObjectPlurals.SERVICE_INSTANCE)
+ .queryParam("service-instance-name", serviceInstanceName))
+ .orElseGet(() -> {
+ logger.debug("No Service Instance matched by name");
+ return null;
+ });
+ }
+
+ public boolean existsAAINetworksGloballyByName(String networkName) {
+
+ AAIResourceUri l3networkUri =
+ AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
+ AAIResourcesClient aaiRC = injectionHelper.getAaiClient();
+ return aaiRC.exists(l3networkUri);
+ }
+
+ public GenericVnfs getAAIVnfsGloballyByName(String vnfName) {
+
+ return injectionHelper.getAaiClient()
+ .get(GenericVnfs.class,
+ AAIUriFactory.createNodesUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName))
+ .orElseGet(() -> {
+ logger.debug("No GenericVnfs matched by name");
+ return null;
+ });
+ }
+
+ public Optional<Configuration> getRelatedConfigurationByNameFromServiceInstance(String serviceInstanceId,
+ String configurationName) throws Exception {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
+ uri.relatedTo(AAIObjectPlurals.CONFIGURATION).queryParam("configuration-name", configurationName);
+ Optional<Configurations> configurations = injectionHelper.getAaiClient().get(Configurations.class, uri);
+ Configuration configuration = null;
+ if (!configurations.isPresent()) {
+ logger.debug("No Configurations matched by name");
+ return Optional.empty();
+ } else {
+ if (configurations.get().getConfiguration().size() > 1) {
+ throw new Exception("Multiple Configurations Returned");
+ } else {
+ configuration = configurations.get().getConfiguration().get(0);
+ }
+ return Optional.of(configuration);
+ }
+ }
}