aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryService.java52
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java46
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAudit.java39
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java87
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java110
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDataService.java78
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDeleteStackService.java122
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditQueryStackService.java85
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditVServer.java173
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/HeatStackAudit.java330
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateAAIInventory.java132
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java12
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java (renamed from adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteAAIInventory.java)29
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java (renamed from adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryTask.java)8
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java41
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java51
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditDataServiceTest.java113
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java191
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditVServerTest.java444
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/HeatStackAuditTest.java298
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java38
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java2
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/etsi/pkg/processor/EtsiResourcePackageProcessor.java2
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java8
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/SdcNotificationWithSol004PackageTest.java2
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml (renamed from asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml)0
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VF_LICENSE/vf-license-model.xml (renamed from asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VF_LICENSE/vf-license-model.xml)0
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/vgw6.csar (renamed from asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/vgw6.csar)bin43363 -> 43363 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/SDC_RESOURCE_CSAR/vgw_sdc_resource.csarbin117852 -> 117441 bytes
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/dmaap-notification-message.json4
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vgw/service-Vgwservicev1-csar.csarbin122078 -> 121635 bytes
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java9
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn208
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn455
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java29
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn54
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java6
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java18
-rw-r--r--graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryResultWrapper.java10
-rw-r--r--graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/AAIResultWrapperTest.java11
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/common/ResponseBuilder.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/CamundaDatabaseConfiguration.java27
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/BaseTest.java2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/DeleteNsTaskTest.java30
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/TerminateNsTaskTest.java41
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NSLcmOpOccRepository.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoJobRepository.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNfInstRepository.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNsInstRepository.java4
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java8
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java2
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java15
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java6
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json122
64 files changed, 595 insertions, 3056 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryService.java
deleted file mode 100644
index 4e5e880f80..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.so.adapters.inventory.delete;
-
-import javax.annotation.PostConstruct;
-import org.onap.so.utils.ExternalTaskServiceUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-@Component
-@Profile("!test")
-public class DeleteInventoryService {
-
- @Autowired
- public Environment env;
-
- @Autowired
- private DeleteInventoryTask deleteInventory;
-
- @Autowired
- private ExternalTaskServiceUtils externalTaskServiceUtils;
-
- @PostConstruct
- public void auditAAIInventory() throws Exception {
- for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
- externalTaskServiceUtils.createExternalTaskClient().subscribe("InventoryDelete")
- .lockDuration(externalTaskServiceUtils.getLockDurationMedium())
- .handler(deleteInventory::executeExternalTask).open();
- }
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
index d4a4bb792f..b176892192 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
@@ -22,10 +22,8 @@ package org.onap.so.adapters.tasks;
import javax.annotation.PostConstruct;
import org.camunda.bpm.client.ExternalTaskClient;
-import org.onap.so.adapters.tasks.audit.AuditCreateStackService;
-import org.onap.so.adapters.tasks.audit.AuditDeleteStackService;
-import org.onap.so.adapters.tasks.audit.AuditQueryStackService;
import org.onap.so.adapters.tasks.inventory.CreateInventoryTask;
+import org.onap.so.adapters.tasks.inventory.DeleteInventoryTask;
import org.onap.so.adapters.tasks.orchestration.PollService;
import org.onap.so.adapters.tasks.orchestration.RollbackService;
import org.onap.so.adapters.tasks.orchestration.StackService;
@@ -46,15 +44,6 @@ public class TaskServices {
private ExternalTaskServiceUtils externalTaskServiceUtils;
@Autowired
- private AuditCreateStackService auditCreateStack;
-
- @Autowired
- private AuditDeleteStackService auditDeleteStack;
-
- @Autowired
- private AuditQueryStackService auditQueryStack;
-
- @Autowired
private CreateInventoryTask createInventory;
@Autowired
@@ -66,39 +55,24 @@ public class TaskServices {
@Autowired
private RollbackService rollbackService;
- @PostConstruct
- public void auditAddAAIInventory() throws Exception {
- for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
- ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryAddAudit").lockDuration(externalTaskServiceUtils.getLockDurationLong())
- .handler(auditCreateStack::executeExternalTask).open();
- }
- }
-
- @PostConstruct
- public void auditDeleteAAIInventory() throws Exception {
- for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
- ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryDeleteAudit").lockDuration(externalTaskServiceUtils.getLockDurationLong())
- .handler(auditDeleteStack::executeExternalTask).open();
- }
- }
+ @Autowired
+ private DeleteInventoryTask deleteInventory;
@PostConstruct
- public void auditQueryInventory() throws Exception {
+ public void createtAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryQueryAudit").lockDuration(externalTaskServiceUtils.getLockDuration())
- .handler(auditQueryStack::executeExternalTask).open();
+ client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLongLockDuration())
+ .handler(createInventory::executeExternalTask).open();
}
}
@PostConstruct
- public void createtAAIInventory() throws Exception {
+ public void auditAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
- ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLongLockDuration())
- .handler(createInventory::executeExternalTask).open();
+ externalTaskServiceUtils.createExternalTaskClient().subscribe("InventoryDelete")
+ .lockDuration(externalTaskServiceUtils.getLockDurationMedium())
+ .handler(deleteInventory::executeExternalTask).open();
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAudit.java
deleted file mode 100644
index 0c6bb6f387..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAudit.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.so.adapters.tasks.audit;
-
-import org.onap.aaiclient.client.aai.AAIResourcesClient;
-
-public class AbstractAudit {
-
- private AAIResourcesClient aaiClient;
-
- protected AAIResourcesClient getAaiClient() {
- if (aaiClient == null)
- return new AAIResourcesClient();
- else
- return aaiClient;
- }
-
- protected void setAaiClient(AAIResourcesClient aaiResource) {
- aaiClient = aaiResource;
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java
deleted file mode 100644
index 8cdd37d43f..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.so.adapters.tasks.audit;
-
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.onap.so.utils.ExternalTaskUtils;
-import org.onap.so.utils.RetrySequenceLevel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-@Component
-public abstract class AbstractAuditService extends ExternalTaskUtils {
-
- private static final Logger logger = LoggerFactory.getLogger(AbstractAuditService.class);
-
- protected static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI =
- "Unable to find all VServers and L-Interaces in A&AI";
-
- protected static final String UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK = "Unable to find VServers in Openstack";
-
- @Autowired
- public Environment env;
-
- public AbstractAuditService() {
- super(RetrySequenceLevel.LONG);
- }
-
- /**
- * @param auditList
- * @return
- */
- protected boolean didCreateAuditFail(AAIObjectAuditList auditList) {
- if (isAuditListNotNullAndNotEmpty(auditList)) {
- if (logger.isInfoEnabled()) {
- logger.info("Audit Results: {}", auditList.toString());
- }
- return auditList.getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist()).findFirst()
- .map(v -> true).orElse(false);
- } else {
- return false;
- }
- }
-
- /**
- * @param auditList
- * @return
- */
- protected boolean didDeleteAuditFail(AAIObjectAuditList auditList) {
- if (isAuditListNotNullAndNotEmpty(auditList)) {
- if (logger.isInfoEnabled()) {
- logger.info("Audit Results: {}", auditList.toString());
- }
- return auditList.getAuditList().stream().filter(AAIObjectAudit::isDoesObjectExist).findFirst()
- .map(v -> true).orElse(false);
- } else {
- return false;
- }
- }
-
- private boolean isAuditListNotNullAndNotEmpty(AAIObjectAuditList auditList) {
- return auditList != null && auditList.getAuditList() != null && !auditList.getAuditList().isEmpty();
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java
deleted file mode 100644
index a4afcf1378..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * 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.so.adapters.tasks.audit;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import org.camunda.bpm.client.task.ExternalTask;
-import org.camunda.bpm.client.task.ExternalTaskService;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class AuditCreateStackService extends AbstractAuditService {
-
- private static final Logger logger = LoggerFactory.getLogger(AuditCreateStackService.class);
-
- @Autowired
- public HeatStackAudit heatStackAudit;
-
- @Autowired
- public AuditMDCSetup mdcSetup;
-
- public AuditCreateStackService() {
- super();
- }
-
- public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- mdcSetup.setupMDC(externalTask);
- AuditInventory auditInventory = externalTask.getVariable("auditInventory");
- Map<String, Object> variables = new HashMap<>();
- boolean success = false;
- try {
- Integer retryCount = externalTask.getRetries();
- logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", retryCount, auditInventory);
- Optional<AAIObjectAuditList> auditListOpt = heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(),
- auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
- if (auditListOpt.isPresent()) {
- auditListOpt.get().setAuditType("create");
- auditListOpt.get().setHeatStackName(auditInventory.getHeatStackName());
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
- success = !didCreateAuditFail(auditListOpt.get());
- }
- } catch (Exception e) {
- logger.error("Error during audit of stack", e);
- }
- variables.put("auditIsSuccessful", success);
- mdcSetup.setElapsedTime();
- String externalTaskId = externalTask.getId();
- if (success) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
- logger.debug("The External Task Id: {} Successful", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- Integer retryCount = externalTask.getRetries();
- if (retryCount == null) {
- logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
- externalTaskId, getRetrySequence().length);
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (retryCount == 1) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
- logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
- externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, retryCount - 1,
- calculateRetryDelay(retryCount));
- }
- logger.debug("The External Task Id: {} Failed", externalTaskId);
- }
- }
-
-
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDataService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDataService.java
deleted file mode 100644
index 200f6375ea..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDataService.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.onap.so.adapters.tasks.audit;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Optional;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.db.request.beans.RequestProcessingData;
-import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-
-@Component
-public class AuditDataService {
-
- private static final String AUDIT_STACK_DATA = "AuditStackData";
-
- @Autowired
- private RequestsDbClient requestsDbClient;
-
- /**
- * Checks to see if an entry already exist for the given heat stack and writes audit stack data to the request
- * database if it doesn't.
- *
- * @throws JsonProcessingException
- */
- public void writeStackDataToRequestDb(AuditInventory auditInventory, AAIObjectAuditList auditList)
- throws JsonProcessingException {
- List<RequestProcessingData> requestProcessingDataList =
- requestsDbClient.getRequestProcessingDataByGroupingIdAndNameAndTag(auditInventory.getVfModuleId(),
- auditInventory.getHeatStackName(), AUDIT_STACK_DATA);
- if (requestProcessingDataList.isEmpty()) {
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- String auditListString = objectMapper.getMapper().writeValueAsString(auditList);;
-
- RequestProcessingData requestProcessingData = new RequestProcessingData();
- requestProcessingData.setSoRequestId(auditInventory.getMsoRequestId());
- requestProcessingData.setGroupingId(auditInventory.getVfModuleId());
- requestProcessingData.setName(auditInventory.getHeatStackName());
- requestProcessingData.setTag(AUDIT_STACK_DATA);
- requestProcessingData.setValue(auditListString);
-
- requestsDbClient.saveRequestProcessingData(requestProcessingData);
- }
- }
-
- /**
- * Retrieves audit stack data from the request database.
- *
- * @throws IOException
- * @throws JsonMappingException
- * @throws JsonParseException
- */
- public Optional<AAIObjectAuditList> getStackDataFromRequestDb(AuditInventory auditInventory) throws IOException {
-
- List<RequestProcessingData> requestProcessingDataList =
- requestsDbClient.getRequestProcessingDataByGroupingIdAndNameAndTag(auditInventory.getVfModuleId(),
- auditInventory.getHeatStackName(), AUDIT_STACK_DATA);
- if (!requestProcessingDataList.isEmpty()) {
- RequestProcessingData requestProcessingData = requestProcessingDataList.get(0);
- String auditListString = requestProcessingData.getValue();
-
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- AAIObjectAuditList auditList =
- objectMapper.getMapper().readValue(auditListString, AAIObjectAuditList.class);
-
- return Optional.of(auditList);
- } else {
- return Optional.empty();
- }
- }
-
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDeleteStackService.java
deleted file mode 100644
index a7fdc352cd..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditDeleteStackService.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017-2019 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.so.adapters.tasks.audit;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import org.camunda.bpm.client.task.ExternalTask;
-import org.camunda.bpm.client.task.ExternalTaskService;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-@Component
-public class AuditDeleteStackService extends AbstractAuditService {
-
- private static final Logger logger = LoggerFactory.getLogger(AuditDeleteStackService.class);
-
- @Autowired
- protected HeatStackAudit heatStackAudit;
-
- @Autowired
- protected AuditVServer auditVservers;
-
- @Autowired
- protected AuditDataService auditDataService;
-
- @Autowired
- protected Environment env;
-
- @Autowired
- public AuditMDCSetup mdcSetup;
-
- public AuditDeleteStackService() {
- super();
- }
-
- public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
-
- mdcSetup.setupMDC(externalTask);
- AuditInventory auditInventory = externalTask.getVariable("auditInventory");
- Map<String, Object> variables = new HashMap<>();
- boolean success = false;
- try {
- Integer retryCount = externalTask.getRetries();
- logger.info("Executing External Task Delete Audit Inventory. Retry Number: {}", retryCount);
- Optional<AAIObjectAuditList> auditListOpt = auditDataService.getStackDataFromRequestDb(auditInventory);
- if (auditListOpt.isPresent()) {
- auditVservers.auditVservers(auditListOpt.get());
- } else {
- logger.debug("Auditing Vservers based on vf module relationships");
- auditListOpt = auditVservers.auditVserversThroughRelationships(auditInventory.getGenericVnfId(),
- auditInventory.getHeatStackName());
- }
- auditListOpt.get().setHeatStackName(auditInventory.getHeatStackName());
- auditListOpt.get().setAuditType("delete");
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
- success = !didDeleteAuditFail(auditListOpt.get());
-
- } catch (Exception e) {
- logger.error("Error during audit of stack", e);
- }
- variables.put("auditIsSuccessful", success);
- mdcSetup.setElapsedTime();
- String externalTaskId = externalTask.getId();
- if (success) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
- logger.debug("The External Task Id: {} Successful", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- Integer retryCount = externalTask.getRetries();
- if (retryCount == null) {
- logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
- externalTaskId, getRetrySequence().length);
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (retryCount == 1) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
- logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
- externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
- UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, retryCount - 1,
- calculateRetryDelay(retryCount));
- }
- logger.debug("The External Task Id: {} Failed", externalTaskId);
- }
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditQueryStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditQueryStackService.java
deleted file mode 100644
index ebef4425eb..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditQueryStackService.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.onap.so.adapters.tasks.audit;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import org.camunda.bpm.client.task.ExternalTask;
-import org.camunda.bpm.client.task.ExternalTaskService;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class AuditQueryStackService extends AbstractAuditService {
-
- private static final Logger logger = LoggerFactory.getLogger(AuditQueryStackService.class);
-
- @Autowired
- protected HeatStackAudit heatStackAudit;
-
- @Autowired
- protected AuditDataService auditDataService;
-
- @Autowired
- public AuditMDCSetup mdcSetup;
-
- public AuditQueryStackService() {
- super();
- }
-
- public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
- mdcSetup.setupMDC(externalTask);
- AuditInventory auditInventory = externalTask.getVariable("auditInventory");
- boolean success = false;
- Map<String, Object> variables = new HashMap<>();
- try {
- Integer retryCount = externalTask.getRetries();
- logger.info("Executing External Task Query Audit Inventory. Audit Inventory: {} \n Retry Number: {}",
- auditInventory.toString(), retryCount);
-
- Optional<AAIObjectAuditList> auditList = heatStackAudit.queryHeatStack(auditInventory.getCloudOwner(),
- auditInventory.getCloudRegion(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
-
- if (auditList.isPresent()) {
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
- success = true;
- auditDataService.writeStackDataToRequestDb(auditInventory, auditList.get());
- }
- mdcSetup.setElapsedTime();
- String externalTaskId = externalTask.getId();
- if (success) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
- logger.debug("The External Task {} was Successful", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- if (retryCount == null) {
- logger.debug("The External Task {} Failed. Setting Retries to Default Start Value: {}",
- externalTaskId, getRetrySequence().length);
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
- UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, getRetrySequence().length, 10000);
- } else if (retryCount == 1) {
- externalTaskService.complete(externalTask, variables);
- mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
- logger.debug("The External Task {} Failed. All Retries Exhausted", externalTaskId);
- logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
- mdcSetup.clearClientMDCs();
- } else {
- logger.debug("The External Task {} Failed. Decrementing Retries to {} , Retry Delay: ",
- externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
- externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
- UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, retryCount - 1, calculateRetryDelay(retryCount));
- }
- logger.debug("The External Task {} Failed", externalTaskId);
- }
- } catch (Exception e) {
- logger.error("Error during audit query of stack", e);
- }
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditVServer.java
deleted file mode 100644
index 6f87b6b309..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditVServer.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 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.so.adapters.tasks.audit;
-
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import org.onap.aai.domain.yang.LInterface;
-import org.onap.aai.domain.yang.VfModule;
-import org.onap.aai.domain.yang.VfModules;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.aaiclient.client.aai.AAIObjectType;
-import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
-import org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri;
-import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
-import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
-import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
-import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
-import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-@Component
-public class AuditVServer extends AbstractAudit {
- private static final Logger logger = LoggerFactory.getLogger(AuditVServer.class);
-
- public void auditVservers(AAIObjectAuditList aaiObjectAuditList) {
-
- aaiObjectAuditList.getAuditList().forEach(aaiObjectAudit -> {
- boolean vserverExist = getAaiClient().exists(
- AAIUriFactory.createResourceFromExistingURI(Types.VSERVER, aaiObjectAudit.getResourceURI()));
- aaiObjectAudit.setDoesObjectExist(vserverExist);
- });
- }
-
- public Optional<AAIObjectAuditList> auditVserversThroughRelationships(String genericVnfId, String vfModuleName) {
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- AAIPluralResourceUri uri =
- AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModules())
- .queryParam("vf-module-name", vfModuleName);
- Optional<AAIResultWrapper> wrapper = getAaiClient().getFirstWrapper(VfModules.class, VfModule.class, uri);
- if (wrapper.isPresent() && wrapper.get().getRelationships().isPresent()) {
- List<AAIResourceUri> relatedVservers = wrapper.get().getRelationships().get().getRelatedUris(Types.VSERVER);
- if (!relatedVservers.isEmpty()) {
- relatedVservers.forEach(vserverUri -> {
- Optional<Vserver> vserver = getAaiClient().get(vserverUri).asBean(Vserver.class);
- Vserver vServerShallow = new Vserver();
- BeanUtils.copyProperties(vserver, vServerShallow);
- AAIObjectAudit vServerAudit = new AAIObjectAudit();
- vServerAudit.setAaiObject(vServerShallow);
- vServerAudit.setAaiObjectType(Types.VSERVER.typeName());
- vServerAudit.setDoesObjectExist(true);
- auditList.getAuditList().add(vServerAudit);
- });
- }
- }
- return Optional.of(auditList);
- }
-
- public Optional<AAIObjectAuditList> auditVservers(Set<Vserver> vServersToAudit, String tenantId, String cloudOwner,
- String cloudRegion) {
- if (vServersToAudit == null || vServersToAudit.isEmpty()) {
- return Optional.empty();
- }
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- vServersToAudit.stream().forEach(vserver -> {
- try {
- logger.debug("Vserver to Audit: {}", objectMapper.getMapper().writeValueAsString(vserver));
- } catch (JsonProcessingException e) {
- logger.error("Json parse exception: ", e);
- }
-
- });
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- vServersToAudit.stream().forEach(vServer -> auditList.getAuditList()
- .addAll(doesVServerExistInAAI(vServer, tenantId, cloudOwner, cloudRegion).getAuditList()));
- return Optional.of(auditList);
- }
-
- private AAIObjectAuditList doesVServerExistInAAI(Vserver vServer, String tenantId, String cloudOwner,
- String cloudRegion) {
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- AAIObjectAudit vServerAudit = new AAIObjectAudit();
- AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver(vServer.getVserverId()));
- Vserver vServerShallow = new Vserver();
- BeanUtils.copyProperties(vServer, vServerShallow, "LInterfaces");
- boolean vServerExists = getAaiClient().exists(vserverURI);
- logger.info("v-server {} exists: {}", vServer.getVserverId(), vServerExists);
- vServerAudit.setAaiObject(vServerShallow);
- vServerAudit.setDoesObjectExist(vServerExists);
- vServerAudit.setResourceURI(vserverURI.build());
- vServerAudit.setAaiObjectType(Types.VSERVER.typeName());
- auditList.getAuditList().add(vServerAudit);
- if (vServer.getLInterfaces() != null) {
- vServer.getLInterfaces().getLInterface().stream().forEach(lInterface -> auditList.getAuditList().addAll(
- doesLinterfaceExistinAAI(lInterface, vServer.getVserverId(), tenantId, cloudOwner, cloudRegion)
- .getAuditList()));
- }
- return auditList;
- }
-
- private AAIObjectAuditList doesLinterfaceExistinAAI(LInterface lInterface, String vServerId, String tenantId,
- String cloudOwner, String cloudRegion) {
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- AAIObjectAudit lInterfaceAudit = new AAIObjectAudit();
- AAIResourceUri linterfaceURI = AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion)
- .tenant(tenantId).vserver(vServerId).lInterface(lInterface.getInterfaceName()));
- Optional<LInterface> queriedLInterface = getAaiClient().get(LInterface.class, linterfaceURI);
- if (queriedLInterface.isPresent()) {
- lInterfaceAudit.setDoesObjectExist(true);
- lInterface.setInterfaceName(lInterface.getInterfaceName());
- }
- lInterfaceAudit.setAaiObject(lInterface);
- lInterfaceAudit.setResourceURI(linterfaceURI.build());
- lInterfaceAudit.setAaiObjectType(Types.L_INTERFACE.typeName());
- auditList.getAuditList().add(lInterfaceAudit);
- logger.info("l-interface id:{} name: {} exists: {} ", lInterface.getInterfaceId(),
- lInterface.getInterfaceName(), lInterfaceAudit.isDoesObjectExist());
-
- if (lInterface.getLInterfaces() != null) {
- lInterface.getLInterfaces().getLInterface().stream()
- .forEach(subInterface -> auditList.getAuditList().add(doesSubInterfaceExistinAAI(subInterface,
- lInterface.getInterfaceName(), vServerId, tenantId, cloudOwner, cloudRegion)));
- }
- logger.debug("l-interface {} does not contain any sub-iterfaces, skipping audit of sub-interfaces",
- lInterface.getInterfaceId());
-
- return auditList;
- }
-
- private AAIObjectAudit doesSubInterfaceExistinAAI(LInterface subInterface, String linterfaceName, String vServerId,
- String tenantId, String cloudOwner, String cloudRegion) {
- logger.info("checking if sub-l-interface {} , linterfaceName: {} vserverId: {} exists",
- subInterface.getInterfaceName(), linterfaceName, vServerId);
- AAIObjectAudit subInterfaceAudit = new AAIObjectAudit();
-
-
- AAIResourceUri subInterfaceURI = AAIUriFactory.createResourceUri(AAIObjectType.SUB_L_INTERFACE, cloudOwner,
- cloudRegion, tenantId, vServerId, linterfaceName, subInterface.getInterfaceName());
- subInterfaceAudit.setResourceURI(subInterfaceURI.build());
- boolean doesExist = getAaiClient().exists(subInterfaceURI);
- logger.info("sub-l-interface-id:{} exists: {}", subInterface.getInterfaceId(), doesExist);
- subInterfaceAudit.setAaiObject(subInterface);
- subInterfaceAudit.setDoesObjectExist(doesExist);
- subInterfaceAudit.setAaiObjectType(AAIObjectType.SUB_L_INTERFACE.typeName());
- return subInterfaceAudit;
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/HeatStackAudit.java
deleted file mode 100644
index c58e568ea4..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/HeatStackAudit.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * Modifications Copyright (C) 2019 IBM.
- * ================================================================================
- * 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.so.adapters.tasks.audit;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.onap.aai.domain.yang.LInterface;
-import org.onap.aai.domain.yang.LInterfaces;
-import org.onap.aai.domain.yang.Vlan;
-import org.onap.aai.domain.yang.Vlans;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
-import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
-import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.onap.so.openstack.utils.MsoHeatUtils;
-import org.onap.so.openstack.utils.MsoNeutronUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import com.woorea.openstack.heat.model.Link;
-import com.woorea.openstack.heat.model.Resource;
-import com.woorea.openstack.heat.model.Resources;
-import com.woorea.openstack.heat.model.Stack;
-import com.woorea.openstack.quantum.model.Port;
-
-@Component
-public class HeatStackAudit {
-
- private static final String RESOURCES = "/resources";
-
- protected static final Logger logger = LoggerFactory.getLogger(HeatStackAudit.class);
-
- private static final String EXCEPTION_MSG = "Error finding Path from Self Link";
-
- @Autowired
- protected MsoHeatUtils heat;
-
- @Autowired
- protected MsoNeutronUtils neutron;
-
- @Autowired
- protected AuditVServer auditVservers;
-
- public Optional<AAIObjectAuditList> queryHeatStack(String cloudOwner, String cloudRegion, String tenantId,
- String heatStackName) {
- try {
- logger.debug("Fetching Top Level Stack Information");
- Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName, 3);
- List<Resource> novaResources = resources.getList().stream()
- .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
- if (novaResources.isEmpty())
- return Optional.of(new AAIObjectAuditList());
- else {
- Set<Vserver> vserversToAudit = createVserverSet(novaResources);
- AAIObjectAuditList aaiObjectAuditList = new AAIObjectAuditList();
- vserversToAudit.stream().forEach(vServer -> aaiObjectAuditList.getAuditList()
- .add(createAAIObjectAudit(cloudOwner, cloudRegion, tenantId, vServer)));
- return Optional.of(aaiObjectAuditList);
- }
- } catch (Exception e) {
- logger.error("Error during query stack resources", e);
- return Optional.of(new AAIObjectAuditList());
- }
- }
-
- public Optional<AAIObjectAuditList> auditHeatStack(String cloudRegion, String cloudOwner, String tenantId,
- String heatStackName) {
- try {
- logger.debug("Fetching Top Level Stack Information");
- Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName, 3);
- List<Resource> novaResources = resources.getList().stream()
- .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
- List<Resource> resourceGroups = resources.getList().stream()
- .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType()) && p.getName().contains("subinterfaces"))
- .collect(Collectors.toList());
- List<Optional<Port>> neutronPortDetails = retrieveNeutronPortDetails(resources, cloudRegion, tenantId);
- if (novaResources.isEmpty())
- return Optional.of(new AAIObjectAuditList());
- else {
- Set<Vserver> vserversToAudit = createVserverSet(resources, novaResources, neutronPortDetails);
- Set<Vserver> vserversWithSubInterfaces =
- processSubInterfaces(cloudRegion, tenantId, resourceGroups, vserversToAudit);
- return auditVservers.auditVservers(vserversWithSubInterfaces, tenantId, cloudOwner, cloudRegion);
- }
- } catch (Exception e) {
- logger.error("Error during auditing stack resources", e);
- return Optional.empty();
- }
- }
-
- protected Set<Vserver> processSubInterfaces(String cloudRegion, String tenantId, List<Resource> resourceGroups,
- Set<Vserver> vServersToAudit) throws Exception {
- for (Resource resourceGroup : resourceGroups) {
- processResourceGroups(cloudRegion, tenantId, vServersToAudit, resourceGroup);
- }
- return vServersToAudit;
- }
-
- protected void processResourceGroups(String cloudRegion, String tenantId, Set<Vserver> vServersWithLInterface,
- Resource resourceGroup) throws Exception {
- Optional<Link> stackLink =
- resourceGroup.getLinks().stream().filter(link -> "nested".equals(link.getRel())).findAny();
- if (stackLink.isPresent()) {
- try {
- Optional<String> path = extractResourcePathFromHref(stackLink.get().getHref());
- if (path.isPresent()) {
- logger.debug("Fetching nested Resource Stack Information");
- Resources nestedResourceGroupResources =
- heat.executeHeatClientRequest(path.get(), cloudRegion, tenantId, Resources.class);
- processNestedResourceGroup(cloudRegion, tenantId, vServersWithLInterface,
- nestedResourceGroupResources);
- } else
- throw new Exception(EXCEPTION_MSG);
- } catch (Exception e) {
- logger.error("Error Parsing Link to obtain Path", e);
- throw new Exception(EXCEPTION_MSG);
- }
- }
- }
-
- protected void processNestedResourceGroup(String cloudRegion, String tenantId, Set<Vserver> vServersWithLInterface,
- Resources nestedResourceGroupResources) throws Exception {
- for (Resource resourceGroupNested : nestedResourceGroupResources) {
- Optional<Link> subInterfaceStackLink =
- resourceGroupNested.getLinks().stream().filter(link -> "nested".equals(link.getRel())).findAny();
- if (subInterfaceStackLink.isPresent()) {
- addSubInterface(cloudRegion, tenantId, vServersWithLInterface, subInterfaceStackLink.get());
- }
- }
- }
-
- protected void addSubInterface(String cloudRegion, String tenantId, Set<Vserver> vServersWithLInterface,
- Link subInterfaceStackLink) throws Exception {
- Optional<String> resourcePath = extractResourcePathFromHref(subInterfaceStackLink.getHref());
- Optional<String> stackPath = extractStackPathFromHref(subInterfaceStackLink.getHref());
- if (resourcePath.isPresent() && stackPath.isPresent()) {
- logger.debug("Fetching nested Sub-Interface Stack Information");
- Stack subinterfaceStack =
- heat.executeHeatClientRequest(stackPath.get(), cloudRegion, tenantId, Stack.class);
- Resources subinterfaceResources =
- heat.executeHeatClientRequest(resourcePath.get(), cloudRegion, tenantId, Resources.class);
- if (subinterfaceStack != null) {
- addSubInterfaceToVserver(vServersWithLInterface, subinterfaceStack, subinterfaceResources);
- }
- } else
- throw new Exception(EXCEPTION_MSG);
-
- }
-
- protected void addSubInterfaceToVserver(Set<Vserver> vServersWithLInterface, Stack subinterfaceStack,
- Resources subinterfaceResources) throws Exception {
- String parentNeutronPortId = (String) subinterfaceStack.getParameters().get("port_interface");
- logger.debug("Parent neutron Port: {} on SubInterface: {}", parentNeutronPortId, subinterfaceStack.getId());
- for (Vserver auditVserver : vServersWithLInterface)
- for (LInterface lInterface : auditVserver.getLInterfaces().getLInterface())
-
- if (parentNeutronPortId.equals(lInterface.getInterfaceId())) {
- logger.debug("Found Parent Port on VServer: {} on Port: {}", auditVserver.getVserverId(),
- lInterface.getInterfaceId());
- Resource contrailVm = subinterfaceResources.getList().stream()
- .filter(resource -> "OS::ContrailV2::VirtualMachineInterface".equals(resource.getType()))
- .findAny().orElse(null);
- if (contrailVm == null) {
- throw new Exception("Cannnot find Contrail Virtual Machine Interface on Stack: "
- + subinterfaceStack.getId());
- }
- LInterface subInterface = new LInterface();
- subInterface.setInterfaceId(contrailVm.getPhysicalResourceId());
- subInterface.setIsPortMirrored(false);
- subInterface.setInMaint(false);
- subInterface.setIsIpUnnumbered(false);
- String macAddr = (String) subinterfaceStack.getParameters().get("mac_address");
- subInterface.setMacaddr(macAddr);
-
- String namePrefix = (String) subinterfaceStack.getParameters().get("subinterface_name_prefix");
- Integer vlanIndex = Integer.parseInt((String) subinterfaceStack.getParameters().get("counter"));
- String vlanTagList = (String) subinterfaceStack.getParameters().get("vlan_tag");
- List<String> subInterfaceVlanTagList = Arrays.asList(vlanTagList.split(","));
- subInterface.setInterfaceName(namePrefix + "_" + subInterfaceVlanTagList.get(vlanIndex));
- subInterface.setVlans(new Vlans());
- Vlan vlan = new Vlan();
- vlan.setInMaint(false);
- vlan.setIsIpUnnumbered(false);
- vlan.setVlanIdInner(Long.parseLong(subInterfaceVlanTagList.get(vlanIndex)));
- vlan.setVlanInterface(namePrefix + "_" + subInterfaceVlanTagList.get(vlanIndex));
- subInterface.getVlans().getVlan().add(vlan);
- if (lInterface.getLInterfaces() == null)
- lInterface.setLInterfaces(new LInterfaces());
-
- lInterface.getLInterfaces().getLInterface().add(subInterface);
- } else
- logger.debug("Did Not Find Parent Port on VServer: {} Parent Port: SubInterface: {}",
- auditVserver.getVserverId(), lInterface.getInterfaceId(), subinterfaceStack.getId());
- }
-
- protected Set<Vserver> createVserverSet(Resources resources, List<Resource> novaResources,
- List<Optional<Port>> neutronPortDetails) {
- Set<Vserver> vserversToAudit = new HashSet<>();
- for (Resource novaResource : novaResources) {
- Vserver auditVserver = new Vserver();
- auditVserver.setLInterfaces(new LInterfaces());
- auditVserver.setVserverId(novaResource.getPhysicalResourceId());
- Stream<Port> filteredNeutronPorts = filterNeutronPorts(novaResource, neutronPortDetails);
- filteredNeutronPorts.forEach(port -> {
- LInterface lInterface = new LInterface();
- lInterface.setInterfaceId(port.getId());
- lInterface.setInterfaceName(port.getName());
- auditVserver.getLInterfaces().getLInterface().add(lInterface);
- });
- vserversToAudit.add(auditVserver);
- }
- return vserversToAudit;
- }
-
- protected Set<Vserver> createVserverSet(List<Resource> novaResources) {
- Set<Vserver> vserversToAudit = new HashSet<>();
- for (Resource novaResource : novaResources) {
- Vserver auditVserver = new Vserver();
- auditVserver.setLInterfaces(new LInterfaces());
- auditVserver.setVserverId(novaResource.getPhysicalResourceId());
- vserversToAudit.add(auditVserver);
- }
- return vserversToAudit;
- }
-
- protected AAIObjectAudit createAAIObjectAudit(String cloudOwner, String cloudRegion, String tenantId,
- Vserver vServer) {
- AAIObjectAudit aaiObjectAudit = new AAIObjectAudit();
- Vserver vServerShallow = new Vserver();
- BeanUtils.copyProperties(vServer, vServerShallow);
- aaiObjectAudit.setAaiObject(vServerShallow);
- aaiObjectAudit.setAaiObjectType(Types.VSERVER.typeName());
- aaiObjectAudit
- .setResourceURI(AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver(vServer.getVserverId()))
- .build());
-
- return aaiObjectAudit;
- }
-
- /**
- * @param novaResource Single openstack resource that is of type Nova
- * @param neutronPorts List of Neutron ports created within the stack
- * @return Filtered list of neutron ports taht relate to the nova server in openstack
- */
- protected Stream<Port> filterNeutronPorts(Resource novaResource, List<Optional<Port>> neutronPorts) {
- List<Port> filteredNeutronPorts =
- neutronPorts.stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
- return filteredNeutronPorts.stream()
- .filter(port -> port.getDeviceId().equalsIgnoreCase(novaResource.getPhysicalResourceId()));
- }
-
- /**
- * @param resources Resource stream created by the stack in openstack
- * @param cloudSiteId Unique site id to identify which openstack we talk to
- * @param tenantId The tenant within the cloud we are talking to where resouces exist
- * @return List of optional neutron ports found within the cloud site and tenant
- */
- protected List<Optional<Port>> retrieveNeutronPortDetails(Resources resources, String cloudSiteId,
- String tenantId) {
- return resources.getList().stream().filter(resource -> "OS::Neutron::Port".equals(resource.getType()))
- .map(resource -> neutron.getNeutronPort(resource.getPhysicalResourceId(), tenantId, cloudSiteId))
- .collect(Collectors.toList());
-
- }
-
- protected Optional<String> extractResourcePathFromHref(String href) {
- try {
- Optional<String> stackPath = extractStackPathFromHref(href);
- if (stackPath.isPresent()) {
- return Optional.of(stackPath.get() + RESOURCES);
- } else
- return Optional.empty();
- } catch (Exception e) {
- logger.error("Error parsing URI", e);
- }
- return Optional.empty();
- }
-
- protected Optional<String> extractStackPathFromHref(String href) {
- try {
- URI uri = new URI(href);
- Pattern p = Pattern.compile("/stacks.*");
- Matcher m = p.matcher(uri.getPath());
- if (m.find()) {
- return Optional.of(m.group());
- } else
- return Optional.empty();
- } catch (Exception e) {
- logger.error("Error parsing URI", e);
- }
- return Optional.empty();
- }
-
-
-}
-
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateAAIInventory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateAAIInventory.java
index 3f79c43bf8..a6194517c2 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateAAIInventory.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateAAIInventory.java
@@ -29,6 +29,7 @@ import org.onap.so.cloud.resource.beans.CloudInformation;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.heatbridge.HeatBridgeApi;
+import org.onap.so.heatbridge.HeatBridgeException;
import org.onap.so.heatbridge.HeatBridgeImpl;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.openstack4j.model.compute.Flavor;
@@ -55,75 +56,70 @@ public class CreateAAIInventory {
@Autowired
protected Environment env;
- public void heatbridge(CloudInformation cloudInformation) {
- try {
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId())
- .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId()));
- CloudIdentity cloudIdentity = cloudSite.getIdentityService();
- String heatStackId = cloudInformation.getTemplateInstanceId().split("/")[1];
-
- List<String> oobMgtNetNames = new ArrayList<>();
-
- HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity,
- cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(),
- cloudInformation.getTenantId(), cloudInformation.getNodeType());
-
- heatBridgeClient.authenticate();
-
- List<Resource> stackResources =
- heatBridgeClient.queryNestedHeatStackResources(cloudInformation.getTemplateInstanceId());
-
- List<Network> osNetworks = heatBridgeClient.getAllOpenstackProviderNetworks(stackResources);
- heatBridgeClient.buildAddNetworksToAaiAction(cloudInformation.getVnfId(), cloudInformation.getVfModuleId(),
- osNetworks);
-
- List<Server> osServers = heatBridgeClient.getAllOpenstackServers(stackResources);
-
- heatBridgeClient.createPserversAndPinterfacesIfNotPresentInAai(stackResources);
-
- List<Image> osImages = heatBridgeClient.extractOpenstackImagesFromServers(osServers);
-
- List<Flavor> osFlavors = heatBridgeClient.extractOpenstackFlavorsFromServers(osServers);
-
- logger.debug("Successfully queried heat stack{} for resources.", heatStackId);
- // os images
- if (osImages != null && !osImages.isEmpty()) {
- heatBridgeClient.buildAddImagesToAaiAction(osImages);
- logger.debug("Successfully built AAI actions to add images.");
- } else {
- logger.debug("No images to update to AAI.");
- }
- // flavors
- if (osFlavors != null && !osFlavors.isEmpty()) {
- heatBridgeClient.buildAddFlavorsToAaiAction(osFlavors);
- logger.debug("Successfully built AAI actions to add flavors.");
- } else {
- logger.debug("No flavors to update to AAI.");
- }
-
- // compute resources
- heatBridgeClient.buildAddVserversToAaiAction(cloudInformation.getVnfId(), cloudInformation.getVfModuleId(),
- osServers);
- logger.debug("Successfully queried compute resources and built AAI vserver actions.");
-
- // neutron resources
- List<String> oobMgtNetIds = new ArrayList<>();
-
- // if no network-id list is provided, however network-name list is
- if (!CollectionUtils.isEmpty(oobMgtNetNames)) {
- oobMgtNetIds = heatBridgeClient.extractNetworkIds(oobMgtNetNames);
- }
- heatBridgeClient.buildAddVserverLInterfacesToAaiAction(stackResources, oobMgtNetIds,
- cloudInformation.getOwner());
- logger.debug(
- "Successfully queried neutron resources and built AAI actions to add l-interfaces to vservers.");
-
- // Update AAI
- logger.debug("Current Dry Run Value: {}", env.getProperty("heatBridgeDryrun", Boolean.class, false));
- heatBridgeClient.submitToAai(env.getProperty("heatBridgeDryrun", Boolean.class, false));
- } catch (Exception ex) {
- logger.debug("Heatbrige failed for stackId: " + cloudInformation.getTemplateInstanceId(), ex);
+ public void heatbridge(CloudInformation cloudInformation) throws HeatBridgeException, MsoCloudSiteNotFound {
+ CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId())
+ .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId()));
+ CloudIdentity cloudIdentity = cloudSite.getIdentityService();
+ String heatStackId = cloudInformation.getTemplateInstanceId().split("/")[1];
+
+ List<String> oobMgtNetNames = new ArrayList<>();
+
+ HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity,
+ cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(),
+ cloudInformation.getTenantId(), cloudInformation.getNodeType());
+
+ heatBridgeClient.authenticate();
+
+ List<Resource> stackResources =
+ heatBridgeClient.queryNestedHeatStackResources(cloudInformation.getTemplateInstanceId());
+
+ List<Network> osNetworks = heatBridgeClient.getAllOpenstackProviderNetworks(stackResources);
+ heatBridgeClient.buildAddNetworksToAaiAction(cloudInformation.getVnfId(), cloudInformation.getVfModuleId(),
+ osNetworks);
+
+ List<Server> osServers = heatBridgeClient.getAllOpenstackServers(stackResources);
+
+ heatBridgeClient.createPserversAndPinterfacesIfNotPresentInAai(stackResources);
+
+ List<Image> osImages = heatBridgeClient.extractOpenstackImagesFromServers(osServers);
+
+ List<Flavor> osFlavors = heatBridgeClient.extractOpenstackFlavorsFromServers(osServers);
+
+ logger.debug("Successfully queried heat stack{} for resources.", heatStackId);
+ // os images
+ if (osImages != null && !osImages.isEmpty()) {
+ heatBridgeClient.buildAddImagesToAaiAction(osImages);
+ logger.debug("Successfully built AAI actions to add images.");
+ } else {
+ logger.debug("No images to update to AAI.");
+ }
+ // flavors
+ if (osFlavors != null && !osFlavors.isEmpty()) {
+ heatBridgeClient.buildAddFlavorsToAaiAction(osFlavors);
+ logger.debug("Successfully built AAI actions to add flavors.");
+ } else {
+ logger.debug("No flavors to update to AAI.");
+ }
+
+ // compute resources
+ heatBridgeClient.buildAddVserversToAaiAction(cloudInformation.getVnfId(), cloudInformation.getVfModuleId(),
+ osServers);
+ logger.debug("Successfully queried compute resources and built AAI vserver actions.");
+
+ // neutron resources
+ List<String> oobMgtNetIds = new ArrayList<>();
+
+ // if no network-id list is provided, however network-name list is
+ if (!CollectionUtils.isEmpty(oobMgtNetNames)) {
+ oobMgtNetIds = heatBridgeClient.extractNetworkIds(oobMgtNetNames);
}
+ heatBridgeClient.buildAddVserverLInterfacesToAaiAction(stackResources, oobMgtNetIds,
+ cloudInformation.getOwner());
+ logger.debug("Successfully queried neutron resources and built AAI actions to add l-interfaces to vservers.");
+
+ // Update AAI
+ logger.debug("Current Dry Run Value: {}", env.getProperty("heatBridgeDryrun", Boolean.class, false));
+ heatBridgeClient.submitToAai(env.getProperty("heatBridgeDryrun", Boolean.class, false));
}
protected AAIResourcesClient getAaiClient() {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
index 2202e97e71..3c9a4833ae 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
@@ -57,7 +57,6 @@ public class CreateInventoryTask extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
- boolean inventoryException = false;
String externalTaskId = externalTask.getId();
CloudInformation cloudInformation = externalTask.getVariable("cloudInformation");
boolean success = true;
@@ -75,30 +74,29 @@ public class CreateInventoryTask extends ExternalTaskUtils {
if (success) {
externalTaskService.complete(externalTask);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.COMPLETE.toString());
- logger.debug("The External Task Id: {} Successful", externalTaskId);
+ logger.debug("The External Task {} was successful", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
mdcSetup.clearClientMDCs();
} else {
if (retryCount == null) {
- logger.error("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
+ logger.error("The External Task {} Failed, Setting Retries to Default Start Value: {}",
externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, getRetrySequence().length, 10000);
} else if (retryCount != null && retryCount - 1 == 0) {
externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
- logger.error("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
+ logger.error("The External Task {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
- logger.error("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
+ logger.error("The External Task {} Failed, Decrementing Retries: {} , Retry Delay: ",
externalTaskId, retryCount - 1, calculateRetryDelay(retryCount));
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, retryCount - 1, calculateRetryDelay(retryCount));
}
- logger.error("The External Task Id: {} Failed", externalTaskId);
}
} else {
- logger.error("The External Task Id: {} Failed, No Cloud Information Provided", externalTaskId);
+ logger.error("The External Task {} Failed, No Cloud Information Provided", externalTaskId);
externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteAAIInventory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java
index 22e6b1fc22..f5a6355529 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteAAIInventory.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.inventory.delete;
+package org.onap.so.adapters.tasks.inventory;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
import org.onap.so.cloud.CloudConfig;
@@ -26,6 +26,7 @@ import org.onap.so.cloud.resource.beans.CloudInformation;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.heatbridge.HeatBridgeApi;
+import org.onap.so.heatbridge.HeatBridgeException;
import org.onap.so.heatbridge.HeatBridgeImpl;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.slf4j.Logger;
@@ -47,22 +48,16 @@ public class DeleteAAIInventory {
@Autowired
protected Environment env;
- public void heatbridge(CloudInformation cloudInformation) {
- try {
- logger.debug("Heatbridge delete executing");
-
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId())
- .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId()));
- CloudIdentity cloudIdentity = cloudSite.getIdentityService();
- HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity,
- cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(),
- cloudInformation.getTenantId(), cloudInformation.getNodeType());
- heatBridgeClient.authenticate();
- heatBridgeClient.deleteVfModuleData(cloudInformation.getVnfId(), cloudInformation.getVfModuleId());
-
- } catch (Exception ex) {
- logger.debug("Heatbrige failed for stackId: " + cloudInformation.getTemplateInstanceId(), ex);
- }
+ public void heatbridge(CloudInformation cloudInformation) throws MsoCloudSiteNotFound, HeatBridgeException {
+ logger.debug("Heatbridge delete executing");
+ CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId())
+ .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId()));
+ CloudIdentity cloudIdentity = cloudSite.getIdentityService();
+ HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity,
+ cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(),
+ cloudInformation.getTenantId(), cloudInformation.getNodeType());
+ heatBridgeClient.authenticate();
+ heatBridgeClient.deleteVfModuleData(cloudInformation.getVnfId(), cloudInformation.getVfModuleId());
}
protected AAIResourcesClient getAaiClient() {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java
index 10faa2b08f..08361bdbbf 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/delete/DeleteInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java
@@ -20,7 +20,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.adapters.inventory.delete;
+package org.onap.so.adapters.tasks.inventory;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
@@ -32,7 +32,6 @@ import org.onap.so.utils.RetrySequenceLevel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -49,16 +48,13 @@ public class DeleteInventoryTask extends ExternalTaskUtils {
private DeleteAAIInventory deleteInventory;
@Autowired
- private Environment env;
-
- @Autowired
private AuditMDCSetup mdcSetup;
public DeleteInventoryTask() {
super(RetrySequenceLevel.SHORT);
}
- protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
+ public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
String externalTaskId = externalTask.getId();
CloudInformation cloudInformation = externalTask.getVariable("cloudInformation");
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
index 6b7ceedbb8..5196ffffda 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
@@ -276,7 +276,7 @@ public class StackService extends ExternalTaskUtils {
networkAdapterImpl.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
req.getModelCustomizationUuid(), req.getNetworkName(), physicalNetworkName, vlans, routeTargets, shared,
external, req.getFailIfExists(), false, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(),
- networkId, neutronNetworkId, networkFqdn, subnetIdMap, networkRollback, false);
+ networkId, neutronNetworkId, networkFqdn, subnetIdMap, networkRollback, true);
success.setTrue();
backout.setValue(req.getBackout());
canonicalStackId.value = networkRollback.value.getNetworkStackId();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index 6a62a5de61..c8cb8d9731 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -245,7 +245,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
@Override
public List<org.openstack4j.model.compute.Image> extractOpenstackImagesFromServers(final List<Server> servers) {
Objects.requireNonNull(osClient, ERR_MSG_NULL_OS_CLIENT);
- return servers.stream().map(Server::getImage)
+ return servers.stream().filter(s -> s.getImage() != null).map(Server::getImage)
.filter(distinctByProperty(org.openstack4j.model.compute.Image::getId)).collect(Collectors.toList());
}
@@ -324,10 +324,28 @@ public class HeatBridgeImpl implements HeatBridgeApi {
// Build vserver relationships to: image, flavor, pserver, vf-module
vserver.setRelationshipList(
aaiHelper.getVserverRelationshipList(cloudOwner, cloudRegionId, genericVnfId, vfModuleId, server));
- transaction.createIfNotExists(
- AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(vserver.getVserverId())),
- Optional.of(vserver));
+ AAIResourceUri vserverUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
+ .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(vserver.getVserverId()));
+ if (resourcesClient.exists(vserverUri)) {
+ AAIResultWrapper existingVserver = resourcesClient.get(vserverUri);
+ if (!existingVserver.hasRelationshipsTo(Types.VNFC)) {
+ AAIResourceUri vnfcUri =
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc(server.getName()));
+ transaction.connect(vserverUri, vnfcUri);
+ }
+ if (!existingVserver.hasRelationshipsTo(Types.VF_MODULE)) {
+ AAIResourceUri vfModuleUri = AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId));
+ transaction.connect(vserverUri, vfModuleUri);
+ }
+ if (!existingVserver.hasRelationshipsTo(Types.PSERVER)) {
+ AAIResourceUri pServerUri = AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.cloudInfrastructure().pserver(server.getHypervisorHostname()));
+ transaction.connect(vserverUri, pServerUri);
+ }
+ } else {
+ transaction.create(vserverUri, vserver);
+ }
});
}
@@ -380,10 +398,9 @@ public class HeatBridgeImpl implements HeatBridgeApi {
if (cloudOwner.equals(env.getProperty("mso.cloudOwner.included", ""))) {
Server server = getOpenstackServerById(port.getDeviceId());
- updateLInterfaceVlan(port, lIf, server.getHypervisorHostname());
+ createVlanAndSriovVF(port, lIf, server.getHypervisorHostname());
+ updateSriovPfToSriovVF(port, lIf);
}
-
- updateSriovPfToPserver(port, lIf);
}
}
@@ -464,7 +481,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
resourcesClient.createIfNotExists(uri, Optional.of(pInterface));
}
- protected void updateLInterfaceVlan(final Port port, final LInterface lIf, final String hostName)
+ protected void createVlanAndSriovVF(final Port port, final LInterface lIf, final String hostName)
throws HeatBridgeException {
// add back all vlan logic
Vlan vlan = new Vlan();
@@ -582,7 +599,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
* @param lIf AAI l-interface object
* @throws HeatBridgeException
*/
- protected void updateSriovPfToPserver(final Port port, final LInterface lIf) throws HeatBridgeException {
+ protected void updateSriovPfToSriovVF(final Port port, final LInterface lIf) throws HeatBridgeException {
if (port.getvNicType().equalsIgnoreCase(HeatBridgeConstants.OS_SRIOV_PORT_TYPE)) {
AAIResourceUri sriovVfUri = AAIUriFactory
@@ -606,7 +623,9 @@ public class HeatBridgeImpl implements HeatBridgeApi {
DSLQueryBuilder<Start, Node> builder = TraversalBuilder
.fragment(new DSLStartNode(Types.PSERVER, __.key("hostname", pserverHostName)))
.to(__.node(Types.P_INTERFACE)
- .to(__.node(Types.SRIOV_PF, __.key("pf-pci-id", pfPciId)).output()));
+ .to(__.node(Types.SRIOV_PF,
+ __.key(HeatBridgeConstants.OS_PF_PCI_SLOT_KEY.toString(), pfPciId))
+ .output()));
List<Pathed> results = getAAIDSLClient().queryPathed(new DSLQuery(builder.build()));
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java
deleted file mode 100644
index c70e60e9d3..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AbstractAuditServiceTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.onap.so.adapters.tasks.audit;
-
-import org.junit.Test;
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class AbstractAuditServiceTest extends AbstractAuditService {
-
- private AAIObjectAuditList getAuditListWithObjectWithExistenceStateOf(boolean existenceState) {
- AAIObjectAudit auditObject = new AAIObjectAudit();
- AAIObjectAuditList auditList = new AAIObjectAuditList();
-
- auditObject.setDoesObjectExist(existenceState);
- auditList.getAuditList().add(auditObject);
-
- return auditList;
- }
-
- @Test
- public void didCreateAuditFail_shouldReturnFalse_whenGivenNull() {
- assertFalse(didCreateAuditFail(null));
- }
-
- @Test
- public void didCreateAuditFail_shouldReturnTrue_whenGivenNotExistingObject() {
- assertTrue(didCreateAuditFail(getAuditListWithObjectWithExistenceStateOf(false)));
- }
-
- @Test
- public void didCreateAuditFail_shouldReturnFalse_whenGivenExistingObject() {
- assertFalse(didCreateAuditFail(getAuditListWithObjectWithExistenceStateOf(true)));
- }
-
- @Test
- public void didDeleteAuditFail_shouldReturnFalse_whenGivenNull() {
- assertFalse(didDeleteAuditFail(null));
- }
-
- @Test
- public void didDeleteAuditFail_shouldReturnTrue_whenGivenExistingObject() {
- assertTrue(didDeleteAuditFail(getAuditListWithObjectWithExistenceStateOf(true)));
- }
-
- @Test
- public void didDeleteAuditFail_shouldReturnFalse_whenGivenNotExistingObject() {
- assertFalse(didDeleteAuditFail(getAuditListWithObjectWithExistenceStateOf(false)));
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditDataServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditDataServiceTest.java
deleted file mode 100644
index 76e5bbc47f..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditDataServiceTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.onap.so.adapters.tasks.audit;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
-import org.onap.so.db.request.beans.RequestProcessingData;
-import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-
-@RunWith(MockitoJUnitRunner.Silent.class)
-public class AuditDataServiceTest {
-
- @InjectMocks
- AuditDataService auditDataService = new AuditDataService();
-
- @Mock
- protected RequestsDbClient requestsDbClient;
-
- AuditInventory auditInventory = new AuditInventory();
-
- @Before
- public void before() throws JsonProcessingException {
- auditInventory.setCloudOwner("testCloudOwner");
- auditInventory.setCloudRegion("testLcpCloudRegionId");
- auditInventory.setHeatStackName("testVfModuleName1");
- auditInventory.setVfModuleId("testVnfModuleId");
- auditInventory.setTenantId("testTenantId");
- auditInventory.setGenericVnfId("testVnfId1");
- }
-
- @Test
- public void testWriteStackDataToRequestDb() throws Exception {
- Mockito.doReturn(new ArrayList<RequestProcessingData>()).when(requestsDbClient)
- .getRequestProcessingDataByGroupingIdAndNameAndTag(Mockito.any(), Mockito.any(), Mockito.any());
- Mockito.doNothing().when(requestsDbClient).saveRequestProcessingData(Mockito.any());
-
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- auditList.setHeatStackName("testHeatStackName");
- AAIObjectAudit audit = new AAIObjectAudit();
- Vserver vserver = new Vserver();
- vserver.setVserverId("testVserverId");
- audit.setAaiObject(vserver);
- auditList.getAuditList().add(audit);
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- String auditListString = objectMapper.getMapper().writeValueAsString(auditList);
-
- RequestProcessingData requestProcessingData = new RequestProcessingData();
- requestProcessingData.setSoRequestId(auditInventory.getMsoRequestId());
- requestProcessingData.setGroupingId(auditInventory.getVfModuleId());
- requestProcessingData.setName(auditInventory.getHeatStackName());
- requestProcessingData.setTag("AuditStackData");
- requestProcessingData.setValue(auditListString);
-
- auditDataService.writeStackDataToRequestDb(auditInventory, auditList);
- Mockito.verify(requestsDbClient, Mockito.times(1)).saveRequestProcessingData(requestProcessingData);
- }
-
- @Test
- public void testGetStackDataToRequestDb() throws Exception {
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- auditList.setHeatStackName("testHeatStackName");
- AAIObjectAudit audit = new AAIObjectAudit();
- Vserver vserver = new Vserver();
- vserver.setVserverId("testVserverId");
- audit.setAaiObject(vserver);
- auditList.getAuditList().add(audit);
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- String auditListString = objectMapper.getMapper().writeValueAsString(audit);
-
- List<RequestProcessingData> list = new ArrayList();
- RequestProcessingData requestProcessingData = new RequestProcessingData();
- requestProcessingData.setId(234321432);
- requestProcessingData.setGroupingId("testVfModuleId");
- requestProcessingData.setName("heatStackName");
- requestProcessingData.setTag("AuditStackData");
- requestProcessingData.setValue(auditListString);
- list.add(requestProcessingData);
-
- Mockito.doReturn(list).when(requestsDbClient).getRequestProcessingDataByGroupingIdAndNameAndTag(Mockito.any(),
- Mockito.any(), Mockito.any());
- auditDataService.getStackDataFromRequestDb(auditInventory);
- Mockito.verify(requestsDbClient, Mockito.times(1)).getRequestProcessingDataByGroupingIdAndNameAndTag(
- "testVnfModuleId", "testVfModuleName1", "AuditStackData");
- }
-
- @Test
- public void testGetStackDataToRequestDbWhenRequestProcessingDataListIsEmpty() throws Exception {
-
- Mockito.doReturn(new ArrayList<RequestProcessingData>()).when(requestsDbClient)
- .getRequestProcessingDataByGroupingIdAndNameAndTag(Mockito.any(), Mockito.any(), Mockito.any());
- Optional<AAIObjectAuditList> result = auditDataService.getStackDataFromRequestDb(auditInventory);
- Mockito.verify(requestsDbClient, Mockito.times(1)).getRequestProcessingDataByGroupingIdAndNameAndTag(
- "testVnfModuleId", "testVfModuleName1", "AuditStackData");
- assertThat(result).isEmpty();
-
- }
-
-
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java
deleted file mode 100644
index 78dbcd94c2..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditStackServiceDataTest.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017-2019 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.so.adapters.tasks.audit;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.doReturn;
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Optional;
-import org.camunda.bpm.client.task.ExternalTask;
-import org.camunda.bpm.client.task.ExternalTaskService;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.onap.so.adapters.tasks.audit.AuditCreateStackService;
-import org.onap.so.adapters.tasks.audit.AuditDataService;
-import org.onap.so.adapters.tasks.audit.AuditQueryStackService;
-import org.onap.so.adapters.tasks.audit.HeatStackAudit;
-import org.onap.so.audit.beans.AuditInventory;
-import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.springframework.core.env.Environment;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class AuditStackServiceDataTest extends AuditCreateStackService {
-
- @InjectMocks
- private AuditCreateStackService auditStackService = new AuditCreateStackService();
-
- @InjectMocks
- private AuditQueryStackService auditQueryStackService = new AuditQueryStackService();
-
- @Mock
- private HeatStackAudit heatStackAuditMock;
-
- @Mock
- private Environment mockEnv;
-
- @Mock
- private ExternalTask mockExternalTask;
-
- @Mock
- private ExternalTaskService mockExternalTaskService;
-
- @Mock
- private AuditDataService auditDataService;
-
- @Mock
- private AuditMDCSetup mdcSetup;
-
- private ObjectMapper objectMapper = new ObjectMapper();
-
- private AuditInventory auditInventory = new AuditInventory();
-
- Optional<AAIObjectAuditList> auditListOptSuccess;
-
- Optional<AAIObjectAuditList> auditListOptFailure;
-
- @Before
- public void setup() throws JsonParseException, JsonMappingException, IOException {
- auditInventory.setCloudOwner("cloudOwner");
- auditInventory.setCloudRegion("cloudRegion");
- auditInventory.setTenantId("tenantId");
- auditInventory.setHeatStackName("stackName");
- MockitoAnnotations.initMocks(this);
-
- AAIObjectAuditList auditListSuccess = objectMapper
- .readValue(new File("src/test/resources/ExpectedVServerFound.json"), AAIObjectAuditList.class);
- auditListOptSuccess = Optional.of(auditListSuccess);
-
- AAIObjectAuditList auditListFailure = objectMapper.readValue(
- new File("src/test/resources/Vserver2_Found_VServer1_Not_Found.json"), AAIObjectAuditList.class);
- auditListOptFailure = Optional.of(auditListFailure);
- String[] retrySequence = new String[8];
- retrySequence[0] = "1";
- retrySequence[1] = "1";
- retrySequence[2] = "2";
- retrySequence[3] = "3";
- retrySequence[4] = "5";
- retrySequence[5] = "8";
- retrySequence[6] = "13";
- retrySequence[7] = "20";
- doReturn(auditInventory).when(mockExternalTask).getVariable("auditInventory");
- doReturn("6000").when(mockEnv).getProperty("mso.workflow.topics.retryMultiplier", "6000");
- doReturn(retrySequence).when(mockEnv).getProperty("mso.workflow.topics.retrySequence", String[].class);
- doReturn("aasdfasdf").when(mockExternalTask).getId();
- }
-
- @Test
- public void execute_external_task_audit_success_Test() {
- doReturn(auditListOptSuccess).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId",
- "stackName");
- auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
- ArgumentCaptor<ExternalTask> taskCaptor = ArgumentCaptor.forClass(ExternalTask.class);
- Mockito.verify(mockExternalTaskService).complete(taskCaptor.capture(), captor.capture());
- Map actualMap = captor.getValue();
- assertEquals(true, actualMap.get("auditIsSuccessful"));
- assertNotNull(actualMap.get("auditInventoryResult"));
- }
-
- @Test
- public void executeExternalTaskQueryAuditTest() throws JsonProcessingException {
- doReturn(auditListOptSuccess).when(heatStackAuditMock).queryHeatStack("cloudOwner", "cloudRegion", "tenantId",
- "stackName");
- Mockito.doNothing().when(auditDataService).writeStackDataToRequestDb(Mockito.any(AuditInventory.class),
- Mockito.any(AAIObjectAuditList.class));
- auditQueryStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
- ArgumentCaptor<ExternalTask> taskCaptor = ArgumentCaptor.forClass(ExternalTask.class);
- Mockito.verify(mockExternalTaskService).complete(taskCaptor.capture(), captor.capture());
- Mockito.verify(auditDataService).writeStackDataToRequestDb(Mockito.any(AuditInventory.class),
- Mockito.any(AAIObjectAuditList.class));
- }
-
- @Test
- public void execute_external_task_audit_first_failure_Test() {
- doReturn(auditListOptFailure).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId",
- "stackName");
- doReturn(null).when(mockExternalTask).getRetries();
- auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- Mockito.verify(mockExternalTaskService).handleFailure(mockExternalTask,
- "Unable to find all VServers and L-Interaces in A&AI",
- "Unable to find all VServers and L-Interaces in A&AI", 8, 10000L);
- }
-
- @Test
- public void execute_external_task_audit_intermediate_failure_Test() {
- doReturn(auditListOptFailure).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId",
- "stackName");
- doReturn(6).when(mockExternalTask).getRetries();
- auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- Mockito.verify(mockExternalTaskService).handleFailure(mockExternalTask,
- "Unable to find all VServers and L-Interaces in A&AI",
- "Unable to find all VServers and L-Interaces in A&AI", 5, 12000L);
-
- }
-
- @Test
- public void execute_external_task_audit_final_failure_Test() {
- doReturn(auditListOptFailure).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId",
- "stackName");
- doReturn(1).when(mockExternalTask).getRetries();
- auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
- ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
- ArgumentCaptor<ExternalTask> taskCaptor = ArgumentCaptor.forClass(ExternalTask.class);
- Mockito.verify(mockExternalTaskService).complete(taskCaptor.capture(), captor.capture());
- Map actualMap = captor.getValue();
- assertEquals(false, actualMap.get("auditIsSuccessful"));
- assertNotNull(actualMap.get("auditInventoryResult"));
- }
-
- @Test
- public void determineAuditResult_Test() throws Exception {
- boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess.get());
- assertEquals(false, actual);
- }
-
- @Test
- public void determineAuditResult_Failure_Test() throws Exception {
- boolean actual = auditStackService.didCreateAuditFail(auditListOptFailure.get());
- assertEquals(true, actual);
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditVServerTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditVServerTest.java
deleted file mode 100644
index 2e496c50cd..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/AuditVServerTest.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017-2019 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 perservice2sions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.tasks.audit;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.HashSet;
-import java.util.Optional;
-import java.util.Set;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.aai.domain.yang.LInterface;
-import org.onap.aai.domain.yang.LInterfaces;
-import org.onap.aai.domain.yang.VfModule;
-import org.onap.aai.domain.yang.VfModules;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.aaiclient.client.aai.AAIObjectType;
-import org.onap.aaiclient.client.aai.AAIResourcesClient;
-import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
-import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
-import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
-import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
-import org.onap.so.objects.audit.AAIObjectAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.skyscreamer.jsonassert.JSONAssert;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@RunWith(MockitoJUnitRunner.Silent.class)
-public class AuditVServerTest extends AuditVServer {
-
- private ObjectMapper objectMapper = new ObjectMapper();
-
- @InjectMocks
- private AuditVServer auditNova = new AuditVServer();
-
- @Mock
- private AAIResourcesClient aaiResourcesMock;
-
- private String cloudOwner = "cloudOwner";
- private String cloudRegion = "cloudRegion";
- private String tenantId = "tenantId";
-
- private AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db"));
-
- private AAIResourceUri vserverURI2 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4dz"));
-
- private AAIResourceUri ssc_1_trusted_port_0_uri = AAIUriFactory.createResourceUri(
- AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId)
- .vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_trusted_port_0"));
-
- private AAIResourceUri ssc_1_service1_port_0_uri = AAIUriFactory.createResourceUri(
- AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId)
- .vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_service1_port_0"));
-
- private AAIResourceUri ssc_1_mgmt_port_1_uri = AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion)
- .tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_mgmt_port_1"));
-
- private AAIResourceUri ssc_1_mgmt_port_0_uri = AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion)
- .tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_mgmt_port_0"));
-
- private AAIResourceUri ssc_1_service2_port_0_uri = AAIUriFactory.createResourceUri(
- AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId)
- .vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_service2_port_0"));
-
- private AAIResourceUri ssc_1_int_ha_port_0_uri = AAIUriFactory.createResourceUri(
- AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId)
- .vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4db").lInterface("ssc_1_int_ha_port_0"));
-
- private AAIResourceUri test_port_1_uri = AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion)
- .tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4dz").lInterface("test_port_1"));
-
- private AAIResourceUri test_port_2_uri = AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion)
- .tenant(tenantId).vserver("3a4c2ca5-27b3-4ecc-98c5-06804867c4dz").lInterface("test_port_2"));
-
- private AAIResourceUri service2_sub_1_uri =
- AAIUriFactory.createResourceUri(AAIObjectType.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId,
- "3a4c2ca5-27b3-4ecc-98c5-06804867c4db", "ssc_1_service2_port_0", "service2_sub_interface_1");
-
- private AAIResourceUri service1_sub_0_uri =
- AAIUriFactory.createResourceUri(AAIObjectType.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId,
- "3a4c2ca5-27b3-4ecc-98c5-06804867c4db", "ssc_1_service1_port_0", "service1_sub_interface_1");
-
- private AAIResourceUri service1_sub_1_uri =
- AAIUriFactory.createResourceUri(AAIObjectType.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId,
- "3a4c2ca5-27b3-4ecc-98c5-06804867c4db", "ssc_1_service1_port_0", "service1_sub_interface_2");
-
-
-
- private Set<Vserver> vserversToAudit = new HashSet<>();
-
- LInterface test_port_1 = new LInterface();
- LInterface test_port_2 = new LInterface();
- LInterface ssc_1_int_ha_port_0 = new LInterface();
- LInterface service2_sub_interface_1 = new LInterface();
- LInterface ssc_1_service2_port_0 = new LInterface();
- LInterface ssc_1_mgmt_port_0 = new LInterface();
- LInterface ssc_1_mgmt_port_1 = new LInterface();
- LInterface service1_sub_interface_2 = new LInterface();
- LInterface service1_sub_interface_1 = new LInterface();
- LInterface ssc_1_service1_port_0 = new LInterface();
- LInterface ssc_1_trusted_port_0 = new LInterface();
-
-
-
- @Before
- public void setup() {
- objectMapper.setSerializationInclusion(Include.NON_NULL);
- auditNova.setAaiClient(aaiResourcesMock);
-
- Vserver vServer1 = new Vserver();
- vServer1.setVserverId("3a4c2ca5-27b3-4ecc-98c5-06804867c4db");
- LInterfaces vServer1Linterfaces = new LInterfaces();
- vServer1.setLInterfaces(vServer1Linterfaces);
-
- ssc_1_trusted_port_0.setInterfaceId("dec8bdc7-5718-41dc-bfbb-561ff6eeb81c");
- ssc_1_trusted_port_0.setInterfaceName("ssc_1_trusted_port_0");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_trusted_port_0);
-
-
- ssc_1_service1_port_0.setInterfaceId("1c56a24b-5f03-435a-850d-31cd4252de56");
- ssc_1_service1_port_0.setInterfaceName("ssc_1_service1_port_0");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_service1_port_0);
- ssc_1_service1_port_0.setLInterfaces(new LInterfaces());
-
-
- service1_sub_interface_1.setInterfaceId("0d9cd813-2ae1-46c0-9ebb-48081f6cffbb");
- service1_sub_interface_1.setInterfaceName("service1_sub_interface_1");
- ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_1);
-
-
- service1_sub_interface_2.setInterfaceId("b7019dd0-2ee9-4447-bdef-ac25676b205a");
- service1_sub_interface_2.setInterfaceName("service1_sub_interface_2");
- ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_2);
-
-
- ssc_1_mgmt_port_1.setInterfaceId("12afcd28-929f-4d80-8a5a-0833bfd5e20b");
- ssc_1_mgmt_port_1.setInterfaceName("ssc_1_mgmt_port_1");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_1);
-
- ssc_1_mgmt_port_0.setInterfaceId("80baec42-ffae-425f-ad8c-3f7b2c24bfff");
- ssc_1_mgmt_port_0.setInterfaceName("ssc_1_mgmt_port_0");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_0);
-
-
- ssc_1_service2_port_0.setLInterfaces(new LInterfaces());
- ssc_1_service2_port_0.setInterfaceId("13eddf95-4cf3-45f2-823a-2d890a6549b4");
- ssc_1_service2_port_0.setInterfaceName("ssc_1_service2_port_0");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_service2_port_0);
-
-
- service2_sub_interface_1.setInterfaceId("f711be16-2654-4a09-b89d-0511fda20e81");
- service2_sub_interface_1.setInterfaceName("service2_sub_interface_1");
- ssc_1_service2_port_0.getLInterfaces().getLInterface().add(service2_sub_interface_1);
-
-
- ssc_1_int_ha_port_0.setInterfaceId("9cab2903-70f7-44fd-b681-491d6ae2adb8");
- ssc_1_int_ha_port_0.setInterfaceName("ssc_1_int_ha_port_0");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_int_ha_port_0);
-
- Vserver vServer2 = new Vserver();
- vServer2.setVserverId("3a4c2ca5-27b3-4ecc-98c5-06804867c4dz");
- LInterfaces vServer2Linterfaces = new LInterfaces();
- vServer2.setLInterfaces(vServer2Linterfaces);
-
- test_port_1.setInterfaceId("9cab2903-70f7-44fd-b681-491d6ae2adz1");
- test_port_1.setInterfaceName("test_port_1");
-
-
- test_port_2.setInterfaceId("9cab2903-70f7-44fd-b681-491d6ae2adz2");
- test_port_2.setInterfaceName("test_port_2");
-
- vServer2.getLInterfaces().getLInterface().add(test_port_1);
- vServer2.getLInterfaces().getLInterface().add(test_port_2);
-
- vserversToAudit.add(vServer1);
- vserversToAudit.add(vServer2);
- }
-
- @Test
- public void audit_Vserver_Empty_HashSet() throws JsonParseException, JsonMappingException, IOException {
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(new HashSet<Vserver>(), tenantId, cloudOwner, cloudRegion);
- assertEquals(Optional.empty(), actual);
- }
-
- @Test
- public void audit_Vserver_Found_Test() throws JsonParseException, JsonMappingException, IOException {
- doReturn(true).when(aaiResourcesMock).exists(vserverURI);
- doReturn(true).when(aaiResourcesMock).exists(vserverURI2);
- doReturn(Optional.of(ssc_1_trusted_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_trusted_port_0_uri);
- doReturn(Optional.of(ssc_1_service1_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service1_port_0_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_1)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_1_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_0)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_0_uri);
- doReturn(Optional.of(ssc_1_service2_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service2_port_0_uri);
- doReturn(Optional.of(service2_sub_interface_1)).when(aaiResourcesMock).get(LInterface.class,
- service1_sub_1_uri);
- doReturn(Optional.of(ssc_1_int_ha_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_int_ha_port_0_uri);
- doReturn(Optional.of(test_port_1)).when(aaiResourcesMock).get(LInterface.class, test_port_1_uri);
- doReturn(Optional.of(test_port_2)).when(aaiResourcesMock).get(LInterface.class, test_port_2_uri);
-
- doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
-
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("ExpectedVServerFound.json");
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
- @Test
- public void audit_Vserver_Found_Test_Network_Not_Found()
- throws JsonParseException, JsonMappingException, IOException {
- doReturn(true).when(aaiResourcesMock).exists(vserverURI);
- doReturn(true).when(aaiResourcesMock).exists(vserverURI2);
- doReturn(Optional.of(ssc_1_trusted_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_trusted_port_0_uri);
- doReturn(Optional.of(ssc_1_service1_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service1_port_0_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_1)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_1_uri);
- doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_0_uri);
- doReturn(Optional.of(ssc_1_service2_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service2_port_0_uri);
- doReturn(Optional.of(ssc_1_int_ha_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_int_ha_port_0_uri);
- doReturn(Optional.of(test_port_1)).when(aaiResourcesMock).get(LInterface.class, test_port_1_uri);
- doReturn(Optional.of(test_port_2)).when(aaiResourcesMock).get(LInterface.class, test_port_2_uri);
-
- doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
-
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("VServer_Found_network_Not_Found.json");
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
- @Test
- public void audit_Vserver_Found_Test_Network_Not_Found_Second_Server()
- throws JsonParseException, JsonMappingException, IOException {
- doReturn(true).when(aaiResourcesMock).exists(vserverURI);
- doReturn(true).when(aaiResourcesMock).exists(vserverURI2);
- doReturn(Optional.of(ssc_1_trusted_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_trusted_port_0_uri);
- doReturn(Optional.of(ssc_1_service1_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service1_port_0_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_1)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_1_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_0)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_0_uri);
- doReturn(Optional.of(ssc_1_service2_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service2_port_0_uri);
- doReturn(Optional.of(ssc_1_int_ha_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_int_ha_port_0_uri);
- doReturn(Optional.of(test_port_1)).when(aaiResourcesMock).get(LInterface.class, test_port_1_uri);
- doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterface.class, test_port_2_uri);
- doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("VServer_Found_Network_Sec_Server_Not_Found.json");
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
- @Test
- public void audit_Vserver_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException {
- doReturn(false).when(aaiResourcesMock).exists(vserverURI);
- doReturn(false).when(aaiResourcesMock).exists(vserverURI2);
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("Vservers_Not_Found.json");
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
- @Test
- public void audit_Vserver_first_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException {
- doReturn(false).when(aaiResourcesMock).exists(vserverURI);
- doReturn(true).when(aaiResourcesMock).exists(vserverURI2);
- doReturn(Optional.of(test_port_1)).when(aaiResourcesMock).get(LInterface.class, test_port_1_uri);
- doReturn(Optional.of(test_port_2)).when(aaiResourcesMock).get(LInterface.class, test_port_2_uri);
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("Vserver2_Found_VServer1_Not_Found.json");
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
-
- @Test
- public void doesSubInterfaceExistinAAI_Test() {
- AAIResourceUri subInterfaceURI = AAIUriFactory.createResourceUri(AAIObjectType.SUB_L_INTERFACE, cloudOwner,
- cloudRegion, tenantId, "vserverId", "l-interface", "sub-interface");
-
- assertEquals(
- "/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner/cloudRegion/tenants/tenant/tenantId/vservers/vserver/vserverId/l-interfaces/l-interface/l-interface/l-interfaces/l-interface/sub-interface",
- subInterfaceURI.build().toString());
- }
-
- @Test
- public void audit_Vserver_Second_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException {
- doReturn(true).when(aaiResourcesMock).exists(vserverURI);
- doReturn(Optional.of(ssc_1_trusted_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_trusted_port_0_uri);
- doReturn(Optional.of(ssc_1_service1_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service1_port_0_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_1)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_1_uri);
- doReturn(Optional.of(ssc_1_mgmt_port_0)).when(aaiResourcesMock).get(LInterface.class, ssc_1_mgmt_port_0_uri);
- doReturn(Optional.of(ssc_1_service2_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_service2_port_0_uri);
- doReturn(Optional.of(ssc_1_int_ha_port_0)).when(aaiResourcesMock).get(LInterface.class,
- ssc_1_int_ha_port_0_uri);
- doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterface.class, test_port_1_uri);
- doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterface.class, test_port_2_uri);
- doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
- doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
-
- doReturn(false).when(aaiResourcesMock).exists(vserverURI2);
- Optional<AAIObjectAuditList> actual =
- auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
- String actualString = objectMapper.writeValueAsString(actual.get());
- String expected = getJson("VServer_Found_Sec_Server_Not_Found2.json");
-
- JSONAssert.assertEquals(expected, actualString, false);
- }
-
- @Test
- public void testAuditVserversWithList() {
-
- AAIObjectAuditList auditList = new AAIObjectAuditList();
- AAIObjectAudit obj1 = new AAIObjectAudit();
- Vserver vserver = new Vserver();
- vserver.setVserverId("testVserverId");
- obj1.setAaiObject(vserver);
- obj1.setResourceURI(
- AAIUriFactory
- .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver("testVserverId"))
- .build());
- auditList.getAuditList().add(obj1);
-
- doReturn(false).when(aaiResourcesMock).exists(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder
- .cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver("testVserverId")));
-
- auditNova.auditVservers(auditList);
-
- Mockito.verify(aaiResourcesMock).exists(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder
- .cloudInfrastructure().cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver("testVserverId")));
-
- Assert.assertEquals(false, auditList.getAuditList().get(0).isDoesObjectExist());
- }
-
- @Test
- public void testAuditVserversThroughRelationships() {
-
- VfModule vfModule = new VfModule();
- vfModule.setVfModuleId("id");
-
- AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
-
- doReturn(Optional.of(wrapper)).when(aaiResourcesMock).getFirstWrapper(VfModules.class, VfModule.class,
- AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("genericVnfId").vfModules())
- .queryParam("vf-module-name", "vfModuleName"));
-
- Optional<AAIObjectAuditList> auditList =
- auditNova.auditVserversThroughRelationships("genericVnfId", "vfModuleName");
-
- Assert.assertTrue(auditList.get().getAuditList().isEmpty());
- }
-
- @Test
- public void testAuditVserversThroughRelationships_exists() throws IOException {
-
- String vfModule = getJson("vfModule.json");
-
- AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
- AAIResultWrapper vserverWrapper = new AAIResultWrapper(new Vserver());
-
- doReturn(Optional.of(wrapper)).when(aaiResourcesMock).getFirstWrapper(VfModules.class, VfModule.class,
- AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("genericVnfId").vfModules())
- .queryParam("vf-module-name", "vfModuleName"));
-
- doReturn(vserverWrapper).when(aaiResourcesMock)
- .get(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
- .cloudRegion("cloud-owner", "cloud-region-id").tenant("tenant-id").vserver("VUSCHGA1")));
-
- Optional<AAIObjectAuditList> auditList =
- auditNova.auditVserversThroughRelationships("genericVnfId", "vfModuleName");
-
- Assert.assertFalse(auditList.get().getAuditList().isEmpty());
- }
-
-
- private String getJson(String filename) throws IOException {
- return new String(Files.readAllBytes(Paths.get("src/test/resources/" + filename)));
- }
-
-
-
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/HeatStackAuditTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/HeatStackAuditTest.java
deleted file mode 100644
index d1d0d96042..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/audit/HeatStackAuditTest.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017-2019 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.so.adapters.tasks.audit;
-
-import static com.shazam.shazamcrest.MatcherAssert.assertThat;
-import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.aai.domain.yang.LInterface;
-import org.onap.aai.domain.yang.LInterfaces;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.so.adapters.tasks.audit.AuditVServer;
-import org.onap.so.adapters.tasks.audit.HeatStackAudit;
-import org.onap.so.objects.audit.AAIObjectAuditList;
-import org.onap.so.openstack.utils.MsoHeatUtils;
-import org.onap.so.openstack.utils.MsoNeutronUtils;
-import org.skyscreamer.jsonassert.JSONAssert;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.woorea.openstack.heat.model.Resource;
-import com.woorea.openstack.heat.model.Resources;
-import com.woorea.openstack.heat.model.Stack;
-import com.woorea.openstack.quantum.model.Port;
-
-
-@RunWith(MockitoJUnitRunner.Silent.class)
-public class HeatStackAuditTest extends HeatStackAudit {
-
- @InjectMocks
- private HeatStackAudit heatStackAudit = new HeatStackAudit();
-
- @Mock
- private MsoHeatUtils msoHeatUtilsMock;
-
- @Mock
- private MsoNeutronUtils neutronUtilsMock;
-
- @Mock
- private AuditVServer auditVserver;
-
- private static final String cloudRegion = "cloudRegion";
- private static final String tenantId = "tenantId";
-
- private Resources resources = new Resources();
-
- private ObjectMapper objectMapper =
- new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
- .setSerializationInclusion(Include.NON_NULL);
-
- private ObjectMapper stackObjectMapper = new ObjectMapper()
- .configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true).setSerializationInclusion(Include.NON_NULL);
-
- private List<Optional<Port>> portList = new ArrayList<>();
-
- @Before
- public void setup() throws Exception {
- resources = objectMapper.readValue(new File("src/test/resources/GetResources.json"), Resources.class);
- Port neutronPort1 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort1.json"), Port.class);
- doReturn(Optional.of(neutronPort1)).when(neutronUtilsMock)
- .getNeutronPort("7ee06d9d-3d18-411c-9d3e-aec930f70413", cloudRegion, tenantId);
- Port neutronPort2 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort2.json"), Port.class);
- doReturn(Optional.of(neutronPort2)).when(neutronUtilsMock)
- .getNeutronPort("27391d94-33af-474a-927d-d409249e8fd3", cloudRegion, tenantId);
- Port neutronPort3 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort3.json"), Port.class);
- doReturn(Optional.of(neutronPort3)).when(neutronUtilsMock)
- .getNeutronPort("fdeedf37-c01e-4ab0-bdd6-8d5fc4913943", cloudRegion, tenantId);
- Port neutronPort4 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort4.json"), Port.class);
- doReturn(Optional.of(neutronPort4)).when(neutronUtilsMock)
- .getNeutronPort("8d93f63e-e972-48c7-ad98-b2122da47315", cloudRegion, tenantId);
- Port neutronPort5 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort5.json"), Port.class);
- doReturn(Optional.of(neutronPort5)).when(neutronUtilsMock)
- .getNeutronPort("0594a2f2-7ea4-42eb-abc2-48ea49677fca", cloudRegion, tenantId);
- Port neutronPort6 = stackObjectMapper.readValue(new File("src/test/resources/NeutronPort6.json"), Port.class);
- doReturn(Optional.of(neutronPort6)).when(neutronUtilsMock)
- .getNeutronPort("00bb8407-650e-48b5-b919-33b88d6f8fe3", cloudRegion, tenantId);
-
-
- portList.add(Optional.empty());
- portList.add(Optional.of(neutronPort1));
- portList.add(Optional.of(neutronPort2));
- portList.add(Optional.of(neutronPort3));
- portList.add(Optional.of(neutronPort4));
- portList.add(Optional.of(neutronPort5));
- portList.add(Optional.of(neutronPort6));
- }
-
- @Test
- public void extract_proper_path_Test() {
- Optional<String> actualResult = extractStackPathFromHref(
- "https://orchestration.com:8004/v1/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81");
- assertEquals("/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81", actualResult.get());
- }
-
- @Test
- public void extract_proper_resources_path_Test() {
- Optional<String> actualResult = extractResourcePathFromHref(
- "https://orchestration.com:8004/v1/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81");
- assertEquals("/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81/resources", actualResult.get());
- }
-
- @Test
- public void extract_invalid_uri_Test() {
- Optional<String> actualResult = extractStackPathFromHref(
- "orchestrn.com:8004/v18b44d60a6f94bdcb2738f9e//stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81");
- assertEquals(false, actualResult.isPresent());
- }
-
- @Test
- public void createVserverSet_Test() throws Exception {
- List<Resource> novaResources = resources.getList().stream().filter(p -> "OS::Nova::Server".equals(p.getType()))
- .collect(Collectors.toList());
-
- List<Resource> resourceGroups = resources.getList().stream()
- .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType())).collect(Collectors.toList());
-
- Resources service1QueryResponse = objectMapper
- .readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class);
- doReturn(service1QueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources",
- cloudRegion, tenantId, Resources.class);
-
- Resources service2QueryResponse = objectMapper
- .readValue(new File("src/test/resources/Service2ResourceGroupResponse.json"), Resources.class);
- doReturn(service2QueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources",
- cloudRegion, tenantId, Resources.class);
-
-
- Stack service2StackQuerySubInt =
- stackObjectMapper.readValue(new File("src/test/resources/Service2SubInterface0.json"), Stack.class);
- doReturn(service2StackQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81",
- cloudRegion, tenantId, Stack.class);
- Resources service2ResourceQuerySubInt = objectMapper
- .readValue(new File("src/test/resources/Service2SubInterface1Resources.json"), Resources.class);
- doReturn(service2ResourceQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources",
- cloudRegion, tenantId, Resources.class);
-
- Stack service1StackQuerySubInt1 =
- stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface0.json"), Stack.class);
- doReturn(service1StackQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb",
- cloudRegion, tenantId, Stack.class);
- Resources service1ResourceQuerySubInt1 = objectMapper
- .readValue(new File("src/test/resources/Service1SubInterface0Resources.json"), Resources.class);
- doReturn(service1ResourceQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb/resources",
- cloudRegion, tenantId, Resources.class);
-
-
- Stack service1StackQuerySubInt2 =
- stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface1.json"), Stack.class);
- doReturn(service1StackQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a",
- cloudRegion, tenantId, Stack.class);
- Resources service1ResourceQuerySubInt2 = objectMapper
- .readValue(new File("src/test/resources/Service1SubInterface1Resources.json"), Resources.class);
- doReturn(service1ResourceQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a/resources",
- cloudRegion, tenantId, Resources.class);
-
- Stack service1StackQuerySubInt3 =
- stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface2.json"), Stack.class);
- doReturn(service1StackQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c",
- cloudRegion, tenantId, Stack.class);
- Resources service1ResourceQuerySubInt3 = objectMapper
- .readValue(new File("src/test/resources/Service1SubInterface2Resources.json"), Resources.class);
- doReturn(service1ResourceQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest(
- "/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c/resources",
- cloudRegion, tenantId, Resources.class);
-
- Set<Vserver> vServersToAudit = heatStackAudit.createVserverSet(resources, novaResources, portList);
- Set<Vserver> vserversWithSubInterfaces =
- heatStackAudit.processSubInterfaces(cloudRegion, tenantId, resourceGroups, vServersToAudit);
-
- String actualValue = objectMapper.writeValueAsString(vserversWithSubInterfaces);
- String expectedValue = getJson("ExpectedVserversToAudit.json");
- JSONAssert.assertEquals(expectedValue, actualValue, false);
- }
-
- @Test
- public void auditHeatStackNoServers_Test() throws Exception {
- Resources getResource = objectMapper
- .readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class);
- doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion, tenantId, "heatStackName", 3);
-
- Optional<AAIObjectAuditList> actual =
- heatStackAudit.auditHeatStack(cloudRegion, "cloudOwner", tenantId, "heatStackName");
- assertEquals(true, actual.get().getAuditList().isEmpty());
- }
-
- @Test
- public void auditHeatStackNestedServers_Test() throws Exception {
- Resources getResource =
- objectMapper.readValue(new File("src/test/resources/GetNestedResources.json"), Resources.class);
- List<Resource> novaResources = getResource.getList().stream()
- .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
- List<Resource> resourceGroups = getResource.getList().stream()
- .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType())).collect(Collectors.toList());
-
- doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion, tenantId, "heatStackName", 3);
- Set<Vserver> vServersToAudit = heatStackAudit.createVserverSet(resources, novaResources, portList);
- Set<Vserver> vserversWithSubInterfaces =
- heatStackAudit.processSubInterfaces(cloudRegion, tenantId, resourceGroups, vServersToAudit);
- String actualValue = objectMapper.writeValueAsString(vserversWithSubInterfaces);
- String expectedValue = getJson("NestedExpectedValue.json");
- JSONAssert.assertEquals(expectedValue, actualValue, false);
- }
-
-
- @Test
- public void findInterfaceInformation_Test() {
- List<Resource> novaResources = resources.getList().stream().filter(p -> "OS::Nova::Server".equals(p.getType()))
- .collect(Collectors.toList());
- Set<Vserver> expectedVservers = new HashSet<>();
- Vserver vServer1 = new Vserver();
- vServer1.setVserverId("92272b67-d23f-42ca-87fa-7b06a9ec81f3");
- LInterfaces vServer1Linterfaces = new LInterfaces();
- vServer1.setLInterfaces(vServer1Linterfaces);
-
- LInterface ssc_1_trusted_port_0 = new LInterface();
- ssc_1_trusted_port_0.setInterfaceId("7ee06d9d-3d18-411c-9d3e-aec930f70413");
- ssc_1_trusted_port_0.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_trusted_port_0);
-
- LInterface ssc_1_svc2_port_0 = new LInterface();
- ssc_1_svc2_port_0.setInterfaceId("27391d94-33af-474a-927d-d409249e8fd3");
- ssc_1_svc2_port_0.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_svc2_port_0);
-
- LInterface ssc_1_mgmt_port_1 = new LInterface();
- ssc_1_mgmt_port_1.setInterfaceId("fdeedf37-c01e-4ab0-bdd6-8d5fc4913943");
- ssc_1_mgmt_port_1.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_1);
-
- LInterface ssc_1_mgmt_port_0 = new LInterface();
- ssc_1_mgmt_port_0.setInterfaceId("8d93f63e-e972-48c7-ad98-b2122da47315");
- ssc_1_mgmt_port_0.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_0);
-
- LInterface ssc_1_svc1_port_0 = new LInterface();
- ssc_1_svc1_port_0.setInterfaceId("0594a2f2-7ea4-42eb-abc2-48ea49677fca");
- ssc_1_svc1_port_0.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_svc1_port_0);
-
- LInterface ssc_1_int_ha_port_0 = new LInterface();
- ssc_1_int_ha_port_0.setInterfaceId("00bb8407-650e-48b5-b919-33b88d6f8fe3");
- ssc_1_int_ha_port_0.setInterfaceName("ibcx0026v_ibcx0026vm003_untrusted_port");
- vServer1.getLInterfaces().getLInterface().add(ssc_1_int_ha_port_0);
-
- expectedVservers.add(vServer1);
-
- Set<Vserver> actualVservers = heatStackAudit.createVserverSet(resources, novaResources, portList);
-
- assertThat(actualVservers, sameBeanAs(expectedVservers));
- }
-
- private String getJson(String filename) throws IOException {
- return new String(Files.readAllBytes(Paths.get("src/test/resources/" + filename)));
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index 531496cc8f..309a143e32 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -102,6 +102,8 @@ import org.openstack4j.model.network.Port;
import org.openstack4j.model.network.Subnet;
import org.openstack4j.openstack.heat.domain.HeatResource;
import org.openstack4j.openstack.heat.domain.HeatResource.Resources;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -118,6 +120,8 @@ public class HeatBridgeImplTest {
private static final String TENANT_ID = "7320ec4a5b9d4589ba7c4412ccfd290f";
private static final ObjectMapper MAPPER = new ObjectMapper();
+ private static Logger logger = LoggerFactory.getLogger(HeatBridgeImplTest.class);
+
@Mock
private OpenstackClient osClient;
@@ -139,6 +143,12 @@ public class HeatBridgeImplTest {
private Server server;
@Mock
+ private Server server2;
+
+ @Mock
+ private Image image;
+
+ @Mock
private AAIDSLQueryClient dSLQueryClient;
@Spy
@@ -205,7 +215,7 @@ public class HeatBridgeImplTest {
// Assert
ArgumentCaptor<AAIResourceUri> captor = ArgumentCaptor.forClass(AAIResourceUri.class);
- verify(transaction, times(2)).createIfNotExists(captor.capture(), any(Optional.class));
+ verify(transaction, times(2)).create(captor.capture(), any());
List<AAIResourceUri> uris = captor.getAllValues();
assertEquals(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
@@ -249,7 +259,7 @@ public class HeatBridgeImplTest {
// Assert
ArgumentCaptor<AAIResourceUri> captor = ArgumentCaptor.forClass(AAIResourceUri.class);
- verify(transaction, times(2)).createIfNotExists(captor.capture(), any(Optional.class));
+ verify(transaction, times(2)).create(captor.capture(), any());
List<AAIResourceUri> uris = captor.getAllValues();
assertEquals(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
@@ -529,7 +539,7 @@ public class HeatBridgeImplTest {
when(resourcesClient.get(eq(PInterface.class), any(AAIResourceUri.class))).thenReturn(Optional.of(pIf));
// Act
- heatbridge.updateLInterfaceVlan(port, lIf, "hostname");
+ heatbridge.createVlanAndSriovVF(port, lIf, "hostname");
// Assert
verify(transaction, times(2)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
@@ -615,7 +625,7 @@ public class HeatBridgeImplTest {
PInterface pIf = mock(PInterface.class);
when(pIf.getInterfaceName()).thenReturn("test-port-id");
- doNothing().when(heatbridge).updateSriovPfToPserver(any(), any());
+ doNothing().when(heatbridge).updateSriovPfToSriovVF(any(), any());
// Act
heatbridge.buildAddVserverLInterfacesToAaiAction(stackResources, Arrays.asList("1", "2"), "CloudOwner");
@@ -626,6 +636,25 @@ public class HeatBridgeImplTest {
verify(osClient, times(5)).getNetworkById(anyString());
}
+
+ @Test
+ public void testExtractOpenstackImagesFromServers() throws HeatBridgeException {
+ // Arrange
+ List<Server> serverList = new ArrayList<>();
+ serverList.add(server);
+ serverList.add(server2);
+ when(server.getImage()).thenReturn(null);
+ when(server.getImage()).thenReturn(image);
+ when(image.getId()).thenReturn("imageId");
+ // Act
+
+ List<Image> images = heatbridge.extractOpenstackImagesFromServers(serverList);
+
+
+ // Assert
+ assertEquals(1, images.size());
+ }
+
private List<? extends Resource> extractTestStackResources() {
List<HeatResource> stackResources = null;
try {
@@ -638,6 +667,7 @@ public class HeatBridgeImplTest {
return stackResources;
}
+
private String readTestResourceFile(String filePath) {
String content = null;
String pathname = Objects.requireNonNull(getClass().getClassLoader().getResource(filePath)).getFile();
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index 44ea2a25a2..02b1df79dd 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -978,7 +978,7 @@ public class ASDCController {
String artifactContent = null;
List<IArtifactInfo> serviceArtifacts = iNotif.getServiceArtifacts();
Optional<IArtifactInfo> artifactOpt = serviceArtifacts.stream()
- .filter(e -> e.getArtifactType().equalsIgnoreCase("OTHER")).findFirst();
+ .filter(e -> e.getArtifactType().equalsIgnoreCase("WORKFLOW")).findFirst();
if (artifactOpt.isPresent()) {
IArtifactInfo artifactInfo = artifactOpt.get();
logger.debug("Ready to parse this serviceArtifactUUID: " + artifactInfo.getArtifactUUID());
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/etsi/pkg/processor/EtsiResourcePackageProcessor.java b/asdc-controller/src/main/java/org/onap/so/asdc/etsi/pkg/processor/EtsiResourcePackageProcessor.java
index bb7197b7a4..4205de3cab 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/etsi/pkg/processor/EtsiResourcePackageProcessor.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/etsi/pkg/processor/EtsiResourcePackageProcessor.java
@@ -44,7 +44,7 @@ import com.google.common.collect.ImmutableSet;
public class EtsiResourcePackageProcessor {
private final static Logger LOGGER = LoggerFactory.getLogger(EtsiResourcePackageProcessor.class);
- private static final String ONBOARDED_PACKAGE_DIR_PATH = "Artifacts/Deployment/ONBOARDED_PACKAGE";
+ private static final String ONBOARDED_PACKAGE_DIR_PATH = "Artifacts/Deployment/ETSI_PACKAGE";
private final SdcResourceProvider sdcResourceProvider;
private final EtsiCatalogServiceProvider catalogServiceProvider;
private static final int SLEEP_TIME_IN_SECONDS = 5;
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 49fef1d3f0..d57b305902 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -2913,15 +2913,19 @@ public class ToscaResourceInstaller {
}
private void createServiceArtifact(Service service, VfResourceStructure vfResourceStruct, String artifactContent) {
+ if (null == vfResourceStruct) {
+ return;
+ }
List<ServiceArtifact> serviceArtifactList = new ArrayList<>();
ServiceArtifact serviceArtifact;
List<IArtifactInfo> artifactInfoList = vfResourceStruct.getNotification().getServiceArtifacts().stream()
- .filter(artifact -> artifact.getArtifactType().equalsIgnoreCase("OTHER")).collect(Collectors.toList());
+ .filter(artifact -> artifact.getArtifactType().equalsIgnoreCase("WORKFLOW"))
+ .collect(Collectors.toList());
for (IArtifactInfo artifactInfo : artifactInfoList) {
serviceArtifact = new ServiceArtifact();
serviceArtifact.setArtifactUUID(artifactInfo.getArtifactUUID());
serviceArtifact.setName(artifactInfo.getArtifactName());
- serviceArtifact.setType(artifactInfo.getArtifactType());
+ serviceArtifact.setType("OTHER");
serviceArtifact.setVersion(artifactInfo.getArtifactVersion());
serviceArtifact.setDescription(artifactInfo.getArtifactDescription());
serviceArtifact.setChecksum(artifactInfo.getArtifactChecksum());
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/SdcNotificationWithSol004PackageTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/SdcNotificationWithSol004PackageTest.java
index cb5bd0f51a..2e8da35f3e 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/client/SdcNotificationWithSol004PackageTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/SdcNotificationWithSol004PackageTest.java
@@ -345,7 +345,7 @@ public class SdcNotificationWithSol004PackageTest extends BaseTest {
* Mock the AAI using wireshark.
*/
private void initMockAaiServer(final String serviceUuid, final String serviceInvariantUuid) {
- final String modelEndpoint = "/aai/v19/service-design-and-creation/models/model/" + serviceInvariantUuid
+ final String modelEndpoint = "/aai/v21/service-design-and-creation/models/model/" + serviceInvariantUuid
+ "/model-vers/model-ver/" + serviceUuid + "?depth=0";
wireMockServer.stubFor(post(urlEqualTo(modelEndpoint)).willReturn(ok()));
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml
index 6499a58fab..6499a58fab 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VENDOR_LICENSE/vendor-license-model.xml
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VF_LICENSE/vf-license-model.xml b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VF_LICENSE/vf-license-model.xml
index 581a3acb7f..581a3acb7f 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/VF_LICENSE/vf-license-model.xml
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/VF_LICENSE/vf-license-model.xml
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/vgw6.csar b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/vgw6.csar
index 56dbb2bce0..56dbb2bce0 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/ONBOARDED_PACKAGE/vgw6.csar
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/ETSI_PACKAGE/vgw6.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/SDC_RESOURCE_CSAR/vgw_sdc_resource.csar b/asdc-controller/src/test/resources/resource-examples/vgw/SDC_RESOURCE_CSAR/vgw_sdc_resource.csar
index 7ddfb6ef51..9eb240d9a7 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/SDC_RESOURCE_CSAR/vgw_sdc_resource.csar
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/SDC_RESOURCE_CSAR/vgw_sdc_resource.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/dmaap-notification-message.json b/asdc-controller/src/test/resources/resource-examples/vgw/dmaap-notification-message.json
index d936cd1144..8c42c9c3e9 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/dmaap-notification-message.json
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/dmaap-notification-message.json
@@ -29,8 +29,8 @@
},
{
"artifactName": "vgw6.csar",
- "artifactType": "ONBOARDED_PACKAGE",
- "artifactURL": "/ONBOARDED_PACKAGE/vgw6.csar",
+ "artifactType": "ETSI_PACKAGE",
+ "artifactURL": "/ETSI_PACKAGE/vgw6.csar",
"artifactChecksum": "NjdmNGU3ZDlkODQ0YTUzMTU5NjZmOThiYjMxNTJiNGI\u003d",
"artifactDescription": "Artifact created from csar",
"artifactTimeout": 120,
diff --git a/asdc-controller/src/test/resources/resource-examples/vgw/service-Vgwservicev1-csar.csar b/asdc-controller/src/test/resources/resource-examples/vgw/service-Vgwservicev1-csar.csar
index 51a9e19466..eaed092b00 100644
--- a/asdc-controller/src/test/resources/resource-examples/vgw/service-Vgwservicev1-csar.csar
+++ b/asdc-controller/src/test/resources/resource-examples/vgw/service-Vgwservicev1-csar.csar
Binary files differ
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java
index 62a2e9370e..57b8c1387d 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java
@@ -30,6 +30,7 @@ public abstract class Resource extends JsonWrapper implements Serializable {
private static final long serialVersionUID = 1L;
private String resourceId; // TODO name this field just id instead, should be the id of the object as it is in aai
+ private String originalResourceId;
protected ResourceType resourceType; // Enum of vnf or network or allotted resource
protected ModelInfo modelInfo;
private long concurrencyCounter = 1L;
@@ -52,6 +53,14 @@ public abstract class Resource extends JsonWrapper implements Serializable {
this.resourceId = resourceId;
}
+ public String getOriginalResourceId() {
+ return originalResourceId;
+ }
+
+ public void setOriginalResourceId(String originalResourceId) {
+ this.originalResourceId = originalResourceId;
+ }
+
public ModelInfo getModelInfo() {
return modelInfo;
}
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
index 01caf38610..383fd27b56 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
@@ -2,14 +2,13 @@
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0">
<bpmn:process id="ActivateVfModuleBB" name="ActivateVfModuleBB" isExecutable="true">
<bpmn:startEvent id="ActivateVfModuleBB_Start">
- <bpmn:outgoing>SequenceFlow_0ieafii</bpmn:outgoing>
+ <bpmn:outgoing>Flow_1hz7ga1</bpmn:outgoing>
</bpmn:startEvent>
- <bpmn:sequenceFlow id="SequenceFlow_0ieafii" sourceRef="ActivateVfModuleBB_Start" targetRef="CheckAuditVariable" />
<bpmn:endEvent id="ActivateVfModuleBB_End">
<bpmn:incoming>SequenceFlow_0xsp0pv</bpmn:incoming>
</bpmn:endEvent>
<bpmn:serviceTask id="ActivateVfModule" name="&#10;SDNC&#10;Activate&#10;(vf module)&#10;" camunda:expression="${SDNCActivateTasks.activateVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_1b63lv4</bpmn:incoming>
+ <bpmn:incoming>Flow_1hz7ga1</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1a495wm</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="UpdateVfModuleActiveStatus" name="&#10;AAI&#10;Update&#10;(vf module)&#10;" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusActivateVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
@@ -29,64 +28,7 @@
</bpmn:callActivity>
<bpmn:sequenceFlow id="SequenceFlow_1a495wm" sourceRef="ActivateVfModule" targetRef="CallActivity_sdncHandler" />
<bpmn:sequenceFlow id="SequenceFlow_1j4x1ej" sourceRef="CallActivity_sdncHandler" targetRef="UpdateVfModuleActiveStatus" />
- <bpmn:sequenceFlow id="SequenceFlow_0xndboi" sourceRef="Setup_AAI_Inventory_Audit" targetRef="Audit_AAI_Inventory" />
- <bpmn:serviceTask id="Setup_AAI_Inventory_Audit" name="Setup Inventory Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_0ghzwlo</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0xndboi</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:serviceTask id="Audit_AAI_Inventory" name="Validate A&#38;AI Inventory" camunda:type="external" camunda:topic="InventoryAddAudit">
- <bpmn:incoming>SequenceFlow_0xndboi</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0l8684g</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_07ybdik" name="No" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="ExclusiveGateway_0sqvzll" />
- <bpmn:sequenceFlow id="SequenceFlow_0ghzwlo" name="Yes" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="Setup_AAI_Inventory_Audit">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:serviceTask id="CheckAuditVariable" name="Check Audit Variable" camunda:expression="${AuditTasks.isAuditNeeded(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_0ieafii</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1xqyur9</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1xqyur9" sourceRef="CheckAuditVariable" targetRef="ExclusiveGateway_1v8bmbu" />
- <bpmn:sequenceFlow id="SequenceFlow_1b63lv4" sourceRef="ExclusiveGateway_0sqvzll" targetRef="ActivateVfModule" />
- <bpmn:subProcess id="SubProcess_0bpsptg" name="Audit Exception Sub Process" triggeredByEvent="true">
- <bpmn:startEvent id="catchInventoryException">
- <bpmn:outgoing>SequenceFlow_19gbhlj</bpmn:outgoing>
- <bpmn:errorEventDefinition errorRef="Error_1s3kxze" />
- </bpmn:startEvent>
- <bpmn:endEvent id="EndEvent_067jv1n">
- <bpmn:incoming>SequenceFlow_0l4jzc5</bpmn:incoming>
- </bpmn:endEvent>
- <bpmn:sequenceFlow id="SequenceFlow_19gbhlj" sourceRef="catchInventoryException" targetRef="processAuditException" />
- <bpmn:sequenceFlow id="SequenceFlow_0l4jzc5" sourceRef="processAuditException" targetRef="EndEvent_067jv1n" />
- <bpmn:serviceTask id="processAuditException" name="Proccess Error" camunda:expression="${ExceptionBuilder.processAuditException(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)), false)}">
- <bpmn:incoming>SequenceFlow_19gbhlj</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0l4jzc5</bpmn:outgoing>
- </bpmn:serviceTask>
- </bpmn:subProcess>
- <bpmn:inclusiveGateway id="ExclusiveGateway_1v8bmbu" name="Audit Enabled?" default="SequenceFlow_07ybdik">
- <bpmn:incoming>SequenceFlow_1xqyur9</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_07ybdik</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_0ghzwlo</bpmn:outgoing>
- </bpmn:inclusiveGateway>
- <bpmn:inclusiveGateway id="ExclusiveGateway_0sqvzll">
- <bpmn:incoming>SequenceFlow_07ybdik</bpmn:incoming>
- <bpmn:incoming>Flow_1c5mrjc</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1b63lv4</bpmn:outgoing>
- </bpmn:inclusiveGateway>
- <bpmn:sequenceFlow id="SequenceFlow_0l8684g" sourceRef="Audit_AAI_Inventory" targetRef="Gateway_1518atw" />
- <bpmn:exclusiveGateway id="Gateway_1518atw" name="Audit Failed?" default="Flow_1c5mrjc">
- <bpmn:incoming>SequenceFlow_0l8684g</bpmn:incoming>
- <bpmn:outgoing>Flow_1c5mrjc</bpmn:outgoing>
- <bpmn:outgoing>Flow_02xnvmz</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:sequenceFlow id="Flow_1c5mrjc" sourceRef="Gateway_1518atw" targetRef="ExclusiveGateway_0sqvzll" />
- <bpmn:sequenceFlow id="Flow_02xnvmz" sourceRef="Gateway_1518atw" targetRef="Event_1ubxkat">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:endEvent id="Event_1ubxkat">
- <bpmn:incoming>Flow_02xnvmz</bpmn:incoming>
- <bpmn:errorEventDefinition id="ErrorEventDefinition_0qq1s4r" errorRef="Error_1s3kxze" />
- </bpmn:endEvent>
+ <bpmn:sequenceFlow id="Flow_1hz7ga1" sourceRef="ActivateVfModuleBB_Start" targetRef="ActivateVfModule" />
</bpmn:process>
<bpmn:error id="Error_0q258vt" errorCode="7000" />
<bpmn:error id="Error_0zgccif" name="org.onap.so.adapters.inventory.create.InventoryException" errorCode="org.onap.so.adapters.inventory.create.InventoryException" />
@@ -94,167 +36,51 @@
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ActivateVfModuleBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="ActivateVfModuleBB_Start">
- <dc:Bounds x="156" y="260" width="36" height="36" />
+ <dc:Bounds x="156" y="100" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="58" y="270" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0ieafii_di" bpmnElement="SequenceFlow_0ieafii">
- <di:waypoint x="192" y="278" />
- <di:waypoint x="272" y="278" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="116" y="231" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1v967li_di" bpmnElement="ActivateVfModuleBB_End">
- <dc:Bounds x="1475" y="261" width="36" height="36" />
+ <dc:Bounds x="736" y="101" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1235" y="275" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0hawa84_di" bpmnElement="ActivateVfModule">
- <dc:Bounds x="1029" y="238" width="100" height="80" />
+ <dc:Bounds x="290" y="78" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_175e9ul_di" bpmnElement="UpdateVfModuleActiveStatus">
- <dc:Bounds x="1285" y="238" width="100" height="80" />
+ <dc:Bounds x="546" y="78" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0xsp0pv_di" bpmnElement="SequenceFlow_0xsp0pv">
- <di:waypoint x="1385" y="278" />
- <di:waypoint x="1475" y="279" />
+ <di:waypoint x="646" y="118" />
+ <di:waypoint x="736" y="119" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1314" y="231.5" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_03jkesd_di" bpmnElement="CallActivity_sdncHandler">
- <dc:Bounds x="1157" y="238" width="100" height="80" />
+ <dc:Bounds x="418" y="78" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1a495wm_di" bpmnElement="SequenceFlow_1a495wm">
- <di:waypoint x="1129" y="278" />
- <di:waypoint x="1157" y="278" />
+ <di:waypoint x="390" y="118" />
+ <di:waypoint x="418" y="118" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1027" y="231" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1j4x1ej_di" bpmnElement="SequenceFlow_1j4x1ej">
- <di:waypoint x="1257" y="278" />
- <di:waypoint x="1285" y="278" />
+ <di:waypoint x="518" y="118" />
+ <di:waypoint x="546" y="118" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1155" y="231" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0xndboi_di" bpmnElement="SequenceFlow_0xndboi">
- <di:waypoint x="589" y="201" />
- <di:waypoint x="630" y="201" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="457" y="153.5" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_0krf1ur_di" bpmnElement="Setup_AAI_Inventory_Audit">
- <dc:Bounds x="489" y="161" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_08rxjeb_di" bpmnElement="Audit_AAI_Inventory">
- <dc:Bounds x="630" y="161" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_07ybdik_di" bpmnElement="SequenceFlow_07ybdik">
- <di:waypoint x="426" y="303" />
- <di:waypoint x="426" y="341" />
- <di:waypoint x="952" y="341" />
- <di:waypoint x="952" y="303" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="435" y="320" width="15" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0ghzwlo_di" bpmnElement="SequenceFlow_0ghzwlo">
- <di:waypoint x="426" y="253" />
- <di:waypoint x="426" y="201" />
- <di:waypoint x="489" y="201" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="434" y="211" width="18" height="14" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNEdge id="Flow_1hz7ga1_di" bpmnElement="Flow_1hz7ga1">
+ <di:waypoint x="192" y="118" />
+ <di:waypoint x="290" y="118" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_1eg5ryx_di" bpmnElement="CheckAuditVariable">
- <dc:Bounds x="272" y="238" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1xqyur9_di" bpmnElement="SequenceFlow_1xqyur9">
- <di:waypoint x="372" y="278" />
- <di:waypoint x="401" y="278" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="270.5" y="230.5" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1b63lv4_di" bpmnElement="SequenceFlow_1b63lv4">
- <di:waypoint x="977" y="278" />
- <di:waypoint x="1029" y="278" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="887" y="231" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="SubProcess_0mbkb7v_di" bpmnElement="SubProcess_0bpsptg" isExpanded="true">
- <dc:Bounds x="364" y="475" width="350" height="200" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="StartEvent_12r96di_di" bpmnElement="catchInventoryException">
- <dc:Bounds x="395" y="558" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="341.15269461077844" y="571.6127744510978" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_067jv1n_di" bpmnElement="EndEvent_067jv1n">
- <dc:Bounds x="643" y="558" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="590.1526946107784" y="572" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_19gbhlj_di" bpmnElement="SequenceFlow_19gbhlj">
- <di:waypoint x="431" y="576" />
- <di:waypoint x="486" y="576" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="387.5" y="529" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0l4jzc5_di" bpmnElement="SequenceFlow_0l4jzc5">
- <di:waypoint x="586" y="576" />
- <di:waypoint x="643" y="576" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="543.5" y="529" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_08xffml_di" bpmnElement="processAuditException">
- <dc:Bounds x="486" y="536" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="InclusiveGateway_03pi9y4_di" bpmnElement="ExclusiveGateway_1v8bmbu">
- <dc:Bounds x="401" y="253" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="454" y="272" width="74" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="InclusiveGateway_16ap4e3_di" bpmnElement="ExclusiveGateway_0sqvzll">
- <dc:Bounds x="927" y="253" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="836" y="281" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0l8684g_di" bpmnElement="SequenceFlow_0l8684g">
- <di:waypoint x="730" y="201" />
- <di:waypoint x="785" y="201" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="Gateway_1518atw_di" bpmnElement="Gateway_1518atw" isMarkerVisible="true">
- <dc:Bounds x="785" y="176" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="780" y="233" width="64" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="Flow_1c5mrjc_di" bpmnElement="Flow_1c5mrjc">
- <di:waypoint x="835" y="201" />
- <di:waypoint x="952" y="201" />
- <di:waypoint x="952" y="253" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_02xnvmz_di" bpmnElement="Flow_02xnvmz">
- <di:waypoint x="810" y="176" />
- <di:waypoint x="810" y="118" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="Event_133vsyh_di" bpmnElement="Event_1ubxkat">
- <dc:Bounds x="792" y="82" width="36" height="36" />
- </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
index 87e0b883a9..9a33a3e4bf 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0">
<bpmn:process id="DeleteVfModuleBB" name="DeleteVfModuleBB" isExecutable="true">
<bpmn:startEvent id="DeleteVfModuleBB_Start">
- <bpmn:outgoing>SequenceFlow_1oeootm</bpmn:outgoing>
+ <bpmn:outgoing>Flow_02lmh6f</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Prepare Request" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_028rmiu</bpmn:incoming>
+ <bpmn:incoming>Flow_02lmh6f</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_08tvhtf</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="UpdateVfModuleDeleteStatus" name="&#10;AAI &#10;Update&#10;(vf module)&#10;" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusDeleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
@@ -29,9 +29,8 @@
<camunda:out source="contrailServiceInstanceFqdn" target="contrailServiceInstanceFqdn" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_08tvhtf</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_02lpx87</bpmn:outgoing>
+ <bpmn:outgoing>Flow_0hlvlw2</bpmn:outgoing>
</bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_02lpx87" sourceRef="VnfAdapter" targetRef="ExclusiveGateway_1yvh16a" />
<bpmn:subProcess id="SubProcess_11p7mrh" name="Error Handling&#10;&#10;" triggeredByEvent="true">
<bpmn:startEvent id="StartEvent_1xp6ewt">
<bpmn:outgoing>SequenceFlow_0h607z0</bpmn:outgoing>
@@ -51,7 +50,7 @@
<bpmn:sequenceFlow id="SequenceFlow_09l7pcg" sourceRef="UpdateVfModuleDeleteStatus" targetRef="DeleteVfModuleBB_End" />
<bpmn:sequenceFlow id="SequenceFlow_0xyu3pk" sourceRef="DeleteNetworkPolicies" targetRef="UpdateVnfIpv4OamAddress" />
<bpmn:serviceTask id="DeleteNetworkPolicies" name="&#10;AAI&#10;Delete&#10;(net policies)&#10;" camunda:expression="${AAIDeleteTasks.deleteNetworkPolicies(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_0sy2nky</bpmn:incoming>
+ <bpmn:incoming>Flow_0n2pqrr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0xyu3pk</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="UpdateVnfManagementV6Address" name="&#10;AAI &#10;Update&#10;(vnf)&#10;" camunda:expression="${AAIUpdateTasks.updateManagementV6AddressVnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
@@ -69,496 +68,176 @@
<bpmn:incoming>SequenceFlow_0khqfnc</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0yuz21z</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_032jv5j" name="Yes&#10;" sourceRef="auditEnabledCheck" targetRef="Setup_Audit_Variable">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:sequenceFlow id="SequenceFlow_14bu4ys" sourceRef="ExclusiveGateway_1yvh16a" targetRef="ServiceTask_08ulmzc" />
- <bpmn:serviceTask id="Check_Audit" name="Check Audit Variable" camunda:expression="${AuditTasks.isDeleteAuditNeeded(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_1oeootm</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_10af0fk</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:serviceTask id="Audit_Inventory" name="&#10;AAI&#10;Audit&#10;(vservers)&#10;" camunda:type="external" camunda:topic="InventoryDeleteAudit">
- <bpmn:incoming>SequenceFlow_0f5ljoh</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0hpj2mm</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:serviceTask id="Setup_Audit_Variable" name="Setup Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_032jv5j</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1iulltd</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:subProcess id="SubProcess_0grvkj2" name="Audit Exception Sub Process" triggeredByEvent="true">
- <bpmn:endEvent id="EndEvent_1gzq57j">
- <bpmn:incoming>SequenceFlow_1fhst92</bpmn:incoming>
- </bpmn:endEvent>
- <bpmn:serviceTask id="ServiceTask_1isbxvo" name="Proccess Error" camunda:expression="${ExceptionBuilder.processAuditException(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)), true)}">
- <bpmn:incoming>SequenceFlow_0xuodpy</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1fhst92</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_0xuodpy" sourceRef="StartEvent_1euiddy" targetRef="ServiceTask_1isbxvo" />
- <bpmn:sequenceFlow id="SequenceFlow_1fhst92" sourceRef="ServiceTask_1isbxvo" targetRef="EndEvent_1gzq57j" />
- <bpmn:startEvent id="StartEvent_1euiddy" isInterrupting="false">
- <bpmn:outgoing>SequenceFlow_0xuodpy</bpmn:outgoing>
- <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" camunda:escalationCodeVariable="auditCode" />
- </bpmn:startEvent>
- </bpmn:subProcess>
- <bpmn:sequenceFlow id="SequenceFlow_179btn2" sourceRef="aaiCatch" targetRef="ServiceTask_0itw3by" />
<bpmn:intermediateThrowEvent id="aaiThrow" name="Update AAI">
- <bpmn:incoming>SequenceFlow_1i9ft2r</bpmn:incoming>
+ <bpmn:incoming>Flow_0plbl7p</bpmn:incoming>
<bpmn:linkEventDefinition name="AAI" />
</bpmn:intermediateThrowEvent>
<bpmn:intermediateCatchEvent id="aaiCatch" name="Update AAI">
- <bpmn:outgoing>SequenceFlow_179btn2</bpmn:outgoing>
+ <bpmn:outgoing>Flow_0n2pqrr</bpmn:outgoing>
<bpmn:linkEventDefinition name="AAI" />
</bpmn:intermediateCatchEvent>
- <bpmn:sequenceFlow id="SequenceFlow_17cd9e2" name="Yes/No" sourceRef="auditSuccessfulCheck" targetRef="ExclusiveGateway_01wvywu">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false || execution.getVariable("auditIsSuccessful") == true}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:sequenceFlow id="SequenceFlow_1gdyk9j" name="No" sourceRef="auditSuccessfulCheck" targetRef="EndEvent_0b0ocu0">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:inclusiveGateway id="auditSuccessfulCheck" name="Audit&#10; Successful?">
- <bpmn:incoming>SequenceFlow_0hpj2mm</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_17cd9e2</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1gdyk9j</bpmn:outgoing>
- </bpmn:inclusiveGateway>
- <bpmn:endEvent id="EndEvent_0b0ocu0">
- <bpmn:incoming>SequenceFlow_1gdyk9j</bpmn:incoming>
- <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" />
- </bpmn:endEvent>
- <bpmn:exclusiveGateway id="auditEnabledCheck" name="Audit&#10; Enabled?" default="SequenceFlow_1bt1p2u">
- <bpmn:incoming>SequenceFlow_10af0fk</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_032jv5j</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1bt1p2u</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:exclusiveGateway id="ExclusiveGateway_1t9q2jl">
- <bpmn:incoming>SequenceFlow_1bt1p2u</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_0dzf7hz</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1bq9g02</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:sequenceFlow id="SequenceFlow_1bt1p2u" name="No" sourceRef="auditEnabledCheck" targetRef="ExclusiveGateway_1t9q2jl" />
- <bpmn:sequenceFlow id="SequenceFlow_1oeootm" sourceRef="DeleteVfModuleBB_Start" targetRef="Check_Audit" />
- <bpmn:sequenceFlow id="SequenceFlow_10af0fk" sourceRef="Check_Audit" targetRef="auditEnabledCheck" />
- <bpmn:serviceTask id="aicQueryStack" name="&#10;AIC&#10;Query&#10;(stack)&#10;" camunda:type="external" camunda:topic="InventoryQueryAudit">
- <bpmn:incoming>SequenceFlow_1iulltd</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0dzf7hz</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1iulltd" sourceRef="Setup_Audit_Variable" targetRef="aicQueryStack" />
- <bpmn:sequenceFlow id="SequenceFlow_0dzf7hz" sourceRef="aicQueryStack" targetRef="ExclusiveGateway_1t9q2jl" />
- <bpmn:sequenceFlow id="SequenceFlow_1bq9g02" sourceRef="ExclusiveGateway_1t9q2jl" targetRef="ExclusiveGateway_1naduhl" />
- <bpmn:sequenceFlow id="SequenceFlow_0mtzl4z" sourceRef="ExclusiveGateway_1naduhl" targetRef="ExclusiveGateway_13fhmpf" />
- <bpmn:sequenceFlow id="SequenceFlow_028rmiu" sourceRef="ExclusiveGateway_1naduhl" targetRef="DeleteVfModuleVnfAdapter" />
- <bpmn:parallelGateway id="ExclusiveGateway_1naduhl">
- <bpmn:incoming>SequenceFlow_1bq9g02</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0mtzl4z</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_028rmiu</bpmn:outgoing>
- </bpmn:parallelGateway>
- <bpmn:inclusiveGateway id="ExclusiveGateway_1yvh16a">
- <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_13mlz57</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_14bu4ys</bpmn:outgoing>
- </bpmn:inclusiveGateway>
- <bpmn:sequenceFlow id="SequenceFlow_0hpj2mm" sourceRef="Audit_Inventory" targetRef="auditSuccessfulCheck" />
- <bpmn:exclusiveGateway id="ExclusiveGateway_13fhmpf" name="Audit&#10; Enabled?" default="SequenceFlow_1gjwivp">
- <bpmn:incoming>SequenceFlow_0mtzl4z</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0f5ljoh</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1gjwivp</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:sequenceFlow id="SequenceFlow_0f5ljoh" name="Yes" sourceRef="ExclusiveGateway_13fhmpf" targetRef="Audit_Inventory">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression>
- </bpmn:sequenceFlow>
- <bpmn:exclusiveGateway id="ExclusiveGateway_01wvywu">
- <bpmn:incoming>SequenceFlow_17cd9e2</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_1gjwivp</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_13mlz57</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:sequenceFlow id="SequenceFlow_1gjwivp" name="No" sourceRef="ExclusiveGateway_13fhmpf" targetRef="ExclusiveGateway_01wvywu" />
- <bpmn:sequenceFlow id="SequenceFlow_13mlz57" sourceRef="ExclusiveGateway_01wvywu" targetRef="ExclusiveGateway_1yvh16a" />
<bpmn:serviceTask id="ServiceTask_0itw3by" name="&#10;AAI&#10;Delete&#10;(inventory)&#10;" camunda:type="external" camunda:topic="InventoryDelete">
- <bpmn:incoming>SequenceFlow_179btn2</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0sy2nky</bpmn:outgoing>
+ <bpmn:incoming>SequenceFlow_1i9ft2r</bpmn:incoming>
+ <bpmn:outgoing>Flow_0plbl7p</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_0sy2nky" sourceRef="ServiceTask_0itw3by" targetRef="DeleteNetworkPolicies" />
<bpmn:serviceTask id="ServiceTask_08ulmzc" name="&#10;Create&#10;Cloud&#10;Variable&#10;" camunda:expression="${DeleteVFModule.createInventoryVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_14bu4ys</bpmn:incoming>
+ <bpmn:incoming>Flow_0hlvlw2</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1i9ft2r</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1i9ft2r" sourceRef="ServiceTask_08ulmzc" targetRef="aaiThrow" />
+ <bpmn:sequenceFlow id="SequenceFlow_1i9ft2r" sourceRef="ServiceTask_08ulmzc" targetRef="ServiceTask_0itw3by" />
+ <bpmn:sequenceFlow id="Flow_0n2pqrr" sourceRef="aaiCatch" targetRef="DeleteNetworkPolicies" />
+ <bpmn:sequenceFlow id="Flow_0plbl7p" sourceRef="ServiceTask_0itw3by" targetRef="aaiThrow" />
+ <bpmn:sequenceFlow id="Flow_0hlvlw2" sourceRef="VnfAdapter" targetRef="ServiceTask_08ulmzc" />
+ <bpmn:sequenceFlow id="Flow_02lmh6f" sourceRef="DeleteVfModuleBB_Start" targetRef="DeleteVfModuleVnfAdapter" />
</bpmn:process>
<bpmn:error id="Error_0jjnve8" name="Error_3k24na6" errorCode="AAIInventoryFailure" />
<bpmn:escalation id="Escalation_130je8j" name="audit" escalationCode="audit1" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteVfModuleBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteVfModuleBB_Start">
- <dc:Bounds x="159" y="266" width="36" height="36" />
+ <dc:Bounds x="159" y="106" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="132" y="302" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter">
- <dc:Bounds x="888" y="312" width="100" height="80" />
+ <dc:Bounds x="290" y="84" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus">
- <dc:Bounds x="1136" y="468" width="100" height="80" />
+ <dc:Bounds x="930" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_08tvhtf_di" bpmnElement="SequenceFlow_08tvhtf">
- <di:waypoint x="988" y="352" />
- <di:waypoint x="1020" y="352" />
+ <di:waypoint x="390" y="124" />
+ <di:waypoint x="435" y="124" />
<bpmndi:BPMNLabel>
<dc:Bounds x="959" y="331" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End">
- <dc:Bounds x="1268" y="490" width="36" height="36" />
+ <dc:Bounds x="1142" y="330" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1241" y="530" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter">
- <dc:Bounds x="1020" y="312" width="100" height="80" />
+ <dc:Bounds x="435" y="84" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_02lpx87_di" bpmnElement="SequenceFlow_02lpx87">
- <di:waypoint x="1120" y="352" />
- <di:waypoint x="1203" y="352" />
- <di:waypoint x="1203" y="309" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1116.5" y="337" width="90" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_11p7mrh_di" bpmnElement="SubProcess_11p7mrh" isExpanded="true">
- <dc:Bounds x="290" y="878" width="231" height="135" />
+ <dc:Bounds x="304" y="500" width="231" height="135" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_1xp6ewt_di" bpmnElement="StartEvent_1xp6ewt">
- <dc:Bounds x="333" y="940" width="36" height="36" />
+ <dc:Bounds x="347" y="562" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="261" y="976" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0guhjau_di" bpmnElement="EndEvent_0guhjau">
- <dc:Bounds x="462" y="940" width="36" height="36" />
+ <dc:Bounds x="476" y="562" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="390" y="976" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0h607z0_di" bpmnElement="SequenceFlow_0h607z0">
- <di:waypoint x="369" y="958" />
- <di:waypoint x="462" y="958" />
+ <di:waypoint x="383" y="580" />
+ <di:waypoint x="476" y="580" />
<bpmndi:BPMNLabel>
<dc:Bounds x="371" y="937" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0vlgqod_di" bpmnElement="UpdateVfModuleHeatStackId">
- <dc:Bounds x="969" y="468" width="100" height="80" />
+ <dc:Bounds x="800" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_01vfwtp_di" bpmnElement="SequenceFlow_01vfwtp">
- <di:waypoint x="1069" y="508" />
- <di:waypoint x="1136" y="508" />
+ <di:waypoint x="900" y="348" />
+ <di:waypoint x="930" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="848" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_09l7pcg_di" bpmnElement="SequenceFlow_09l7pcg">
- <di:waypoint x="1236" y="508" />
- <di:waypoint x="1268" y="508" />
+ <di:waypoint x="1030" y="348" />
+ <di:waypoint x="1142" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1092.5" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk">
- <di:waypoint x="420" y="468" />
- <di:waypoint x="420" y="448" />
- <di:waypoint x="443" y="409" />
- <di:waypoint x="497" y="468" />
+ <di:waypoint x="370" y="348" />
+ <di:waypoint x="400" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="345" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0tty0ac_di" bpmnElement="DeleteNetworkPolicies">
- <dc:Bounds x="370" y="468" width="100" height="80" />
+ <dc:Bounds x="270" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0lrrd16_di" bpmnElement="UpdateVnfManagementV6Address">
- <dc:Bounds x="642" y="468" width="100" height="80" />
+ <dc:Bounds x="540" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0jtem3b_di" bpmnElement="SequenceFlow_0jtem3b">
- <di:waypoint x="533" y="468" />
- <di:waypoint x="533" y="448" />
- <di:waypoint x="619" y="387" />
- <di:waypoint x="692" y="448" />
- <di:waypoint x="692" y="468" />
+ <di:waypoint x="500" y="348" />
+ <di:waypoint x="540" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="473" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0w9805b_di" bpmnElement="UpdateVnfIpv4OamAddress">
- <dc:Bounds x="483" y="468" width="100" height="80" />
+ <dc:Bounds x="400" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0khqfnc_di" bpmnElement="SequenceFlow_0khqfnc">
- <di:waypoint x="742" y="493" />
- <di:waypoint x="891" y="448" />
- <di:waypoint x="891" y="468" />
+ <di:waypoint x="640" y="348" />
+ <di:waypoint x="670" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="598" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0yuz21z_di" bpmnElement="SequenceFlow_0yuz21z">
- <di:waypoint x="941" y="508" />
- <di:waypoint x="969" y="508" />
+ <di:waypoint x="770" y="348" />
+ <di:waypoint x="800" y="348" />
<bpmndi:BPMNLabel>
<dc:Bounds x="722" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0v8naz9_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn">
- <dc:Bounds x="841" y="468" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_032jv5j_di" bpmnElement="SequenceFlow_032jv5j">
- <di:waypoint x="397" y="259" />
- <di:waypoint x="397" y="214" />
- <di:waypoint x="444" y="214" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="405.5348837209302" y="217.95121951219514" width="19" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_14bu4ys_di" bpmnElement="SequenceFlow_14bu4ys">
- <di:waypoint x="1228" y="284" />
- <di:waypoint x="1284" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1230.5" y="262.5" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_1vmz3zo_di" bpmnElement="Check_Audit">
- <dc:Bounds x="244" y="244" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_1l8r2a6_di" bpmnElement="Audit_Inventory">
- <dc:Bounds x="930" y="117" width="100" height="80" />
+ <dc:Bounds x="670" y="308" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_1gttdjr_di" bpmnElement="Setup_Audit_Variable">
- <dc:Bounds x="444" y="174" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="SubProcess_0grvkj2_di" bpmnElement="SubProcess_0grvkj2" isExpanded="true">
- <dc:Bounds x="231" y="642" width="350" height="200" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1gzq57j_di" bpmnElement="EndEvent_1gzq57j">
- <dc:Bounds x="510" y="725" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="438" y="765" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_1isbxvo_di" bpmnElement="ServiceTask_1isbxvo">
- <dc:Bounds x="353" y="703" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0xuodpy_di" bpmnElement="SequenceFlow_0xuodpy">
- <di:waypoint x="298" y="743" />
- <di:waypoint x="353" y="743" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="280.5" y="722" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1fhst92_di" bpmnElement="SequenceFlow_1fhst92">
- <di:waypoint x="453" y="743" />
- <di:waypoint x="510" y="743" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="393" y="722" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_179btn2_di" bpmnElement="SequenceFlow_179btn2">
- <di:waypoint x="195" y="508" />
- <di:waypoint x="225" y="508" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="191" y="487" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1sftyjz_di" bpmnElement="aaiThrow">
- <dc:Bounds x="1481" y="266" width="36" height="36" />
+ <dc:Bounds x="1062" y="106" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1472" y="305" width="57" height="14" />
+ <dc:Bounds x="1053" y="145" width="57" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateCatchEvent_13y483m_di" bpmnElement="aaiCatch">
- <dc:Bounds x="159" y="490" width="36" height="36" />
+ <dc:Bounds x="159" y="330" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="150" y="530" width="55" height="12" />
+ <dc:Bounds x="149" y="370" width="57" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_17cd9e2_di" bpmnElement="SequenceFlow_17cd9e2">
- <di:waypoint x="1108" y="157" />
- <di:waypoint x="1156" y="157" />
- <di:waypoint x="1156" y="189" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1111.0434782608695" y="137" width="36" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1gdyk9j_di" bpmnElement="SequenceFlow_1gdyk9j">
- <di:waypoint x="1083" y="132" />
- <di:waypoint x="1083" y="109" />
- <di:waypoint x="1083" y="109" />
- <di:waypoint x="1083" y="84" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1083" y="110.74468085106383" width="14" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="InclusiveGateway_0i6rdd1_di" bpmnElement="auditSuccessfulCheck">
- <dc:Bounds x="1058" y="132" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1053" y="186" width="60" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="StartEvent_04qhoba_di" bpmnElement="StartEvent_1euiddy">
- <dc:Bounds x="262" y="725" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="189" y="765" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1onxfk1_di" bpmnElement="EndEvent_0b0ocu0">
- <dc:Bounds x="1065" y="48" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1024" y="87" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ExclusiveGateway_05scr6c_di" bpmnElement="auditEnabledCheck" isMarkerVisible="true">
- <dc:Bounds x="371.6051332675222" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="421" y="272" width="45" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ExclusiveGateway_1t9q2jl_di" bpmnElement="ExclusiveGateway_1t9q2jl" isMarkerVisible="true">
- <dc:Bounds x="697" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="677" y="313" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1bt1p2u_di" bpmnElement="SequenceFlow_1bt1p2u">
- <di:waypoint x="397" y="309" />
- <di:waypoint x="397" y="352" />
- <di:waypoint x="722" y="352" />
- <di:waypoint x="722" y="309" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="407" y="326" width="14" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1oeootm_di" bpmnElement="SequenceFlow_1oeootm">
- <di:waypoint x="195" y="284" />
- <di:waypoint x="244" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="219.5" y="263" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_10af0fk_di" bpmnElement="SequenceFlow_10af0fk">
- <di:waypoint x="344" y="284" />
- <di:waypoint x="372" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="358" y="263" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_1l7z1c0_di" bpmnElement="aicQueryStack">
- <dc:Bounds x="571" y="174" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1iulltd_di" bpmnElement="SequenceFlow_1iulltd">
- <di:waypoint x="544" y="214" />
- <di:waypoint x="571" y="214" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="557.5" y="193" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0dzf7hz_di" bpmnElement="SequenceFlow_0dzf7hz">
- <di:waypoint x="671" y="214" />
- <di:waypoint x="722" y="214" />
- <di:waypoint x="722" y="259" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="651.5" y="193" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1bq9g02_di" bpmnElement="SequenceFlow_1bq9g02">
- <di:waypoint x="747" y="284" />
- <di:waypoint x="796" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="726.5" y="263" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0mtzl4z_di" bpmnElement="SequenceFlow_0mtzl4z">
- <di:waypoint x="821" y="259" />
- <di:waypoint x="821" y="214" />
- <di:waypoint x="846" y="214" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="791" y="231" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_028rmiu_di" bpmnElement="SequenceFlow_028rmiu">
- <di:waypoint x="821" y="309" />
- <di:waypoint x="821" y="352" />
- <di:waypoint x="888" y="352" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="791" y="324.5" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ParallelGateway_1we1ooj_di" bpmnElement="ExclusiveGateway_1naduhl">
- <dc:Bounds x="796" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="775" y="313" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="InclusiveGateway_07wvmp4_di" bpmnElement="ExclusiveGateway_1yvh16a">
- <dc:Bounds x="1178" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1067" y="312" width="90" height="12" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNShape id="ServiceTask_0itw3by_di" bpmnElement="ServiceTask_0itw3by">
+ <dc:Bounds x="740" y="84" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0hpj2mm_di" bpmnElement="SequenceFlow_0hpj2mm">
- <di:waypoint x="1030" y="157" />
- <di:waypoint x="1058" y="157" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="999" y="136" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ExclusiveGateway_13fhmpf_di" bpmnElement="ExclusiveGateway_13fhmpf" isMarkerVisible="true">
- <dc:Bounds x="846" y="189" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="898" y="202" width="45" height="24" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNShape id="ServiceTask_08ulmzc_di" bpmnElement="ServiceTask_08ulmzc">
+ <dc:Bounds x="590" y="84" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0f5ljoh_di" bpmnElement="SequenceFlow_0f5ljoh">
- <di:waypoint x="871" y="189" />
- <di:waypoint x="871" y="157" />
- <di:waypoint x="930" y="157" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="877.601615925754" y="162.89580806038546" width="19" height="12" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r">
+ <di:waypoint x="690" y="124" />
+ <di:waypoint x="740" y="124" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ExclusiveGateway_01wvywu_di" bpmnElement="ExclusiveGateway_01wvywu" isMarkerVisible="true">
- <dc:Bounds x="1131" y="189" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1111" y="243" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1gjwivp_di" bpmnElement="SequenceFlow_1gjwivp">
- <di:waypoint x="871" y="239" />
- <di:waypoint x="871" y="266" />
- <di:waypoint x="1156" y="266" />
- <di:waypoint x="1156" y="239" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="879" y="244" width="14" height="12" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNEdge id="Flow_0n2pqrr_di" bpmnElement="Flow_0n2pqrr">
+ <di:waypoint x="195" y="348" />
+ <di:waypoint x="270" y="348" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_13mlz57_di" bpmnElement="SequenceFlow_13mlz57">
- <di:waypoint x="1181" y="214" />
- <di:waypoint x="1203" y="214" />
- <di:waypoint x="1203" y="259" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1147" y="193" width="90" height="12" />
- </bpmndi:BPMNLabel>
+ <bpmndi:BPMNEdge id="Flow_0plbl7p_di" bpmnElement="Flow_0plbl7p">
+ <di:waypoint x="840" y="124" />
+ <di:waypoint x="1062" y="124" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_0itw3by_di" bpmnElement="ServiceTask_0itw3by">
- <dc:Bounds x="225" y="468" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0sy2nky_di" bpmnElement="SequenceFlow_0sy2nky">
- <di:waypoint x="325" y="508" />
- <di:waypoint x="370" y="508" />
+ <bpmndi:BPMNEdge id="Flow_0hlvlw2_di" bpmnElement="Flow_0hlvlw2">
+ <di:waypoint x="535" y="124" />
+ <di:waypoint x="590" y="124" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_08ulmzc_di" bpmnElement="ServiceTask_08ulmzc">
- <dc:Bounds x="1284" y="244" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r">
- <di:waypoint x="1384" y="276" />
- <di:waypoint x="1433" y="276" />
- <di:waypoint x="1433" y="284" />
- <di:waypoint x="1481" y="284" />
+ <bpmndi:BPMNEdge id="Flow_02lmh6f_di" bpmnElement="Flow_02lmh6f">
+ <di:waypoint x="195" y="124" />
+ <di:waypoint x="290" y="124" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
index 6f89f3c738..558e785e94 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
@@ -22,12 +22,9 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import java.io.IOException;
-import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
-import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.junit.Before;
import org.junit.Test;
@@ -47,20 +44,10 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest {
public void sunnyDay() throws InterruptedException, IOException {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables);
- List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAddAudit", 60L * 1000L).execute();
- while (!tasks.isEmpty()) {
- for (LockedExternalTask task : tasks) {
- externalTaskService.complete(task.getId(), "externalWorkerId");
- }
- tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L)
- .execute();
- }
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu",
- "Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "CallActivity_sdncHandler",
- "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End");
+ assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule",
+ "CallActivity_sdncHandler", "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End");
assertThat(pi).isEnded();
}
@@ -70,19 +57,9 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest {
doThrow(BpmnError.class).when(aaiUpdateTasks)
.updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables);
- List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAddAudit", 60L * 1000L).execute();
- while (!tasks.isEmpty()) {
- for (LockedExternalTask task : tasks) {
- externalTaskService.complete(task.getId(), "externalWorkerId");
- }
- tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L)
- .execute();
- }
assertThat(pi).isNotNull().isStarted()
- .hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", "Setup_AAI_Inventory_Audit",
- "Audit_AAI_Inventory", "ActivateVfModule", "UpdateVfModuleActiveStatus")
+ .hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule", "UpdateVfModuleActiveStatus")
.hasNotPassed("ActivateVfModuleBB_End");
}
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
index 94279b7fe8..bd759caffd 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
@@ -26,7 +26,7 @@ ex.processJavaException(execution)</bpmn:script>
<bpmn:incoming>Flow_0ca4l8d</bpmn:incoming>
</bpmn:endEvent>
<bpmn:scriptTask id="ScriptTask_1ssh2l9" name="Prepare Update Resource Oper Status((finish)" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_0kixzdj</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1jygjln</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new TnAllocateNssi()
@@ -34,15 +34,6 @@ runScript.prepareUpdateJobStatus(execution,"finished","100","Deallocated TN NSSI
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" />
<bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0rgeefb" />
- <bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1jygjln</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing>
- <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-execution.setVariable("orchestrationStatus", "deallocated")
-def runScript = new DoDeallocateTnNssi()
-runScript.updateAAIOrchStatus(execution)</bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" />
<bpmn:scriptTask id="Activity_1tw8eyy" name="PreProcess SDNC Deallocate TN NSSI Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_07e12rt</bpmn:incoming>
<bpmn:outgoing>Flow_0cpctye</bpmn:outgoing>
@@ -91,7 +82,7 @@ def runScript = new DoDeallocateTnNssi()
runScript.preProcessRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_07e12rt" sourceRef="ScriptTask_1tc44ge" targetRef="Activity_1tw8eyy" />
- <bpmn:sequenceFlow id="SequenceFlow_1jygjln" sourceRef="Activity_013rjwc" targetRef="ScriptTask_19uxoi8" />
+ <bpmn:sequenceFlow id="SequenceFlow_1jygjln" sourceRef="Activity_013rjwc" targetRef="ScriptTask_1ssh2l9" />
<bpmn:serviceTask id="Activity_0rgeefb" name="Update Resource Operation Status">
<bpmn:extensionElements>
<camunda:connector>
@@ -121,6 +112,10 @@ runScript.preProcessRequest(execution)</bpmn:script>
<bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeallocateTransportNSSI">
+ <bpmndi:BPMNEdge id="Flow_0ca4l8d_di" bpmnElement="Flow_0ca4l8d">
+ <di:waypoint x="840" y="350" />
+ <di:waypoint x="1022" y="350" />
+ </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1jygjln_di" bpmnElement="SequenceFlow_1jygjln">
<di:waypoint x="360" y="350" />
<di:waypoint x="520" y="350" />
@@ -132,8 +127,8 @@ runScript.preProcessRequest(execution)</bpmn:script>
<bpmndi:BPMNEdge id="Flow_1jdb2oq_di" bpmnElement="SequenceFlow_1jdb2oq">
<di:waypoint x="1080" y="121" />
<di:waypoint x="1220" y="121" />
- <di:waypoint x="1220" y="210" />
- <di:waypoint x="310" y="210" />
+ <di:waypoint x="1220" y="230" />
+ <di:waypoint x="310" y="230" />
<di:waypoint x="310" y="310" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0fuabjs_di" bpmnElement="Flow_0fuabjs">
@@ -144,30 +139,31 @@ runScript.preProcessRequest(execution)</bpmn:script>
<di:waypoint x="630" y="121" />
<di:waypoint x="729" y="121" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj">
+ <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1">
<di:waypoint x="620" y="350" />
<di:waypoint x="740" y="350" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1">
- <di:waypoint x="840" y="350" />
- <di:waypoint x="990" y="350" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c">
<di:waypoint x="214" y="121" />
<di:waypoint x="285" y="121" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0ca4l8d_di" bpmnElement="Flow_0ca4l8d">
- <di:waypoint x="1090" y="350" />
- <di:waypoint x="1202" y="350" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd">
<dc:Bounds x="178" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="166" y="146" width="70" height="53" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9">
+ <dc:Bounds x="520" y="310" width="100" height="80" />
+ </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0rgeefb_di" bpmnElement="Activity_0rgeefb">
- <dc:Bounds x="990" y="310" width="100" height="80" />
+ <dc:Bounds x="740" y="310" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx">
+ <dc:Bounds x="1022" y="332" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1030" y="375" width="20" height="14" />
+ </bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true">
<dc:Bounds x="685" y="1080" width="781" height="196" />
@@ -189,18 +185,6 @@ runScript.preProcessRequest(execution)</bpmn:script>
<bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw">
<dc:Bounds x="979" y="1144" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx">
- <dc:Bounds x="1202" y="332" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1210" y="375" width="20" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9">
- <dc:Bounds x="740" y="310" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8">
- <dc:Bounds x="520" y="310" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1tw8eyy_di" bpmnElement="Activity_1tw8eyy">
<dc:Bounds x="509" y="74" width="121" height="94" />
</bpmndi:BPMNShape>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java
index f7c42b97e9..b706be92cb 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java
@@ -44,7 +44,11 @@ public class CreateVFModule {
CloudInformation cloudInformation = new CloudInformation();
cloudInformation.setOwner(gBBInput.getCloudRegion().getCloudOwner());
cloudInformation.setRegionId(gBBInput.getCloudRegion().getLcpCloudRegionId());
- cloudInformation.setTenantId(gBBInput.getTenant().getTenantId());
+ String tenantId = gBBInput.getTenant().getTenantId();
+ if (tenantId == null) {
+ tenantId = gBBInput.getCloudRegion().getTenantId();
+ }
+ cloudInformation.setTenantId(tenantId);
cloudInformation.setTenantName(gBBInput.getTenant().getTenantName());
cloudInformation.setTenantContext(gBBInput.getTenant().getTenantContext());
cloudInformation.setTemplateInstanceId(execution.getVariable("heatStackId"));
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java
index 9552755544..85925e2725 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java
@@ -2,13 +2,16 @@ package org.onap.so.logging.jaxrs.filter;
import javax.annotation.Priority;
import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.PreMatching;
+import javax.ws.rs.core.MultivaluedMap;
+import org.onap.logging.filter.base.AuditLogContainerFilter;
+import org.onap.logging.filter.base.Constants;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.logger.HttpHeadersConstants;
import org.onap.so.logger.LogConstants;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
-import org.onap.logging.filter.base.AuditLogContainerFilter;
@Priority(1)
@PreMatching
@@ -27,4 +30,17 @@ public class SOAuditLogContainerFilter extends AuditLogContainerFilter {
}
MDC.put(LogConstants.URI_BASE, request.getUriInfo().getBaseUri().toString());
}
+
+ @Override
+ protected void additionalPostHandling(ContainerResponseContext response) {
+ MultivaluedMap<String, Object> responseHeaders = response.getHeaders();
+ String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID);
+ responseHeaders.add(ONAPLogConstants.Headers.REQUEST_ID, requestId);
+ responseHeaders.add(Constants.HttpHeaders.HEADER_REQUEST_ID, requestId);
+ responseHeaders.add(Constants.HttpHeaders.TRANSACTION_ID, requestId);
+ responseHeaders.add(Constants.HttpHeaders.ECOMP_REQUEST_ID, requestId);
+ responseHeaders.add(ONAPLogConstants.Headers.PARTNER_NAME, getProperty(Constants.Property.PARTNER_NAME));
+ responseHeaders.add(ONAPLogConstants.Headers.INVOCATION_ID,
+ MDC.get(ONAPLogConstants.MDCs.SERVER_INVOCATION_ID));
+ }
}
diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryResultWrapper.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryResultWrapper.java
index 9e6572388b..ae32107339 100644
--- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryResultWrapper.java
+++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryResultWrapper.java
@@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectName;
import org.onap.so.jsonpath.JsonPathUtil;
import org.slf4j.Logger;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -63,6 +64,15 @@ public abstract class GraphInventoryResultWrapper<R extends GraphInventoryRelati
}
}
+ public boolean hasRelationshipsTo(GraphInventoryObjectName name) {
+ Optional<R> rOpt = this.getRelationships();
+ if (rOpt.isPresent()) {
+ return rOpt.get().getRelatedLinks(name).size() > 0;
+ } else {
+ return false;
+ }
+ }
+
public Optional<R> getRelationships() {
final String path = "$.relationship-list";
if (isEmpty()) {
diff --git a/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/AAIResultWrapperTest.java b/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/AAIResultWrapperTest.java
index adc2e7284e..98431759de 100644
--- a/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/AAIResultWrapperTest.java
+++ b/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/AAIResultWrapperTest.java
@@ -21,8 +21,9 @@
package org.onap.aaiclient.client.aai.entities;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
-import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
@@ -36,6 +37,7 @@ import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
import org.springframework.util.SerializationUtils;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -107,4 +109,11 @@ public class AAIResultWrapperTest {
AAIResultWrapper wrapper = new AAIResultWrapper(new GenericVnf());
assertEquals("{}", wrapper.getJson());
}
+
+ @Test
+ public void hasRelationshipToTest() {
+ assertTrue(aaiResultWrapper.hasRelationshipsTo(Types.VCE));
+ assertFalse(aaiResultWrapper.hasRelationshipsTo(Types.CLASS_OF_SERVICE));
+
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/common/ResponseBuilder.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/common/ResponseBuilder.java
index b921f5beea..64774430cc 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/common/ResponseBuilder.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/common/ResponseBuilder.java
@@ -50,10 +50,6 @@ public class ResponseBuilder {
.header(CommonConstants.X_PATCH_VERSION, apiPatchVersion)
.header(CommonConstants.X_LATEST_VERSION, latestVersion);
- if (StringUtils.isNotBlank(requestId)) {
- builder.header(CommonConstants.X_TRANSACTION_ID, requestId);
- }
-
return builder.entity(jsonResponse).build();
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index 33d86a2cc6..d43bbb6ea0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -1498,6 +1498,8 @@ public class ServiceInstancesTest extends BaseTest {
sendRequest(inputStream("/VfModuleNoModelType.json"), uri, HttpMethod.POST, headers);
// ActualRecord
assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value());
+ assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d",
+ response.getHeaders().get(ONAPLogConstants.Headers.REQUEST_ID).get(0));
}
@Test
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
index 1917ee592f..db9f45e3ac 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestrationTest.java
@@ -31,6 +31,7 @@ import javax.ws.rs.core.MediaType;
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandlerinfra.BaseTest;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.springframework.http.HttpEntity;
@@ -212,6 +213,7 @@ public class CloudResourcesOrchestrationTest extends BaseTest {
.withStatus(HttpStatus.SC_OK)));
headers.set("Accept", MediaType.APPLICATION_JSON);
headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ headers.set(ONAPLogConstants.Headers.REQUEST_ID, "e0e0e749-c9e2-48c3-8c4c-d51bf65a86c9");
HttpEntity<String> entity = new HttpEntity<>("", headers);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(path) + "/v1");
@@ -226,7 +228,7 @@ public class CloudResourcesOrchestrationTest extends BaseTest {
assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
assertEquals("1.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- assertEquals("90c56827-1c78-4827-bc4d-6afcdb37a51f", response.getHeaders().get("X-TransactionID").get(0));
+ assertEquals("e0e0e749-c9e2-48c3-8c4c-d51bf65a86c9", response.getHeaders().get("X-TransactionID").get(0));
}
@Test
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/CamundaDatabaseConfiguration.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/CamundaDatabaseConfiguration.java
index c803808df1..770e91c1cb 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/CamundaDatabaseConfiguration.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/CamundaDatabaseConfiguration.java
@@ -22,13 +22,17 @@ package org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows;
import static org.slf4j.LoggerFactory.getLogger;
import javax.sql.DataSource;
+import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration;
+import org.camunda.bpm.spring.boot.starter.util.SpringBootProcessEnginePlugin;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jmx.export.MBeanExporter;
+import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
@@ -39,9 +43,10 @@ import com.zaxxer.hikari.HikariDataSource;
*/
@Configuration
@EnableTransactionManagement
-@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactory", transactionManagerRef = "transactionManager")
public class CamundaDatabaseConfiguration {
+ private static final String CAMUNDA_TRANSACTION_MANAGER_BEAN_NAME = "camundaTransactionManager";
+
private static final String CAMUNDA_DATA_SOURCE_BEAN_NAME = "camundaBpmDataSource";
private static final Logger logger = getLogger(CamundaDatabaseConfiguration.class);
@@ -66,4 +71,22 @@ public class CamundaDatabaseConfiguration {
return new HikariDataSource(hikariConfig);
}
+ @Bean(name = CAMUNDA_TRANSACTION_MANAGER_BEAN_NAME)
+ public PlatformTransactionManager camundaTransactionManager(
+ @Qualifier(CAMUNDA_DATA_SOURCE_BEAN_NAME) final DataSource dataSource) {
+ return new DataSourceTransactionManager(dataSource);
+ }
+
+ @Bean
+ public SpringBootProcessEnginePlugin transactionManagerProcessEnginePlugin(
+ @Qualifier(CAMUNDA_TRANSACTION_MANAGER_BEAN_NAME) final PlatformTransactionManager camundaTransactionManager) {
+ return new SpringBootProcessEnginePlugin() {
+ @Override
+ public void preInit(final SpringProcessEngineConfiguration processEngineConfiguration) {
+ logger.info("Setting Camunda TransactionManager ...");
+ processEngineConfiguration.setTransactionManager(camundaTransactionManager);
+
+ }
+ };
+ }
}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
index 49118494cf..14d4fa2f07 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java
@@ -302,7 +302,7 @@ public class JobExecutorService {
}
private boolean isNotImmediateTerminateRequest(final TerminateNsRequest terminateNsRequest) {
- return terminateNsRequest.getTerminationTime() != null;
+ return terminateNsRequest != null && terminateNsRequest.getTerminationTime() != null;
}
private boolean isNotInstantiated(final NfvoNsInst nfvoNsInst) {
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/BaseTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/BaseTest.java
index b6fd9e407a..1a89f75a70 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/BaseTest.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/BaseTest.java
@@ -67,7 +67,7 @@ public abstract class BaseTest {
protected static final Logger logger = getLogger(BaseTest.class);
- private static final long TIME_OUT_IN_SECONDS = 60;
+ private static final long TIME_OUT_IN_SECONDS = 120;
private static final int SLEEP_TIME_IN_SECONDS = 5;
@Autowired
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/DeleteNsTaskTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/DeleteNsTaskTest.java
index adb8a9e69b..017bdf6b70 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/DeleteNsTaskTest.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/DeleteNsTaskTest.java
@@ -19,7 +19,17 @@
*/
package org.onap.so.etsi.nfvo.ns.workflow.engine.tasks;
-import com.google.gson.Gson;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import java.time.LocalDateTime;
+import java.util.Optional;
+import java.util.UUID;
import org.camunda.bpm.engine.history.HistoricProcessInstance;
import org.junit.After;
import org.junit.Before;
@@ -27,24 +37,12 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.BaseTest;
-import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.GsonProvider;
import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.exceptions.NsRequestProcessingException;
import org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.service.JobExecutorService;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJob;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNsInst;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.State;
import org.springframework.beans.factory.annotation.Autowired;
-import java.time.LocalDateTime;
-import java.util.Optional;
-import java.util.UUID;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.ok;
-import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
/**
* @author Andrew Lamb (andrew.a.lamb@est.tech)
@@ -55,18 +53,12 @@ public class DeleteNsTaskTest extends BaseTest {
@Autowired
private JobExecutorService objUnderTest;
- @Autowired
- private GsonProvider gsonProvider;
-
@Rule
public ExpectedException expectedException = ExpectedException.none();
- private Gson gson;
-
@Before
public void before() {
wireMockServer.resetAll();
- gson = gsonProvider.getGson();
}
@After
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/TerminateNsTaskTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/TerminateNsTaskTest.java
index b821c85edd..51460ec4c8 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/TerminateNsTaskTest.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/java/org/onap/so/etsi/nfvo/ns/workflow/engine/tasks/TerminateNsTaskTest.java
@@ -19,7 +19,25 @@
*/
package org.onap.so.etsi.nfvo.ns.workflow.engine.tasks;
-import com.google.gson.Gson;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.vnfm.Sol003AdapterConfiguration.SOL003_ADAPTER_REST_TEMPLATE_BEAN;
+import static org.springframework.test.web.client.ExpectedCount.times;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
import org.camunda.bpm.engine.history.HistoricProcessInstance;
import org.hamcrest.text.MatchesPattern;
import org.junit.After;
@@ -47,26 +65,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.util.List;
-import java.util.Optional;
-import java.util.UUID;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.ok;
-import static com.github.tomakehurst.wiremock.client.WireMock.okJson;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN;
-import static org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.vnfm.Sol003AdapterConfiguration.SOL003_ADAPTER_REST_TEMPLATE_BEAN;
-import static org.springframework.test.web.client.ExpectedCount.times;
-import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
-import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
-import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
+import com.google.gson.Gson;
/**
* @author Andrew Lamb (andrew.a.lamb@est.tech)
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml
index 1fabfbaac9..101e17a791 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml
@@ -42,7 +42,7 @@ etsi-catalog-manager:
endpoint: http://modeling-etsicatalog.onap:8806/api
so-etsi-ns-lcm-workflow-engine:
requesttimeout:
- timeoutInSeconds: 60
+ timeoutInSeconds: 120
logging:
level:
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NSLcmOpOccRepository.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NSLcmOpOccRepository.java
index d52dcd6192..d7f2f4cefa 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NSLcmOpOccRepository.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NSLcmOpOccRepository.java
@@ -22,16 +22,16 @@ package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
import java.util.Optional;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NsLcmOpOcc;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.OperationStateEnum;
+import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
* @author mukeshsharma(mukeshsharma@est.tech)
*/
-public interface NSLcmOpOccRepository extends CrudRepository<NsLcmOpOcc, String> {
+public interface NSLcmOpOccRepository extends JpaRepository<NsLcmOpOcc, String> {
Optional<NsLcmOpOcc> findById(final String id);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoJobRepository.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoJobRepository.java
index 2d6d033689..220902c631 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoJobRepository.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoJobRepository.java
@@ -21,13 +21,13 @@ package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
import java.util.Optional;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoJob;
-import org.springframework.data.repository.CrudRepository;
+import org.springframework.data.jpa.repository.JpaRepository;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-public interface NfvoJobRepository extends CrudRepository<NfvoJob, String>, RefreshableRepository<NfvoJob> {
+public interface NfvoJobRepository extends JpaRepository<NfvoJob, String>, RefreshableRepository<NfvoJob> {
Optional<NfvoJob> findByResourceId(final String resourceId);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNfInstRepository.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNfInstRepository.java
index 5560ea7af3..f91a85f2e6 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNfInstRepository.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNfInstRepository.java
@@ -23,16 +23,16 @@ import java.util.List;
import java.util.Optional;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNfInst;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.State;
+import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
* @author mukeshsharma(mukeshsharma@est.tech)
*/
-public interface NfvoNfInstRepository extends CrudRepository<NfvoNfInst, String> {
+public interface NfvoNfInstRepository extends JpaRepository<NfvoNfInst, String> {
Optional<NfvoNfInst> findByNfInstId(final String nfInstId);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNsInstRepository.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNsInstRepository.java
index 2a6abda558..a64cf9bdd5 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNsInstRepository.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/repository/NfvoNsInstRepository.java
@@ -22,16 +22,16 @@ package org.onap.so.etsi.nfvo.ns.lcm.database.repository;
import java.util.Optional;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.NfvoNsInst;
import org.onap.so.etsi.nfvo.ns.lcm.database.beans.State;
+import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-public interface NfvoNsInstRepository extends CrudRepository<NfvoNsInst, String> {
+public interface NfvoNsInstRepository extends JpaRepository<NfvoNsInst, String> {
Optional<NfvoNsInst> findByName(final String name);
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
index 58ca76eec9..ec8777d0fa 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
@@ -68,7 +68,7 @@ public class DatabaseServiceProvider {
public boolean addJob(final NfvoJob job) {
logger.info("Adding NfvoJob: {} to database", job);
- return nfvoJobRepository.save(job) != null;
+ return nfvoJobRepository.saveAndFlush(job) != null;
}
public Optional<NfvoJob> getJob(final String jobId) {
@@ -104,7 +104,7 @@ public class DatabaseServiceProvider {
public boolean saveNfvoNsInst(final NfvoNsInst nfvoNsInst) {
logger.info("Saving NfvoNsInst: {} to database", nfvoNsInst);
- return nfvoNsInstRepository.save(nfvoNsInst) != null;
+ return nfvoNsInstRepository.saveAndFlush(nfvoNsInst) != null;
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
@@ -125,7 +125,7 @@ public class DatabaseServiceProvider {
public boolean saveNfvoNfInst(final NfvoNfInst nfvoNfInst) {
logger.info("Saving NfvoNfInst: {} to database", nfvoNfInst);
- return nfvoNfInstRepository.save(nfvoNfInst) != null;
+ return nfvoNfInstRepository.saveAndFlush(nfvoNfInst) != null;
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
@@ -162,7 +162,7 @@ public class DatabaseServiceProvider {
public boolean addNSLcmOpOcc(final NsLcmOpOcc nsLcmOpOcc) {
logger.info("Adding NSLcmOpOcc: {} to database", nsLcmOpOcc);
- return nsLcmOpOccRepository.save(nsLcmOpOcc) != null;
+ return nsLcmOpOccRepository.saveAndFlush(nsLcmOpOcc) != null;
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java
index 2390cef564..4d6f92c373 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java
@@ -145,7 +145,7 @@ public class NsLifecycleManagementController {
produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML},
consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public ResponseEntity<Void> terminateNs(@PathVariable("nsInstanceId") final String nsInstanceId,
- @RequestBody final TerminateNsRequest terminateNsRequest) {
+ @RequestBody(required = false) final TerminateNsRequest terminateNsRequest) {
logger.debug("Received terminate NS request: {}\n with nsInstanceId: {}", terminateNsRequest, nsInstanceId);
final URI resourceUri = nsLifeCycleManager.terminateNs(nsInstanceId, terminateNsRequest);
logger.info("{} Ns Terminate started successfully. Resource Operation Occurrence uri: {}", nsInstanceId,
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
index edf212429c..d8d62d99bc 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -29,8 +29,7 @@ public class ProcessVnfc extends AbstractTestAction {
AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
- && context.getVariable("serviceAction").equals("assign")
- && context.getVariable("vfModuleName").equals("nc_dummy_id")) {
+ && context.getVariable("serviceAction").equals("assign")) {
AAIResourceUri vnfcURI =
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc("ssc_server_1"));
@@ -47,14 +46,14 @@ public class ProcessVnfc extends AbstractTestAction {
vnfc.setModelVersionId("9e314c37-2258-4572-a399-c0dd7d5f1aec");
vnfc.setModelCustomizationId("2bd95cd4-d7ff-4af0-985d-2adea0339921");
- if (!aaiResourceClient.exists(vnfcURI)) {
- logger.debug("creating VNFC");
- aaiResourceClient.create(vnfcURI, vnfc);
+ if (aaiResourceClient.exists(vnfcURI)) {
+ logger.debug("cleaning up VNFC");
+ aaiResourceClient.delete(vnfcURI);
+ }
+ logger.debug("creating new VNFC");
+ aaiResourceClient.create(vnfcURI, vnfc);
- } else {
- aaiResourceClient.get(vnfcURI);
- }
AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network()
.genericVnf(context.getVariable("vnfId")).vfModule(context.getVariable("vfModuleId")));
logger.debug("creating VNFC edge to vf module");
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
new file mode 100644
index 0000000000..f4ac519f7a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-ID-Name-Resources")
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module/stackId/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplace extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
new file mode 100644
index 0000000000..f6eebeb09e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-Volume-ID-Name-Resources")
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module_volume_id/stackId/resources",
+ method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplaceVolume extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module_volume_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
index e13a23f397..eb306ccd6f 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro1")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
index 580714ded2..d2551a2fb3 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro2")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
index 096d2aa312..bb33f2c718 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro3")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
index b590966e2f..77cc0054cc 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Base-Stack-Resources")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
@@ -19,8 +19,8 @@ public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
scenario.variable("stackName", "dummy_id");
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResources.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json b/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json
new file mode 100644
index 0000000000..0a47889c33
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json
@@ -0,0 +1,122 @@
+{
+ "resources" : [ {
+ "resource_name" : "oam_security_group",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/oam_security_group",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "f83b7f23-ce5e-41bf-8dbf-ae53e905db7c",
+ "logical_resource_id" : "oam_security_group",
+ "required_by" : [ "cpm_0_oam_protected1_port_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::SecurityGroup",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_base2_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_base2_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "803b18b6-e9ba-4fe8-93eb-4a68832b2869",
+ "logical_resource_id" : "cpm_0_sd_base2_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_base1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_base1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "56610b2d-6e58-451b-9eb7-5f516f85a458",
+ "logical_resource_id" : "cpm_0_sd_base1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_eastwest2_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_eastwest2_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "67aaf2a1-2ada-4322-8603-dceec9b456a6",
+ "logical_resource_id" : "cpm_0_sd_eastwest2_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_eastwest1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_eastwest1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "8b5392c9-d3aa-41f4-85ee-a3223182e455",
+ "logical_resource_id" : "cpm_0_sd_eastwest1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_oam_protected1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_oam_protected1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "4eec349e-be73-41ae-9457-69d31f3a9305",
+ "logical_resource_id" : "cpm_0_oam_protected1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_server_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_server_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "635a609d-bb2b-446c-b955-8fc5a4ba4b8d",
+ "logical_resource_id" : "cpm_server_0",
+ "required_by" : [ ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Nova::Server",
+ "resource_status_reason" : "state changed"
+ } ]
+} \ No newline at end of file