aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INFO.yaml7
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql6
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java6
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql6
-rw-r--r--adapters/mso-openstack-adapters/pom.xml12
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/cloudregion/CloudRegionRestV1.java48
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java72
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java65
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java200
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java65
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java54
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java59
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java67
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java209
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java329
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java50
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java8
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java33
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java370
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java139
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java207
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java392
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java139
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java348
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java146
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java107
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java178
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java61
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java21
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl295
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl218
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl295
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl218
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java34
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java37
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java36
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java34
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java299
-rw-r--r--adapters/mso-requests-db-adapter/pom.xml2
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java24
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java11
-rw-r--r--adapters/mso-sdnc-adapter/pom.xml6
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java24
-rw-r--r--asdc-controller/pom.xml4
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java50
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java122
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java12
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CnfAdapterBB.bpmn80
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy11
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy12
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/pom.xml3
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java6
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/pom.xml4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java44
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java469
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java44
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java484
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java (renamed from bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java)88
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java143
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidation.java (renamed from bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java)3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAI.java (renamed from bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAI.java)2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java66
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java196
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java357
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversalTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversalTest.java)23
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java85
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidationTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidationTest.java)3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAITest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java)3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/Macro/ServiceMacroCreateWithoutResources.json48
-rw-r--r--common/pom.xml16
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java2
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java3
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java3
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java3
-rw-r--r--common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java4
-rw-r--r--common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java6
-rw-r--r--common/src/main/java/org/onap/so/logger/MaskLogStatements.java71
-rw-r--r--common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java4
-rw-r--r--common/src/test/java/org/onap/so/logging/MaskLogStatementsTest.java90
-rw-r--r--common/src/test/resources/__files/logging/openstack-payload.json26
-rw-r--r--docs/api/apis/serviceInstances-api.rst103
-rw-r--r--docs/developer_info/BBUnderstanding.rst1133
-rw-r--r--docs/developer_info/ETSI_NFVO_Network_Service_LCM_Setup_Guide.rst263
-rw-r--r--docs/developer_info/ETSI_VNF_LCM_Setup_Guide.rst595
-rw-r--r--docs/developer_info/SO_Admin_Cockpit_User_Guide.rst149
-rw-r--r--docs/images/abort.pngbin0 -> 269787 bytes
-rw-r--r--docs/images/handling_error.pngbin0 -> 40534 bytes
-rw-r--r--docs/images/rainy_day_handler_macro_table.pngbin0 -> 78851 bytes
-rw-r--r--docs/images/retry.pngbin0 -> 70206 bytes
-rw-r--r--docs/images/retry2.pngbin0 -> 70326 bytes
-rw-r--r--docs/images/retry3.pngbin0 -> 70443 bytes
-rw-r--r--docs/images/retry_Bdd.pngbin0 -> 81292 bytes
-rw-r--r--docs/images/retry_Bdd2.pngbin0 -> 80363 bytes
-rw-r--r--docs/images/rollback.pngbin0 -> 51020 bytes
-rw-r--r--docs/images/rollback_Bdd.pngbin0 -> 54579 bytes
-rw-r--r--docs/images/soAdminCockpitGetError.pngbin0 -> 34710 bytes
-rw-r--r--docs/images/soAdminCockpitStatistics.pngbin0 -> 18137 bytes
-rw-r--r--docs/images/soAdminCockpitUi.pngbin0 -> 116613 bytes
-rw-r--r--docs/images/soAdminCockpitUi2.pngbin0 -> 140388 bytes
-rw-r--r--docs/images/soAdminCockpitUi3.pngbin0 -> 28193 bytes
-rw-r--r--docs/release-notes.rst125
-rw-r--r--graph-inventory/fluent-builder-maven-plugin/pom.xml4
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java4
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java12
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java10
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java6
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java2
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java2
-rw-r--r--pom.xml22
128 files changed, 3867 insertions, 6178 deletions
diff --git a/INFO.yaml b/INFO.yaml
index a6d7d1d3db..25ed7eb86e 100644
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -45,11 +45,6 @@ committers:
company: 'Ericsson'
id: 'byungwoojun'
timezone: 'America/New_York'
- - name: 'Max Benjamin'
- email: 'max.benjamin@att.com'
- company: 'ATT'
- id: 'mfour'
- timezone: 'America/New_York'
- name: 'Steve Smokowski'
email: 'ss835w@att.com'
company: 'ATT'
@@ -104,3 +99,5 @@ tsc:
- type: 'addition'
name: 'Ramesh Parthasarathy'
link: 'https://wiki.onap.org/display/Meetings/TSC+2020-12-03'
+ - type: 'removal'
+ name: 'Max Benjamin'
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
index 0b921ecfb4..c64ec25492 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
@@ -659,13 +659,13 @@ VALUES
('VNF', 'CONFIGURED', 'ACTIVATE', 'CONTINUE'),
('VNF', 'CONFIGURED', 'UNASSIGN', 'CONTINUE'),
-('VNF', 'CONFIGURED', 'DESACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'CONFIGURED', 'DEACTIVATE', 'SILENT_SUCCESS'),
('VNF', 'CONFIGURE', 'UNASSIGN', 'CONTINUE'),
-('VNF', 'CONFIGURE', 'DESACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'CONFIGURE', 'DEACTIVATE', 'SILENT_SUCCESS'),
('VNF', 'CONFIGASSIGNED', 'UNASSIGN', 'CONTINUE'),
-('VNF', 'CONFIGASSIGNED', 'DESACTIVATE', 'SILENT_SUCCESS');
+('VNF', 'CONFIGASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS');
UPDATE orchestration_flow_reference SET FLOW_NAME = 'HomingBB' WHERE FLOW_NAME = 'SniroHoming';
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index c202170235..8ce4051b24 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -197,8 +197,8 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
assertNotNull(vnfResourceCustomization.getVnfResources());
assertNotNull(vnfResourceCustomization.getVfModuleCustomizations());
assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName());
- assertTrue("skip post instantiation configuration",
- vnfResourceCustomization.isSkipPostInstConf().booleanValue());
+ assertFalse("skip post instantiation configuration",
+ vnfResourceCustomization.getSkipPostInstConf().booleanValue());
}
@Test
@@ -617,7 +617,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
- assertTrue("skip post instantiation configuration", pnfResourceCustomization.isSkipPostInstConf());
+ assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf());
PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
assertNotNull(pnfResource);
assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index 53a457dadf..c975f8b755 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -64,9 +64,9 @@ insert into vnf_resource(orchestration_mode, description, creation_timestamp, mo
('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002672', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '2.0', 'vSAMP10a', 'VF', 'ff874603-4222-11e7-9252-005056850d2e');
-insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design,service_model_uuid,resource_input) values
-('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null,'5df8b6de-2083-11e7-93ae-92361f002671', '{\\\"resource_input\\\":\\\"test\\\"}'),
-('68dc9a92-214c-11e7-93ae-92361f002672', 'vSAMP10a 2', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002672', null,'5df8b6de-2083-11e7-93ae-92361f002672', null);
+insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design,service_model_uuid,resource_input,skip_post_instantiation_configuration) values
+('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null,'5df8b6de-2083-11e7-93ae-92361f002671', '{\\\"resource_input\\\":\\\"test\\\"}', false),
+('68dc9a92-214c-11e7-93ae-92361f002672', 'vSAMP10a 2', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002672', null,'5df8b6de-2083-11e7-93ae-92361f002672', null, false);
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index 32448d31dc..aa6e5041e3 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -139,10 +139,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -150,7 +152,7 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
+ <artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/cloudregion/CloudRegionRestV1.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/cloudregion/CloudRegionRestV1.java
index 6cf42e1433..49cc0190db 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/cloudregion/CloudRegionRestV1.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/cloudregion/CloudRegionRestV1.java
@@ -39,15 +39,18 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
@Path("/v1/cloud-region")
-@Api(value = "/v1/cloud-region", description = "root of cloud region adapter")
+@OpenAPIDefinition(info = @Info(title = "/v1/cloud-region", description = "root of cloud region adapter"))
@Component
public class CloudRegionRestV1 {
private static Logger logger = LoggerFactory.getLogger(CloudRegionRestV1.class);
@@ -58,13 +61,12 @@ public class CloudRegionRestV1 {
@POST
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "CreateCloudRegion", response = Response.class,
- notes = "Create a cloud site in MSO and Region In AAI")
- @ApiResponses({@ApiResponse(code = 201, message = "Cloud Region has been created"),
- @ApiResponse(code = 500, message = "Create Cloud Region has failed")})
+ @Operation(description = "CreateCloudRegion", summary = "Create a cloud site in MSO and Region In AAI")
+ @ApiResponses({@ApiResponse(responseCode = "201", description = "Cloud Region has been created"),
+ @ApiResponse(responseCode = "500", description = "Create Cloud Region has failed")})
public Response createCloudRegion(
- @ApiParam(value = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
- @ApiParam(value = "CloudSite", required = true) final CloudSite cloudSite) {
+ @Parameter(name = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
+ @Parameter(name = "CloudSite", required = true) final CloudSite cloudSite) {
cloudRestImpl.createCloudRegion(cloudSite);
return Response.status(HttpStatus.SC_CREATED).build();
}
@@ -73,12 +75,12 @@ public class CloudRegionRestV1 {
@Path("{cloud-region-id}/{cloud-owner}")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "CreateCloudRegion", response = Response.class, notes = "Delete an cloud Region in SO")
- @ApiResponses({@ApiResponse(code = 204, message = "cloud Region has been deleted"),
- @ApiResponse(code = 500, message = "Cloud Region delete has failed")})
+ @Operation(description = "CreateCloudRegion", summary = "Delete an cloud Region in SO")
+ @ApiResponses({@ApiResponse(responseCode = "204", description = "cloud Region has been deleted"),
+ @ApiResponse(responseCode = "500", description = "Cloud Region delete has failed")})
public Response deleteCloudRegion(
- @ApiParam(value = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
- @ApiParam(value = "cloud-owner", required = true) @PathParam("cloud-owner") String cloudOwner) {
+ @Parameter(name = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
+ @Parameter(name = "cloud-owner", required = true) @PathParam("cloud-owner") String cloudOwner) {
cloudRestImpl.deleteCloudRegion(cloudRegionId);
return Response.status(HttpStatus.SC_NO_CONTENT).build();
}
@@ -87,13 +89,13 @@ public class CloudRegionRestV1 {
@Path("{cloud-region-id}/{cloud-owner}")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "CreateCloudRegion", response = Response.class, notes = "Update an existing Cloud Region")
- @ApiResponses({@ApiResponse(code = 200, message = "Cloud Region has been updated"),
- @ApiResponse(code = 500, message = "Update Cloud Region has failed examine entity object for details")})
+ @Operation(description = "CreateCloudRegion", summary = "Update an existing Cloud Region")
+ @ApiResponses({@ApiResponse(responseCode = "200", description = "Cloud Region has been updated"), @ApiResponse(
+ responseCode = "500", description = "Update Cloud Region has failed examine entity object for details")})
public Response updateCloudRegion(
- @ApiParam(value = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
- @ApiParam(value = "cloud-owner", required = true) @PathParam("cloud-owner") String cloudOwner,
- @ApiParam(value = "CloudSite", required = true) final CloudSite cloudSite) {
+ @Parameter(name = "cloud-region-id", required = true) @PathParam("cloud-region-id") String cloudRegionId,
+ @Parameter(name = "cloud-owner", required = true) @PathParam("cloud-owner") String cloudOwner,
+ @Parameter(name = "CloudSite", required = true) final CloudSite cloudSite) {
cloudRestImpl.updateCloudRegion(cloudSite);
return Response.status(HttpStatus.SC_OK).build();
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java
deleted file mode 100644
index 214cebb338..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 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.network;
-
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.onap.logging.filter.base.ErrorCode;
-import org.onap.so.logger.MessageEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ContrailPolicyRef {
-
- private static final Logger logger = LoggerFactory.getLogger(ContrailPolicyRef.class);
-
- @JsonProperty("network_policy_refs_data_sequence")
- private ContrailPolicyRefSeq seq;
-
- public JsonNode toJsonNode() {
- JsonNode node = null;
- try {
- ObjectMapper mapper = new ObjectMapper();
- node = mapper.convertValue(this, JsonNode.class);
- } catch (Exception e) {
- logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR,
- ErrorCode.SchemaError.getValue(), e);
- }
-
- return node;
- }
-
- public String toJsonString() {
- String jsonString = null;
- try {
- ObjectMapper mapper = new ObjectMapper();
- jsonString = mapper.writeValueAsString(this);
- } catch (Exception e) {
- logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR,
- ErrorCode.SchemaError.getValue(), e);
- }
-
- return jsonString;
- }
-
- public void populate(String major, String minor) {
- seq = new ContrailPolicyRefSeq(major, minor);
- return;
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java
deleted file mode 100644
index d5ea301dd3..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ContrailPolicyRefSeq {
-
- @JsonProperty("network_policy_refs_data_sequence_major")
- private String major;
-
- @JsonProperty("network_policy_refs_data_sequence_minor")
- private String minor;
-
- public ContrailPolicyRefSeq() {
- /* To be done */
- }
-
- public ContrailPolicyRefSeq(String major, String minor) {
- super();
- this.major = major;
- this.minor = minor;
- }
-
- public String getMajor() {
- return major;
- }
-
- public void setMajor(String major) {
- this.major = major;
- }
-
- public String getMinor() {
- return minor;
- }
-
- public void setMinor(String minor) {
- this.minor = minor;
- }
-
- @Override
- public String toString() {
- return "ContrailPolicyRefSeq [major=" + major + ", minor=" + minor + "]";
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java
deleted file mode 100644
index ba4e93fa93..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 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.network;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.ArrayList;
-import java.util.List;
-import org.onap.logging.filter.base.ErrorCode;
-import org.onap.so.logger.MessageEnum;
-import org.onap.so.openstack.beans.HostRoute;
-import org.onap.so.openstack.beans.Pool;
-import org.onap.so.openstack.beans.Subnet;
-import org.onap.so.openstack.utils.MsoCommonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class ContrailSubnet {
-
- private static final Logger logger = LoggerFactory.getLogger(ContrailSubnet.class);
- @Autowired
- private MsoCommonUtils msoCommonUtils;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet")
- private ContrailSubnetIp subnet = new ContrailSubnetIp();
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway")
- private String defaultGateway;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name")
- private String subnetName;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp")
- private Boolean enableDhcp;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start")
- private Boolean addrFromStart = true;
- /**
- * future - leave this commented private String subnet_uuid; private String dns_server_address; private List<String>
- * dns_nameservers; private String dhcp_option_list;
- **/
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools")
- private List<ContrailSubnetPool> allocationPools = new ArrayList<>();
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes")
- private final ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes();
-
- public ContrailSubnet() {
- super();
- }
-
- public String getDefaultGateway() {
- return defaultGateway;
- }
-
- public void setDefaultGateway(String defaultGateway) {
- this.defaultGateway = defaultGateway;
- }
-
- public ContrailSubnetIp getSubnet() {
- return subnet;
- }
-
- public void setSubnet(ContrailSubnetIp subnet) {
- this.subnet = subnet;
- }
-
- public Boolean isEnableDhcp() {
- return enableDhcp;
- }
-
- public void setEnableDhcp(Boolean enableDhcp) {
- this.enableDhcp = enableDhcp;
- }
-
- public String getSubnetName() {
- return subnetName;
- }
-
- public void setSubnetName(String subnetName) {
- this.subnetName = subnetName;
- }
-
- public List<ContrailSubnetPool> getAllocationPools() {
- return allocationPools;
- }
-
- public void setPools(List<ContrailSubnetPool> allocationPools) {
- this.allocationPools = allocationPools;
- }
-
- public Boolean isAddrFromStart() {
- return addrFromStart;
- }
-
- public void setAddrFromStart(Boolean addrFromStart) {
- this.addrFromStart = addrFromStart;
- }
-
- public JsonNode toJsonNode() {
- JsonNode node = null;
- try {
- ObjectMapper mapper = new ObjectMapper();
- node = mapper.convertValue(this, JsonNode.class);
- } catch (Exception e) {
- logger.error("{} {} Error creating JsonNode for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR,
- ErrorCode.SchemaError.getValue(), subnetName, e);
- }
-
- return node;
- }
-
- public String toJsonString() {
- String jsonString = null;
- try {
- ObjectMapper mapper = new ObjectMapper();
- jsonString = mapper.writeValueAsString(this);
- } catch (Exception e) {
- logger.error("{} {} Error creating JsonString for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR,
- ErrorCode.SchemaError.getValue(), subnetName, e);
- }
-
- return jsonString;
- }
-
- // poulate contrail subnet with input(from bopel) subnet
- public void populateWith(Subnet inputSubnet) {
- if (inputSubnet != null) {
- if (!msoCommonUtils.isNullOrEmpty(inputSubnet.getSubnetName()))
- subnetName = inputSubnet.getSubnetName();
- else
- subnetName = inputSubnet.getSubnetId();
- enableDhcp = inputSubnet.getEnableDHCP();
- defaultGateway = inputSubnet.getGatewayIp();
- if (!msoCommonUtils.isNullOrEmpty(inputSubnet.getCidr())) {
- int idx = inputSubnet.getCidr().indexOf("/");
- if (idx != -1) {
- subnet.setIpPrefix(inputSubnet.getCidr().substring(0, idx));
- subnet.setIpPrefixLen(inputSubnet.getCidr().substring(idx + 1));
- }
- }
- if (inputSubnet.getAllocationPools() != null) {
- for (Pool pool : inputSubnet.getAllocationPools()) {
- if (!msoCommonUtils.isNullOrEmpty(pool.getStart())
- && !msoCommonUtils.isNullOrEmpty(pool.getEnd())) {
- ContrailSubnetPool csp = new ContrailSubnetPool();
- csp.populateWith(pool);
- allocationPools.add(csp);
- }
- }
- }
- if (inputSubnet.getHostRoutes() != null) {
- List<ContrailSubnetHostRoute> hrList = hostRoutes.getHostRoutes();
- for (HostRoute hr : inputSubnet.getHostRoutes()) {
- if (!msoCommonUtils.isNullOrEmpty(hr.getPrefix())
- || !msoCommonUtils.isNullOrEmpty(hr.getNextHop())) {
- ContrailSubnetHostRoute cshr = new ContrailSubnetHostRoute();
- cshr.populateWith(hr);
- hrList.add(cshr);
- }
- }
- }
- }
- }
-
- @Override
- public String toString() {
- StringBuilder buf = new StringBuilder();
- for (ContrailSubnetPool pool : allocationPools) {
- buf.append(pool.toString());
- }
- return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway + " enable_dhcp="
- + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools="
- + buf + " ]";
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java
deleted file mode 100644
index 32f85ddf60..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-import org.onap.so.openstack.beans.HostRoute;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ContrailSubnetHostRoute {
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_prefix")
- private String prefix;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_next_hop")
- private String nextHop;
-
- public ContrailSubnetHostRoute() {}
-
- public String getPrefix() {
- return prefix;
- }
-
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-
- public String getNextHop() {
- return nextHop;
- }
-
- public void setNextHop(String nextHop) {
- this.nextHop = nextHop;
- }
-
- public void populateWith(HostRoute hostRoute) {
- if (hostRoute != null) {
- prefix = hostRoute.getPrefix();
- nextHop = hostRoute.getNextHop();
- }
- }
-
- @Override
- public String toString() {
- return "ContrailSubnetHostRoute [prefix=" + prefix + ", nextHop=" + nextHop + "]";
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java
deleted file mode 100644
index 0802194b4a..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ContrailSubnetHostRoutes {
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route")
- private List<ContrailSubnetHostRoute> hostRoutes = new ArrayList<>();
-
- public ContrailSubnetHostRoutes() {}
-
- public List<ContrailSubnetHostRoute> getHostRoutes() {
- return hostRoutes;
- }
-
- public void setHostRoutes(List<ContrailSubnetHostRoute> hostRoutes) {
- this.hostRoutes = hostRoutes;
- }
-
- @Override
- public String toString() {
- StringBuilder buf = new StringBuilder();
- if (hostRoutes != null) {
- for (ContrailSubnetHostRoute hr : hostRoutes) {
- buf.append(hr.toString());
- }
- }
- return "ContrailSubnetHostRoutes [" + buf.toString() + "]";
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java
deleted file mode 100644
index a00a1eb5ea..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ContrailSubnetIp {
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix")
- private String ipPrefix;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len")
- private String ipPrefixLen;
-
- public ContrailSubnetIp() {
- /* Empty constructor */
- }
-
- public String getIpPrefix() {
- return ipPrefix;
- }
-
- public void setIpPrefix(String ipPrefix) {
- this.ipPrefix = ipPrefix;
- }
-
- public String getIpPrefixLen() {
- return ipPrefixLen;
- }
-
- public void setIpPrefixLen(String ipPrefixLen) {
- this.ipPrefixLen = ipPrefixLen;
- }
-
- @Override
- public String toString() {
- return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]";
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java
deleted file mode 100644
index edba780318..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-import org.onap.so.openstack.beans.Pool;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ContrailSubnetPool {
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_start")
- private String start;
-
- @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_end")
- private String end;
-
- public ContrailSubnetPool() {
- /* Empty constructor */
- }
-
- public String getStart() {
- return start;
- }
-
- public void setStart(String start) {
- this.start = start;
- }
-
- public String getEnd() {
- return end;
- }
-
- public void setEnd(String end) {
- this.end = end;
- }
-
- public void populateWith(Pool pool) {
- if (pool != null) {
- start = pool.getStart();
- end = pool.getEnd();
- }
- }
-
- @Override
- public String toString() {
- return "ContrailSubnetPool [start=" + start + ", end=" + end + "]";
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java
deleted file mode 100644
index 52340d684a..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-
-import java.util.List;
-import java.util.Map;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebParam.Mode;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.ws.Holder;
-import org.onap.so.adapters.network.exceptions.NetworkException;
-import org.onap.so.entity.MsoRequest;
-import org.onap.so.openstack.beans.NetworkRollback;
-import org.onap.so.openstack.beans.NetworkStatus;
-import org.onap.so.openstack.beans.RouteTarget;
-import org.onap.so.openstack.beans.Subnet;
-
-@Deprecated
-@WebService(name = "NetworkAdapter", targetNamespace = "http://org.onap.so/network")
-public interface MsoNetworkAdapter {
- // TODO: Rename all of these to include Vlan in the service name? At least for the
- // create and update calls, since they are specific to VLAN-based provider networks.
-
- /**
- * This is the "Create Network" Web Service Endpoint definition.
- */
- @WebMethod
- public void createNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkType") @XmlElement(required = true) String networkType,
- @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid,
- @WebParam(name = "networkName") @XmlElement(required = true) String networkName,
- @WebParam(name = "physicalNetworkName") String physicalNetworkName,
- @WebParam(name = "vlans") List<Integer> vlans, @WebParam(name = "shared") String shared,
- @WebParam(name = "external") String external, @WebParam(name = "failIfExists") Boolean failIfExists,
- @WebParam(name = "backout") Boolean backout, @WebParam(name = "subnets") List<Subnet> subnets,
- @WebParam(name = "networkParams") Map<String, String> networkParams,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId,
- @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap,
- @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException;
-
- @WebMethod
- public void createNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkType") @XmlElement(required = true) String networkType,
- @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid,
- @WebParam(name = "networkName") @XmlElement(required = true) String networkName,
- @WebParam(name = "routeTargets") List<RouteTarget> routeTargets, @WebParam(name = "shared") String shared,
- @WebParam(name = "external") String external, @WebParam(name = "failIfExists") Boolean failIfExists,
- @WebParam(name = "backout") Boolean backout, @WebParam(name = "subnets") List<Subnet> subnets,
- @WebParam(name = "networkParams") Map<String, String> networkParams,
- @WebParam(name = "policyFqdns") List<String> policyFqdns,
- @WebParam(name = "routeTableFqdns") List<String> routeTableFqdns,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId,
- @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId,
- @WebParam(name = "networkFqdn", mode = Mode.OUT) Holder<String> networkFqdn,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap,
- @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException;
-
- /**
- * This is the "Update VLANs" Web Service Endpoint definition. This webservice replaces the set of VLANs on a
- * network.
- */
- @WebMethod
- public void updateNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkType") @XmlElement(required = true) String networkType,
- @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid,
- @WebParam(name = "networkId") @XmlElement(required = true) String networkId,
- @WebParam(name = "networkName") @XmlElement(required = true) String networkName,
- @WebParam(name = "physicalNetworkName") @XmlElement(required = true) String physicalNetworkName,
- @WebParam(name = "vlans") @XmlElement(required = true) List<Integer> vlans,
- @WebParam(name = "shared") String shared, @WebParam(name = "external") String external,
- @WebParam(name = "subnets") List<Subnet> subnets,
- @WebParam(name = "networkParams") Map<String, String> networkParams,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap,
- @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException;
-
- @WebMethod
- public void updateNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkType") @XmlElement(required = true) String networkType,
- @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid,
- @WebParam(name = "networkId") @XmlElement(required = true) String networkId,
- @WebParam(name = "networkName") @XmlElement(required = true) String networkName,
- @WebParam(name = "routeTargets") List<RouteTarget> routeTargets, @WebParam(name = "shared") String shared,
- @WebParam(name = "external") String external, @WebParam(name = "subnets") List<Subnet> subnets,
- @WebParam(name = "networkParams") Map<String, String> networkParams,
- @WebParam(name = "policyFqdns") List<String> policyFqdns,
- @WebParam(name = "routeTableFqdns") List<String> routeTableFqdns,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap,
- @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException;
-
- /**
- * TODO: This is the "Add VLAN" Web Service Endpoint definition. This webservice adds a VLAN to a network. This
- * service assumes that PO supports querying the current vlans in real time. Otherwise, the caller must have the
- * complete list and should use updateVlans instead.
- *
- * @WebMethod public void addVlan (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
- * @WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
- * @WebParam(name="networkType") @XmlElement(required=true) String networkType,
- * @WebParam(name="networkId") @XmlElement(required=true) String networkId,
- * @WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName,
- * @WebParam(name="vlan") @XmlElement(required=true) Integer vlan,
- * @WebParam(name="rollback", mode=Mode.OUT) Holder<NetworkRollback> rollback ) throws NetworkException;
- */
-
- /**
- * TODO: This is the "Remove VLAN" Web Service Endpoint definition. This webservice removes a VLAN from a network.
- * This service assumes that PO supports querying the current vlans in real time. Otherwise, the caller must have
- * the complete list and should use updateVlans instead.
- *
- * This service returns an indicator (noMoreVLans) if the VLAN that was removed was the last one on the network.
- *
- * It is not clear that Rollback will work for delete. The network can be recreated from the NetworkRollback object,
- * but the network ID (and stack ID for Heat-based orchestration) will be different. The caller will need to know to
- * update these identifiers in the inventory DB (A&AI).
- *
- * @WebMethod public void removeVlan (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
- * @WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
- * @WebParam(name="networkType") @XmlElement(required=true) String networkType,
- * @WebParam(name="networkId") @XmlElement(required=true) String networkId,
- * @WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName,
- * @WebParam(name="vlan") @XmlElement(required=true) Integer vlan,
- * @WebParam(name="noMoreVlans", mode=Mode.OUT) Holder<Boolean> noMoreVlans,
- * @WebParam(name="rollback", mode=Mode.OUT) Holder<NetworkRollback> rollback ) throws NetworkException;
- */
-
- /**
- * This is the "Query Network" Web Service Endpoint definition. TODO: Should this just return the NetworkInfo
- * complete structure?
- */
- @WebMethod
- public void queryNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkNameOrId") @XmlElement(required = true) String networkNameOrId,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "networkExists", mode = Mode.OUT) Holder<Boolean> networkExists,
- @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId,
- @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId,
- @WebParam(name = "status", mode = Mode.OUT) Holder<NetworkStatus> status,
- @WebParam(name = "vlans", mode = Mode.OUT) Holder<List<Integer>> vlans,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap)
- throws NetworkException;
-
- @WebMethod
- public void queryNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkNameOrId") @XmlElement(required = true) String networkNameOrId,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "networkExists", mode = Mode.OUT) Holder<Boolean> networkExists,
- @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId,
- @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId,
- @WebParam(name = "status", mode = Mode.OUT) Holder<NetworkStatus> status,
- @WebParam(name = "routeTargets", mode = Mode.OUT) Holder<List<RouteTarget>> routeTargets,
- @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap)
- throws NetworkException;
-
- /**
- * This is the "Delete Network" Web Service endpoint definition.
- */
- @WebMethod
- public void deleteNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId,
- @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId,
- @WebParam(name = "networkType") @XmlElement(required = true) String networkType,
- @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid,
- @WebParam(name = "networkId") @XmlElement(required = true) String networkId,
- @WebParam(name = "request") MsoRequest msoRequest,
- @WebParam(name = "networkDeleted", mode = Mode.OUT) Holder<Boolean> networkDeleted,
- @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion)
- throws NetworkException;
-
- /**
- * This is the "Rollback Network" Web Service endpoint definition.
- */
- @WebMethod
- public void rollbackNetwork(@WebParam(name = "rollback") @XmlElement(required = true) NetworkRollback rollback,
- @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion)
- throws NetworkException;
-
- @WebMethod
- public void healthCheck();
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index b84d2a8600..cb6a2fac1f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -54,7 +54,6 @@ import org.onap.so.logger.MessageEnum;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.NetworkInfo;
import org.onap.so.openstack.beans.NetworkRollback;
-import org.onap.so.openstack.beans.NetworkStatus;
import org.onap.so.openstack.beans.Pool;
import org.onap.so.openstack.beans.RouteTarget;
import org.onap.so.openstack.beans.StackInfo;
@@ -80,15 +79,13 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Transactional
@WebService(serviceName = "NetworkAdapter", endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapter",
targetNamespace = "http://org.onap.so/network")
-public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
+public class MsoNetworkAdapterImpl {
private static final String OS3_NW_PROPERTY = "org.onap.so.adapters.network.aic3nw";
private static final String OS3_NW = "OS::ContrailV2::VirtualNetwork";
private static final String VLANS = "vlans";
private static final String PHYSICAL_NETWORK = "physical_network";
private static final String UPDATE_NETWORK_CONTEXT = "UpdateNetwork";
- private static final String NETWORK_ID = "network_id";
- private static final String NETWORK_FQDN = "network_fqdn";
private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork";
private static final String NEUTRON_MODE = "NEUTRON";
private static final String CLOUD_OWNER = "CloudOwner";
@@ -128,47 +125,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
public MsoNetworkAdapterImpl() {}
/**
- * Health Check web method. Does nothing but return to show the adapter is deployed.
- */
- @Override
- public void healthCheck() {
- logger.debug("Health check call in Network Adapter");
- }
-
- /**
- * Do not use this constructor or the msoPropertiesFactory will be NULL.
- *
- * @see MsoNetworkAdapterImpl#MsoNetworkAdapterImpl(MsoPropertiesFactory)
- */
-
- @Deprecated
- @Override
- public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
- String networkName, String physicalNetworkName, List<Integer> vlans, String shared, String external,
- Boolean failIfExists, Boolean backout, List<Subnet> subnets, Map<String, String> networkParams,
- MsoRequest msoRequest, Holder<String> networkId, Holder<String> neutronNetworkId,
- Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException {
- Holder<String> networkFqdn = new Holder<>();
- createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, physicalNetworkName,
- vlans, null, shared, external, failIfExists, backout, subnets, null, null, msoRequest, networkId,
- neutronNetworkId, networkFqdn, subnetIdMap, rollback, true, new MutableBoolean());
- }
-
- @Deprecated
- @Override
- public void createNetworkContrail(String cloudSiteId, String tenantId, String networkType,
- String modelCustomizationUuid, String networkName, List<RouteTarget> routeTargets, String shared,
- String external, Boolean failIfExists, Boolean backout, List<Subnet> subnets,
- Map<String, String> networkParams, List<String> policyFqdns, List<String> routeTableFqdns,
- MsoRequest msoRequest, Holder<String> networkId, Holder<String> neutronNetworkId,
- Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback)
- throws NetworkException {
- createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, null, null, routeTargets,
- shared, external, failIfExists, backout, subnets, policyFqdns, routeTableFqdns, msoRequest, networkId,
- neutronNetworkId, networkFqdn, subnetIdMap, rollback, true, new MutableBoolean());
- }
-
- /**
* This is the "Create Network" web service implementation. It will create a new Network of the requested type in
* the specified cloud and tenant. The tenant must exist at the time this service is called.
*
@@ -194,26 +150,13 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
String networkName, String physicalNetworkName, List<Integer> vlans, List<RouteTarget> routeTargets,
String shared, String external, Boolean failIfExists, Boolean backout, List<Subnet> subnets,
- List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> networkId,
- Holder<String> neutronNetworkId, Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap,
- Holder<NetworkRollback> rollback, Boolean pollForCompletion, MutableBoolean isOs3Nw)
- throws NetworkException {
+ List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> stackId,
+ MutableBoolean isOs3Nw) throws NetworkException {
logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis();
- // Build a default rollback object (no actions performed) //TODO remove
- NetworkRollback networkRollback = new NetworkRollback();
- networkRollback.setCloudId(cloudSiteId);
- networkRollback.setTenantId(tenantId);
- networkRollback.setMsoRequest(msoRequest);
- networkRollback.setModelCustomizationUuid(modelCustomizationUuid);
-
- // tenant query is not required here.
- // If the tenant doesn't exist, the Heat calls will fail anyway (when the HeatUtils try to obtain a token).
- // So this is just catching that error in a bit more obvious way up front.
-
Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId);
if (!cloudSiteOpt.isPresent()) {
String error = String.format(
@@ -271,20 +214,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
error);
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
} else {
- // Populate the outputs from the existing stack.
- networkId.value = heatStack.getCanonicalName();
- Map<String, String> sMap = new HashMap<>();
- if (heatStack.getOutputs() != null) {
- neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
- rollback.value = networkRollback; // Default rollback - no updates performed
- if (os3template) {
- networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
- }
- Map<String, Object> outputs = heatStack.getOutputs();
-
- sMap = buildSubnetMap(outputs, subnets, os3template);
- }
- subnetIdMap.value = sMap;
logger.warn("{} {} Found Existing network stack, status={} networkName={} for {}/{}",
MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), heatStack.getStatus(),
networkName, cloudSiteId, tenantId);
@@ -356,8 +285,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
if (backout == null)
backout = true;
heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template, stackParams,
- pollForCompletion, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(),
- failIfExists);
+ false, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(), failIfExists);
} catch (MsoException me) {
me.addContext(CREATE_NETWORK_CONTEXT);
logger.error("{} {} Exception creating network type {} in {}/{} ", MessageEnum.RA_CREATE_NETWORK_EXC,
@@ -366,29 +294,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
}
// Reach this point if createStack is successful.
-
- // For Heat-based orchestration, the MSO-tracked network ID is the heat stack,
- // and the neutronNetworkId is the network UUID returned in stack outputs.
- networkId.value = heatStack.getCanonicalName();
- if (heatStack.getOutputs() != null) {
- neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
- if (os3template) {
- networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
- }
- }
- Map<String, Object> outputs = heatStack.getOutputs();
- Map<String, String> sMap = new HashMap<>();
- if (outputs != null) {
- sMap = buildSubnetMap(outputs, subnets, os3template);
- networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID));
- }
- subnetIdMap.value = sMap;
-
- rollback.value = networkRollback;
- // Populate remaining rollback info and response parameters.
- networkRollback.setNetworkStackId(heatStack.getCanonicalName());
- networkRollback.setNetworkCreated(true);
- networkRollback.setNetworkType(networkType);
+ stackId.value = heatStack.getCanonicalName();
try {
heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_CREATED_STATUS_MESSAGE);
@@ -398,34 +304,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
logger.debug("Network {} successfully created via HEAT", networkName);
-
return;
}
- @Deprecated
- @Override
- public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
- String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, String shared,
- String external, List<Subnet> subnets, Map<String, String> networkParams, MsoRequest msoRequest,
- Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException {
- updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, networkName,
- physicalNetworkName, vlans, null, shared, external, subnets, null, null, msoRequest, subnetIdMap,
- rollback);
-
- }
-
- @Deprecated
- @Override
- public void updateNetworkContrail(String cloudSiteId, String tenantId, String networkType,
- String modelCustomizationUuid, String networkId, String networkName, List<RouteTarget> routeTargets,
- String shared, String external, List<Subnet> subnets, Map<String, String> networkParams,
- List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest,
- Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException {
- updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, networkName, null, null,
- routeTargets, shared, external, subnets, policyFqdns, routeTableFqdns, msoRequest, subnetIdMap,
- rollback);
- }
-
/**
* This is the "Update Network" web service implementation. It will update an existing Network of the requested type
* in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or
@@ -449,8 +330,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
String networkId, String networkName, String physicalNetworkName, List<Integer> vlans,
List<RouteTarget> routeTargets, String shared, String external, List<Subnet> subnets,
- List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest,
- Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException {
+ List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> stackId)
+ throws NetworkException {
logger.debug("***UPDATE Network adapter with Network: {} of type {} in {}/{}", networkName, networkType,
cloudSiteId, tenantId);
@@ -458,12 +339,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Will capture execution time for metrics
long startTime = System.currentTimeMillis();
- // Build a default rollback object (no actions performed)
- NetworkRollback networkRollback = new NetworkRollback();
- networkRollback.setCloudId(cloudSiteId);
- networkRollback.setTenantId(tenantId);
- networkRollback.setMsoRequest(msoRequest);
-
Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId);
if (!cloudSiteOpt.isPresent()) {
String error = String.format(
@@ -474,8 +349,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
-
-
NetworkResource networkResource = networkCheck(startTime, networkType, modelCustomizationUuid, networkName,
physicalNetworkName, vlans, routeTargets, cloudSiteId, cloudSiteOpt.get());
String mode = networkResource.getOrchestrationMode();
@@ -515,15 +388,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(me);
}
- // Add the network ID and previously queried vlans to the rollback object
- networkRollback.setNetworkId(netInfo.getId());
- networkRollback.setNeutronNetworkId(netInfo.getId());
- networkRollback.setNetworkType(networkType);
- // Save previous parameters
- networkRollback.setNetworkName(netInfo.getName());
- networkRollback.setPhysicalNetwork(netInfo.getProvider());
- networkRollback.setVlans(netInfo.getVlans());
-
logger.debug("Network {} updated, id = {}", networkId, netInfo.getId());
} else if ("HEAT".equals(mode)) {
@@ -551,9 +415,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Get the previous parameters for rollback
Map<String, Object> heatParams = heatStack.getParameters();
- String previousNetworkName = (String) heatParams.get("network_name");
- String previousPhysicalNetwork = (String) heatParams.get(PHYSICAL_NETWORK);
-
List<Integer> previousVlans = new ArrayList<>();
String vlansParam = (String) heatParams.get(VLANS);
if (vlansParam != null) {
@@ -569,8 +430,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
logger.debug("Update Stack: Previous VLANS: {}", previousVlans);
// Ready to deploy the updated Network via Heat
-
-
HeatTemplate heatTemplate = networkResource.getHeatTemplate();
if (heatTemplate == null) {
String error = "Network error - undefined Heat Template. Network Type=" + networkType;
@@ -659,28 +518,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(me);
}
- Map<String, Object> outputs = heatStack.getOutputs();
- Map<String, String> sMap = new HashMap<>();
- if (outputs != null) {
- sMap = buildSubnetMap(outputs, subnets, os3template);
- }
- subnetIdMap.value = sMap;
-
- // Reach this point if createStack is successful.
- // Populate remaining rollback info and response parameters.
- networkRollback.setNetworkStackId(heatStack.getCanonicalName());
- if (null != outputs) {
- networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID));
- } else {
- logger.debug("outputs is NULL");
- }
- networkRollback.setNetworkType(networkType);
- // Save previous parameters
- networkRollback.setNetworkName(previousNetworkName);
- networkRollback.setPhysicalNetwork(previousPhysicalNetwork);
- networkRollback.setVlans(previousVlans);
-
- rollback.value = networkRollback;
+ stackId.value = heatStack.getCanonicalName();
logger.debug("Network {} successfully updated via HEAT", networkId);
}
@@ -769,131 +607,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
return networkResource;
}
- @Override
- public void queryNetwork(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest,
- Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId,
- Holder<NetworkStatus> status, Holder<List<Integer>> vlans, Holder<Map<String, String>> subnetIdMap)
- throws NetworkException {
- queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId, neutronNetworkId,
- status, vlans, null, subnetIdMap);
- }
-
- @Override
- public void queryNetworkContrail(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest,
- Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId,
- Holder<NetworkStatus> status, Holder<List<RouteTarget>> routeTargets,
- Holder<Map<String, String>> subnetIdMap) throws NetworkException {
- queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId, neutronNetworkId,
- status, null, routeTargets, subnetIdMap);
- }
-
- /**
- * This is the queryNetwork method. It returns the existence and status of the specified network, along with its
- * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks
- * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried.
- */
- private void queryNetwork(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest,
- Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId,
- Holder<NetworkStatus> status, Holder<List<Integer>> vlans, Holder<List<RouteTarget>> routeTargets,
- Holder<Map<String, String>> subnetIdMap) throws NetworkException {
-
- logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
-
- if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId)
- || commonUtils.isNullOrEmpty(networkNameOrId)) {
-
- String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
- logger.error(LoggingAnchor.THREE, MessageEnum.RA_MISSING_PARAM, ErrorCode.DataError.getValue(), error);
- throw new NetworkException(error, MsoExceptionCategory.USERDATA);
- }
-
- Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId);
- if (!cloudSiteOpt.isPresent()) {
- String error = String.format(
- "Configuration Error. Stack %s in %s/%s: CloudSite does not exist in MSO Configuration",
- networkNameOrId, cloudSiteId, tenantId);
- logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error);
- // Set the detailed error as the Exception 'message'
- throw new NetworkException(error, MsoExceptionCategory.USERDATA);
- }
-
- // Use MsoNeutronUtils for all NEUTRON commands
-
- String neutronId = null;
- // Try Heat first, since networks may be named the same as the Heat stack
- StackInfo heatStack = null;
- try {
- heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkNameOrId);
- } catch (MsoException me) {
- me.addContext("QueryNetwork");
- logger.error("{} {} Exception - Query Network (heat): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
- ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me);
- throw new NetworkException(me);
- }
-
- // Populate the outputs based on the returned Stack information
- if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) {
- // Found it. Get the neutronNetworkId for further query
- Map<String, String> sMap = new HashMap<>();
- Map<String, Object> outputs = heatStack.getOutputs();
- if (outputs != null) {
- neutronId = (String) outputs.get(NETWORK_ID);
-
- for (String key : outputs.keySet()) {
- if (key != null && key.startsWith("subnet_id_")) // multiples subnet_%aaid% outputs
- {
- String subnetUUId = (String) outputs.get(key);
- sMap.put(key.substring("subnet_id_".length()), subnetUUId);
- } else if (key != null && key.startsWith("subnet")) // one subnet output expected
- {
- Map<String, String> map = getSubnetUUId(key, outputs, null);
- sMap.putAll(map);
- }
-
- }
- }
- subnetIdMap.value = sMap;
- }
-
- // Query directly against the Neutron Network for the details
- // no RouteTargets available for ContrailV2 in neutron net-show
- // networkId is heatStackId
- try {
- NetworkInfo netInfo = neutron.queryNetwork(neutronId, tenantId, cloudSiteId);
- if (netInfo != null) {
- // Found. Populate the output elements
- networkExists.value = Boolean.TRUE;
- if (heatStack != null) {
- networkId.value = heatStack.getCanonicalName();
- } else {
- networkId.value = netInfo.getId();
- }
- neutronNetworkId.value = netInfo.getId();
- status.value = netInfo.getStatus();
- if (vlans != null)
- vlans.value = netInfo.getVlans();
-
- logger.debug("Network {}, ID = {}{}", networkNameOrId, networkId.value,
- (",NeutronId = " + neutronNetworkId.value));
- } else {
- // Not found. Populate the status fields, leave the rest null
- networkExists.value = Boolean.FALSE;
- status.value = NetworkStatus.NOTFOUND;
- neutronNetworkId.value = null;
- if (vlans != null)
- vlans.value = new ArrayList<>();
-
- logger.debug("Network {} not found", networkNameOrId);
- }
- } catch (MsoException me) {
- me.addContext("QueryNetwork");
- logger.error("{} {} Exception - Query Network (neutron): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
- ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me);
- throw new NetworkException(me);
- }
- return;
- }
-
/**
* This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and
* tenant.
@@ -909,10 +622,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
* The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete
* will require manual fallout in the client.
*/
- @Override
public void deleteNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid,
- String networkId, MsoRequest msoRequest, Holder<Boolean> networkDeleted, Boolean pollForCompletion)
- throws NetworkException {
+ String networkId, MsoRequest msoRequest) throws NetworkException {
logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId);
if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId)
|| commonUtils.isNullOrEmpty(networkId)) {
@@ -921,16 +632,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
- if (pollForCompletion == null) {
- pollForCompletion = true;
- }
-
int timeoutMinutes = heat.getNetworkHeatTimeoutValue(modelCustomizationUuid, networkType);
+ boolean networkDeleted = false;
try {
- StackInfo stack =
- heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes);
- networkDeleted.value = stack.isOperationPerformed();
+ StackInfo stack = heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, false, timeoutMinutes);
+ networkDeleted = stack.isOperationPerformed();
} catch (MsoException me) {
me.addContext("DeleteNetwork");
logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC,
@@ -940,7 +647,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
try {
heat.updateResourceStatus(msoRequest.getRequestId(),
- networkDeleted.value ? NETWORK_DELETED_STATUS_MESSAGE : NETWORK_NOT_EXIST_STATUS_MESSAGE);
+ networkDeleted ? NETWORK_DELETED_STATUS_MESSAGE : NETWORK_NOT_EXIST_STATUS_MESSAGE);
} catch (Exception e) {
logger.warn("Exception while updating infra active request", e);
}
@@ -954,17 +661,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
* The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF
* creation.
*/
- @Override
- public void rollbackNetwork(NetworkRollback rollback, Boolean pollForCompletion) throws NetworkException {
+ public void rollbackNetwork(NetworkRollback rollback) throws NetworkException {
if (rollback == null) {
logger.error("{} {} rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.DataError.getValue());
return;
}
- if (pollForCompletion == null) {
- pollForCompletion = true;
- }
-
// Get the elements of the VnfRollback object for easier access
String cloudSiteId = rollback.getCloudId();
String tenantId = rollback.getTenantId();
@@ -974,7 +676,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
if (rollback.getNetworkCreated()) {
try {
- heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, 120);
+ heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, false, 120);
} catch (MsoException me) {
me.addContext("RollbackNetwork");
logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ",
@@ -1324,7 +1026,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
return heatTemplate;
}
- // TODO remove
public Map<String, String> getSubnetUUId(String key, Map<String, Object> outputs, List<Subnet> subnets) {
Map<String, String> sMap = new HashMap<>();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java
index 1446047ebd..28763f2228 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java
@@ -23,21 +23,16 @@
package org.onap.so.adapters.openstack;
import java.util.Arrays;
-import javax.xml.ws.Endpoint;
+import java.util.HashSet;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
-import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.onap.so.adapters.cloudregion.CloudRegionRestV1;
-import org.onap.so.adapters.network.MsoNetworkAdapterImpl;
-import org.onap.so.adapters.vnf.MsoVnfAdapterImpl;
import org.onap.so.client.policy.JettisonStyleMapperProvider;
-import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
-import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
@@ -50,10 +45,6 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@Configuration
public class CXFConfiguration {
@Autowired
- private MsoNetworkAdapterImpl networkAdapterImpl;
- @Autowired
- private MsoVnfAdapterImpl vnfAdapterImpl;
- @Autowired
private CloudRegionRestV1 cloudRegionRestV1;
@Autowired
private JettisonStyleMapperProvider jettisonStyleObjectMapper;
@@ -75,20 +66,6 @@ public class CXFConfiguration {
return servletRegistrationBean;
}
- /*
- * network adapter endpoint
- */
- @Bean
- public Endpoint networkAdapterEndpoint() {
- EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterImpl);
- endpoint.publish("/NetworkAdapter");
- endpoint.setWsdlLocation("NetworkAdapter.wsdl");
- endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
- endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
- endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
- return endpoint;
- }
-
// Uses normal Jackson marshalling semantics
@Bean
public Server rsServerApi() {
@@ -101,18 +78,17 @@ public class CXFConfiguration {
return endpoint.create();
}
-
@Bean
- public Swagger2Feature createSwaggerFeature() {
- Swagger2Feature swagger2Feature = new Swagger2Feature();
- swagger2Feature.setPrettyPrint(true);
- swagger2Feature.setTitle("SO Orchestration Application");
- swagger2Feature.setContact("The ONAP SO team");
- swagger2Feature.setDescription("This project is the SO Orchestration Engine");
- swagger2Feature.setVersion("1.0.0");
- swagger2Feature.setResourcePackage(
- "org.onap.so.adapters.network,org.onap.so.adapters.tenant,org.onap.so.adapters.vnf");
- swagger2Feature.setScan(true);
- return swagger2Feature;
+ public OpenApiFeature createSwaggerFeature() {
+ OpenApiFeature openApiFeature = new OpenApiFeature();
+ openApiFeature.setPrettyPrint(true);
+ openApiFeature.setTitle("SO Orchestration Application");
+ openApiFeature.setContactName("The ONAP SO team");
+ openApiFeature.setDescription("This project is the SO Orchestration Engine");
+ openApiFeature.setVersion("1.0.0");
+ openApiFeature.setResourcePackages(
+ new HashSet<String>(Arrays.asList("org.onap.so.adapters.network,org.onap.so.adapters.vnf")));
+ openApiFeature.setScan(true);
+ return openApiFeature;
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
index f13b5bda7c..31da330c7f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
@@ -38,6 +38,7 @@ import org.onap.so.adapters.nwrest.CreateNetworkRequest;
import org.onap.so.adapters.nwrest.CreateNetworkResponse;
import org.onap.so.adapters.nwrest.DeleteNetworkRequest;
import org.onap.so.adapters.nwrest.DeleteNetworkResponse;
+import org.onap.so.adapters.nwrest.RollbackNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.adapters.vnf.MsoVnfAdapterImpl;
@@ -157,6 +158,13 @@ public class PollService extends ExternalTaskUtils {
UpdateNetworkResponse updateResponse =
new UpdateNetworkResponse(req.getNetworkId(), null, null, req.getMessageId());
response = Optional.of(updateResponse.toXmlString());
+ } else if ("rollbackNetworkRequest".equals(requestType.get())) {
+ logger.debug("Executing External Task Poll Service for Rollback Network");
+ String stackId = externalTask.getVariable("stackId");
+ RollbackNetworkRequest req =
+ JAXB.unmarshal(new StringReader(xmlRequest), RollbackNetworkRequest.class);
+ pollDeleteResource(118, req.getNetworkRollback().getCloudId(),
+ req.getNetworkRollback().getTenantId(), stackId, success);
}
}
} catch (Exception e) {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
index 52dfa6a534..4636a91d5c 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
@@ -88,11 +88,9 @@ public class RollbackService extends ExternalTaskUtils {
}
} else if ("createNetworkRequest".equals(requestType.get())) {
logger.debug("Executing External Task Rollback Service for Create Network");
- Holder<Boolean> networkDeleted = new Holder<>();
CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class);
networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
- req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest(), networkDeleted,
- false);
+ req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest());
pollRollbackStatus = true;
success = true;
}
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 9d217380d6..9b2badd1e7 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
@@ -43,7 +43,6 @@ import org.onap.so.adapters.nwrest.DeleteNetworkRequest;
import org.onap.so.adapters.nwrest.ProviderVlanNetwork;
import org.onap.so.adapters.nwrest.RollbackNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
-import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.adapters.vnf.MsoVnfAdapterImpl;
import org.onap.so.adapters.vnf.MsoVnfPluginAdapterImpl;
import org.onap.so.adapters.vnf.VnfAdapterUtils;
@@ -97,8 +96,6 @@ public class StackService extends ExternalTaskUtils {
try {
if (xmlRequest != null) {
Optional<String> requestType = findRequestType(xmlRequest);
- Holder<Map<String, String>> subnetIdMap = new Holder<>();
- Holder<NetworkRollback> networkRollback = new Holder<>();
if ("createVolumeGroupRequest".equals(requestType.get())) {
logger.debug("Executing External Task Stack Service For Create Volume Group");
createVolumeGroup(xmlRequest, canonicalStackId, backout, success);
@@ -112,11 +109,11 @@ public class StackService extends ExternalTaskUtils {
logger.debug("Executing External Task Stack Service For Delete Volume Group");
deleteVolumeGroup(xmlRequest, canonicalStackId, backout, success);
} else if ("createNetworkRequest".equals(requestType.get())) {
- createNetwork(xmlRequest, subnetIdMap, networkRollback, canonicalStackId, backout, success, os3Nw);
+ createNetwork(xmlRequest, canonicalStackId, backout, success, os3Nw);
} else if ("deleteNetworkRequest".equals(requestType.get())) {
deleteNetwork(xmlRequest, canonicalStackId, backout, success);
} else if ("updateNetworkRequest".equals(requestType.get())) {
- updateNetwork(xmlRequest, subnetIdMap, networkRollback, canonicalStackId, backout, success);
+ updateNetwork(xmlRequest, canonicalStackId, backout, success);
} else if ("rollbackNetworkRequest".equals(requestType.get())) {
rollbackNetwork(xmlRequest, canonicalStackId, backout, success);
}
@@ -217,14 +214,9 @@ public class StackService extends ExternalTaskUtils {
canonicalStackId.value = req.getVolumeGroupStackId();
}
- private void createNetwork(String xmlRequest, Holder<Map<String, String>> subnetIdMap,
- Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout,
+ private void createNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout,
MutableBoolean success, MutableBoolean os3) throws NetworkException {
- Holder<String> networkId = new Holder<>();
- Holder<String> neutronNetworkId = new Holder<>();
- Holder<String> networkFqdn = new Holder<>();
-
CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class);
HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams();
if (params == null) {
@@ -268,20 +260,18 @@ 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, true, os3);
+ canonicalStackId, os3);
success.setTrue();
backout.setValue(req.getBackout());
- canonicalStackId.value = networkRollback.value.getNetworkStackId();
}
private void deleteNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout,
MutableBoolean success) throws NetworkException {
backout.setFalse();
DeleteNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteNetworkRequest.class);
- Holder<Boolean> networkDeleted = new Holder<>();
networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
- req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest(), networkDeleted, false);
+ req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest());
canonicalStackId.value = req.getNetworkStackId();
success.setTrue();
@@ -293,14 +283,13 @@ public class StackService extends ExternalTaskUtils {
RollbackNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), RollbackNetworkRequest.class);
NetworkRollback rollback = req.getNetworkRollback();
- networkAdapterImpl.rollbackNetwork(rollback, false);
+ networkAdapterImpl.rollbackNetwork(rollback);
canonicalStackId.value = rollback.getNetworkStackId();
success.setTrue();
}
- private String updateNetwork(String xmlRequest, Holder<Map<String, String>> subnetIdMap,
- Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout,
+ private void updateNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout,
MutableBoolean success) throws NetworkException {
backout.setFalse();
UpdateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), UpdateNetworkRequest.class);
@@ -347,18 +336,12 @@ public class StackService extends ExternalTaskUtils {
networkAdapterImpl.updateNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),
req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName,
vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(),
- subnetIdMap, networkRollback);
+ canonicalStackId);
success.setTrue();
- canonicalStackId.value = req.getNetworkStackId();
- UpdateNetworkResponse response =
- new UpdateNetworkResponse(req.getNetworkId(), null, subnetIdMap.value, req.getMessageId());
- return response.toXmlString();
}
-
-
protected Optional<String> findRequestType(String xmlString) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java
deleted file mode 100644
index e3c59fd93d..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for createVnfNotification complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="createVnfNotification">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/>
- * &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="outputs" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;element name="rollback" type="{http://org.onap.so/vnfNotify}vnfRollback" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "createVnfNotification",
- propOrder = {"messageId", "completed", "exception", "errorMessage", "vnfId", "outputs", "rollback"})
-public class CreateVnfNotification {
-
- @XmlElement(required = true)
- protected String messageId;
- protected boolean completed;
- protected MsoExceptionCategory exception;
- protected String errorMessage;
- protected String vnfId;
- protected CreateVnfNotification.Outputs outputs;
- protected VnfRollback rollback;
-
- /**
- * Gets the value of the messageId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Sets the value of the messageId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMessageId(String value) {
- this.messageId = value;
- }
-
- /**
- * Gets the value of the completed property.
- *
- */
- public boolean isCompleted() {
- return completed;
- }
-
- /**
- * Sets the value of the completed property.
- *
- */
- public void setCompleted(boolean value) {
- this.completed = value;
- }
-
- /**
- * Gets the value of the exception property.
- *
- * @return possible object is {@link MsoExceptionCategory }
- *
- */
- public MsoExceptionCategory getException() {
- return exception;
- }
-
- /**
- * Sets the value of the exception property.
- *
- * @param value allowed object is {@link MsoExceptionCategory }
- *
- */
- public void setException(MsoExceptionCategory value) {
- this.exception = value;
- }
-
- /**
- * Gets the value of the errorMessage property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the value of the errorMessage property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setErrorMessage(String value) {
- this.errorMessage = value;
- }
-
- /**
- * Gets the value of the vnfId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getVnfId() {
- return vnfId;
- }
-
- /**
- * Sets the value of the vnfId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setVnfId(String value) {
- this.vnfId = value;
- }
-
- /**
- * Gets the value of the outputs property.
- *
- * @return possible object is {@link CreateVnfNotification.Outputs }
- *
- */
- public CreateVnfNotification.Outputs getOutputs() {
- return outputs;
- }
-
- /**
- * Sets the value of the outputs property.
- *
- * @param value allowed object is {@link CreateVnfNotification.Outputs }
- *
- */
- public void setOutputs(CreateVnfNotification.Outputs value) {
- this.outputs = value;
- }
-
- /**
- * Gets the value of the rollback property.
- *
- * @return possible object is {@link VnfRollback }
- *
- */
- public VnfRollback getRollback() {
- return rollback;
- }
-
- /**
- * Sets the value of the rollback property.
- *
- * @param value allowed object is {@link VnfRollback }
- *
- */
- public void setRollback(VnfRollback value) {
- this.rollback = value;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"entry"})
- public static class Outputs {
-
- protected List<CreateVnfNotification.Outputs.Entry> entry;
-
- /**
- * Gets the value of the entry property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you
- * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE>
- * method for the entry property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getEntry().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link CreateVnfNotification.Outputs.Entry }
- *
- *
- */
- public List<CreateVnfNotification.Outputs.Entry> getEntry() {
- if (entry == null) {
- entry = new ArrayList<>();
- }
- return this.entry;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"key", "value"})
- public static class Entry {
-
- protected String key;
- protected String value;
-
- /**
- * Gets the value of the key property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- }
-
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java
deleted file mode 100644
index 434cf7f772..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for deleteVnfNotification complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="deleteVnfNotification">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/>
- * &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "deleteVnfNotification", propOrder = {"messageId", "completed", "exception", "errorMessage"})
-public class DeleteVnfNotification {
-
- @XmlElement(required = true)
- protected String messageId;
- protected boolean completed;
- protected MsoExceptionCategory exception;
- protected String errorMessage;
-
- /**
- * Gets the value of the messageId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Sets the value of the messageId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMessageId(String value) {
- this.messageId = value;
- }
-
- /**
- * Gets the value of the completed property.
- *
- */
- public boolean isCompleted() {
- return completed;
- }
-
- /**
- * Sets the value of the completed property.
- *
- */
- public void setCompleted(boolean value) {
- this.completed = value;
- }
-
- /**
- * Gets the value of the exception property.
- *
- * @return possible object is {@link MsoExceptionCategory }
- *
- */
- public MsoExceptionCategory getException() {
- return exception;
- }
-
- /**
- * Sets the value of the exception property.
- *
- * @param value allowed object is {@link MsoExceptionCategory }
- *
- */
- public void setException(MsoExceptionCategory value) {
- this.exception = value;
- }
-
- /**
- * Gets the value of the errorMessage property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the value of the errorMessage property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setErrorMessage(String value) {
- this.errorMessage = value;
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java
deleted file mode 100644
index bb2a9059b9..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (C) 2018 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.vnf.async.client;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each Java content interface and Java element interface generated in the
- * org.onap.so.adapters.vnf.async.client package.
- * <p>
- * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content.
- * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding
- * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in
- * this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private static final String URL = "http://org.onap.so/vnfNotify";
- private static final QName _QueryVnfNotification_QNAME = new QName(URL, "queryVnfNotification");
- private static final QName _RollbackVnfNotification_QNAME = new QName(URL, "rollbackVnfNotification");
- private static final QName _CreateVnfNotification_QNAME = new QName(URL, "createVnfNotification");
- private static final QName _DeleteVnfNotification_QNAME = new QName(URL, "deleteVnfNotification");
- private static final QName _UpdateVnfNotification_QNAME = new QName(URL, "updateVnfNotification");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package:
- * org.onap.so.adapters.vnf.async.client
- *
- */
- public ObjectFactory() {}
-
- /**
- * Create an instance of {@link UpdateVnfNotification }
- *
- */
- public UpdateVnfNotification createUpdateVnfNotification() {
- return new UpdateVnfNotification();
- }
-
- /**
- * Create an instance of {@link UpdateVnfNotification.Outputs }
- *
- */
- public UpdateVnfNotification.Outputs createUpdateVnfNotificationOutputs() {
- return new UpdateVnfNotification.Outputs();
- }
-
- /**
- * Create an instance of {@link CreateVnfNotification }
- *
- */
- public CreateVnfNotification createCreateVnfNotification() {
- return new CreateVnfNotification();
- }
-
- /**
- * Create an instance of {@link CreateVnfNotification.Outputs }
- *
- */
- public CreateVnfNotification.Outputs createCreateVnfNotificationOutputs() {
- return new CreateVnfNotification.Outputs();
- }
-
- /**
- * Create an instance of {@link QueryVnfNotification }
- *
- */
- public QueryVnfNotification createQueryVnfNotification() {
- return new QueryVnfNotification();
- }
-
- /**
- * Create an instance of {@link QueryVnfNotification.Outputs }
- *
- */
- public QueryVnfNotification.Outputs createQueryVnfNotificationOutputs() {
- return new QueryVnfNotification.Outputs();
- }
-
- /**
- * Create an instance of {@link RollbackVnfNotification }
- *
- */
- public RollbackVnfNotification createRollbackVnfNotification() {
- return new RollbackVnfNotification();
- }
-
- /**
- * Create an instance of {@link DeleteVnfNotification }
- *
- */
- public DeleteVnfNotification createDeleteVnfNotification() {
- return new DeleteVnfNotification();
- }
-
- /**
- * Create an instance of {@link MsoRequest }
- *
- */
- public MsoRequest createMsoRequest() {
- return new MsoRequest();
- }
-
- /**
- * Create an instance of {@link VnfRollback }
- *
- */
- public VnfRollback createVnfRollback() {
- return new VnfRollback();
- }
-
- /**
- * Create an instance of {@link UpdateVnfNotification.Outputs.Entry }
- *
- */
- public UpdateVnfNotification.Outputs.Entry createUpdateVnfNotificationOutputsEntry() {
- return new UpdateVnfNotification.Outputs.Entry();
- }
-
- /**
- * Create an instance of {@link CreateVnfNotification.Outputs.Entry }
- *
- */
- public CreateVnfNotification.Outputs.Entry createCreateVnfNotificationOutputsEntry() {
- return new CreateVnfNotification.Outputs.Entry();
- }
-
- /**
- * Create an instance of {@link QueryVnfNotification.Outputs.Entry }
- *
- */
- public QueryVnfNotification.Outputs.Entry createQueryVnfNotificationOutputsEntry() {
- return new QueryVnfNotification.Outputs.Entry();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link QueryVnfNotification }{@code >}}
- *
- */
- @XmlElementDecl(namespace = URL, name = "queryVnfNotification")
- public JAXBElement<QueryVnfNotification> createQueryVnfNotification(QueryVnfNotification value) {
- return new JAXBElement<>(_QueryVnfNotification_QNAME, QueryVnfNotification.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link RollbackVnfNotification }{@code >}}
- *
- */
- @XmlElementDecl(namespace = URL, name = "rollbackVnfNotification")
- public JAXBElement<RollbackVnfNotification> createRollbackVnfNotification(RollbackVnfNotification value) {
- return new JAXBElement<>(_RollbackVnfNotification_QNAME, RollbackVnfNotification.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link CreateVnfNotification }{@code >}}
- *
- */
- @XmlElementDecl(namespace = URL, name = "createVnfNotification")
- public JAXBElement<CreateVnfNotification> createCreateVnfNotification(CreateVnfNotification value) {
- return new JAXBElement<>(_CreateVnfNotification_QNAME, CreateVnfNotification.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link DeleteVnfNotification }{@code >}}
- *
- */
- @XmlElementDecl(namespace = URL, name = "deleteVnfNotification")
- public JAXBElement<DeleteVnfNotification> createDeleteVnfNotification(DeleteVnfNotification value) {
- return new JAXBElement<>(_DeleteVnfNotification_QNAME, DeleteVnfNotification.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link UpdateVnfNotification }{@code >}}
- *
- */
- @XmlElementDecl(namespace = URL, name = "updateVnfNotification")
- public JAXBElement<UpdateVnfNotification> createUpdateVnfNotification(UpdateVnfNotification value) {
- return new JAXBElement<>(_UpdateVnfNotification_QNAME, UpdateVnfNotification.class, null, value);
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java
deleted file mode 100644
index 8681070972..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for queryVnfNotification complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="queryVnfNotification">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/>
- * &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="vnfExists" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- * &lt;element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="status" type="{http://org.onap.so/vnfNotify}vnfStatus" minOccurs="0"/>
- * &lt;element name="outputs" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "queryVnfNotification",
- propOrder = {"messageId", "completed", "exception", "errorMessage", "vnfExists", "vnfId", "status", "outputs"})
-public class QueryVnfNotification {
-
- @XmlElement(required = true)
- protected String messageId;
- protected boolean completed;
- protected MsoExceptionCategory exception;
- protected String errorMessage;
- protected Boolean vnfExists;
- protected String vnfId;
- protected VnfStatus status;
- protected QueryVnfNotification.Outputs outputs;
-
- /**
- * Gets the value of the messageId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Sets the value of the messageId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMessageId(String value) {
- this.messageId = value;
- }
-
- /**
- * Gets the value of the completed property.
- *
- */
- public boolean isCompleted() {
- return completed;
- }
-
- /**
- * Sets the value of the completed property.
- *
- */
- public void setCompleted(boolean value) {
- this.completed = value;
- }
-
- /**
- * Gets the value of the exception property.
- *
- * @return possible object is {@link MsoExceptionCategory }
- *
- */
- public MsoExceptionCategory getException() {
- return exception;
- }
-
- /**
- * Sets the value of the exception property.
- *
- * @param value allowed object is {@link MsoExceptionCategory }
- *
- */
- public void setException(MsoExceptionCategory value) {
- this.exception = value;
- }
-
- /**
- * Gets the value of the errorMessage property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the value of the errorMessage property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setErrorMessage(String value) {
- this.errorMessage = value;
- }
-
- /**
- * Gets the value of the vnfExists property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isVnfExists() {
- return vnfExists;
- }
-
- /**
- * Sets the value of the vnfExists property.
- *
- * @param value allowed object is {@link Boolean }
- *
- */
- public void setVnfExists(Boolean value) {
- this.vnfExists = value;
- }
-
- /**
- * Gets the value of the vnfId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getVnfId() {
- return vnfId;
- }
-
- /**
- * Sets the value of the vnfId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setVnfId(String value) {
- this.vnfId = value;
- }
-
- /**
- * Gets the value of the status property.
- *
- * @return possible object is {@link VnfStatus }
- *
- */
- public VnfStatus getStatus() {
- return status;
- }
-
- /**
- * Sets the value of the status property.
- *
- * @param value allowed object is {@link VnfStatus }
- *
- */
- public void setStatus(VnfStatus value) {
- this.status = value;
- }
-
- /**
- * Gets the value of the outputs property.
- *
- * @return possible object is {@link QueryVnfNotification.Outputs }
- *
- */
- public QueryVnfNotification.Outputs getOutputs() {
- return outputs;
- }
-
- /**
- * Sets the value of the outputs property.
- *
- * @param value allowed object is {@link QueryVnfNotification.Outputs }
- *
- */
- public void setOutputs(QueryVnfNotification.Outputs value) {
- this.outputs = value;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"entry"})
- public static class Outputs {
-
- protected List<QueryVnfNotification.Outputs.Entry> entry;
-
- /**
- * Gets the value of the entry property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you
- * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE>
- * method for the entry property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getEntry().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link QueryVnfNotification.Outputs.Entry }
- *
- *
- */
- public List<QueryVnfNotification.Outputs.Entry> getEntry() {
- if (entry == null) {
- entry = new ArrayList<>();
- }
- return this.entry;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"key", "value"})
- public static class Entry {
-
- protected String key;
- protected String value;
-
- /**
- * Gets the value of the key property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- }
-
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java
deleted file mode 100644
index e5f8878e84..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for rollbackVnfNotification complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="rollbackVnfNotification">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/>
- * &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "rollbackVnfNotification", propOrder = {"messageId", "completed", "exception", "errorMessage"})
-public class RollbackVnfNotification {
-
- @XmlElement(required = true)
- protected String messageId;
- protected boolean completed;
- protected MsoExceptionCategory exception;
- protected String errorMessage;
-
- /**
- * Gets the value of the messageId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Sets the value of the messageId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMessageId(String value) {
- this.messageId = value;
- }
-
- /**
- * Gets the value of the completed property.
- *
- */
- public boolean isCompleted() {
- return completed;
- }
-
- /**
- * Sets the value of the completed property.
- *
- */
- public void setCompleted(boolean value) {
- this.completed = value;
- }
-
- /**
- * Gets the value of the exception property.
- *
- * @return possible object is {@link MsoExceptionCategory }
- *
- */
- public MsoExceptionCategory getException() {
- return exception;
- }
-
- /**
- * Sets the value of the exception property.
- *
- * @param value allowed object is {@link MsoExceptionCategory }
- *
- */
- public void setException(MsoExceptionCategory value) {
- this.exception = value;
- }
-
- /**
- * Gets the value of the errorMessage property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the value of the errorMessage property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setErrorMessage(String value) {
- this.errorMessage = value;
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java
deleted file mode 100644
index 968b3767c3..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for updateVnfNotification complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="updateVnfNotification">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/>
- * &lt;element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="outputs" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;element name="rollback" type="{http://org.onap.so/vnfNotify}vnfRollback" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "updateVnfNotification",
- propOrder = {"messageId", "completed", "exception", "errorMessage", "outputs", "rollback"})
-public class UpdateVnfNotification {
-
- @XmlElement(required = true)
- protected String messageId;
- protected boolean completed;
- protected MsoExceptionCategory exception;
- protected String errorMessage;
- protected UpdateVnfNotification.Outputs outputs;
- protected VnfRollback rollback;
-
- /**
- * Gets the value of the messageId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Sets the value of the messageId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMessageId(String value) {
- this.messageId = value;
- }
-
- /**
- * Gets the value of the completed property.
- *
- */
- public boolean isCompleted() {
- return completed;
- }
-
- /**
- * Sets the value of the completed property.
- *
- */
- public void setCompleted(boolean value) {
- this.completed = value;
- }
-
- /**
- * Gets the value of the exception property.
- *
- * @return possible object is {@link MsoExceptionCategory }
- *
- */
- public MsoExceptionCategory getException() {
- return exception;
- }
-
- /**
- * Sets the value of the exception property.
- *
- * @param value allowed object is {@link MsoExceptionCategory }
- *
- */
- public void setException(MsoExceptionCategory value) {
- this.exception = value;
- }
-
- /**
- * Gets the value of the errorMessage property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the value of the errorMessage property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setErrorMessage(String value) {
- this.errorMessage = value;
- }
-
- /**
- * Gets the value of the outputs property.
- *
- * @return possible object is {@link UpdateVnfNotification.Outputs }
- *
- */
- public UpdateVnfNotification.Outputs getOutputs() {
- return outputs;
- }
-
- /**
- * Sets the value of the outputs property.
- *
- * @param value allowed object is {@link UpdateVnfNotification.Outputs }
- *
- */
- public void setOutputs(UpdateVnfNotification.Outputs value) {
- this.outputs = value;
- }
-
- /**
- * Gets the value of the rollback property.
- *
- * @return possible object is {@link VnfRollback }
- *
- */
- public VnfRollback getRollback() {
- return rollback;
- }
-
- /**
- * Sets the value of the rollback property.
- *
- * @param value allowed object is {@link VnfRollback }
- *
- */
- public void setRollback(VnfRollback value) {
- this.rollback = value;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="entry" maxOccurs="unbounded" minOccurs="0">
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"entry"})
- public static class Outputs {
-
- protected List<UpdateVnfNotification.Outputs.Entry> entry;
-
- /**
- * Gets the value of the entry property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you
- * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE>
- * method for the entry property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getEntry().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link UpdateVnfNotification.Outputs.Entry }
- *
- *
- */
- public List<UpdateVnfNotification.Outputs.Entry> getEntry() {
- if (entry == null) {
- entry = new ArrayList<>();
- }
- return this.entry;
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"key", "value"})
- public static class Entry {
-
- protected String key;
- protected String value;
-
- /**
- * Gets the value of the key property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- }
-
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java
deleted file mode 100644
index d4bdaa3d34..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.ws.Action;
-import javax.xml.ws.RequestWrapper;
-
-
-/**
- * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2
- *
- */
-@WebService(name = "vnfAdapterNotify", targetNamespace = "http://org.onap.so/vnfNotify")
-@XmlSeeAlso({ObjectFactory.class})
-public interface VnfAdapterNotify {
-
-
- /**
- *
- * @param exception
- * @param errorMessage
- * @param messageId
- * @param completed
- */
- @WebMethod
- @Oneway
- @RequestWrapper(localName = "rollbackVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify",
- className = "org.onap.so.adapters.vnf.async.client.RollbackVnfNotification")
- @Action(input = "http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest")
- public void rollbackVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId,
- @WebParam(name = "completed", targetNamespace = "") boolean completed,
- @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception,
- @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage);
-
- /**
- *
- * @param exception
- * @param outputs
- * @param errorMessage
- * @param vnfExists
- * @param messageId
- * @param completed
- * @param vnfId
- * @param status
- */
- @WebMethod
- @Oneway
- @RequestWrapper(localName = "queryVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify",
- className = "org.onap.so.adapters.vnf.async.client.QueryVnfNotification")
- @Action(input = "http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest")
- public void queryVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId,
- @WebParam(name = "completed", targetNamespace = "") boolean completed,
- @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception,
- @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage,
- @WebParam(name = "vnfExists", targetNamespace = "") Boolean vnfExists,
- @WebParam(name = "vnfId", targetNamespace = "") String vnfId,
- @WebParam(name = "status", targetNamespace = "") VnfStatus status, @WebParam(name = "outputs",
- targetNamespace = "") org.onap.so.adapters.vnf.async.client.QueryVnfNotification.Outputs outputs);
-
- /**
- *
- * @param exception
- * @param outputs
- * @param rollback
- * @param errorMessage
- * @param messageId
- * @param completed
- * @param vnfId
- */
- @WebMethod
- @Oneway
- @RequestWrapper(localName = "createVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify",
- className = "org.onap.so.adapters.vnf.async.client.CreateVnfNotification")
- @Action(input = "http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest")
- public void createVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId,
- @WebParam(name = "completed", targetNamespace = "") boolean completed,
- @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception,
- @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage,
- @WebParam(name = "vnfId", targetNamespace = "") String vnfId,
- @WebParam(name = "outputs",
- targetNamespace = "") org.onap.so.adapters.vnf.async.client.CreateVnfNotification.Outputs outputs,
- @WebParam(name = "rollback", targetNamespace = "") VnfRollback rollback);
-
- /**
- *
- * @param exception
- * @param outputs
- * @param rollback
- * @param errorMessage
- * @param messageId
- * @param completed
- */
- @WebMethod
- @Oneway
- @RequestWrapper(localName = "updateVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify",
- className = "org.onap.so.adapters.vnf.async.client.UpdateVnfNotification")
- @Action(input = "http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest")
- public void updateVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId,
- @WebParam(name = "completed", targetNamespace = "") boolean completed,
- @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception,
- @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage,
- @WebParam(name = "outputs",
- targetNamespace = "") org.onap.so.adapters.vnf.async.client.UpdateVnfNotification.Outputs outputs,
- @WebParam(name = "rollback", targetNamespace = "") VnfRollback rollback);
-
- /**
- *
- * @param exception
- * @param errorMessage
- * @param messageId
- * @param completed
- */
- @WebMethod
- @Oneway
- @RequestWrapper(localName = "deleteVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify",
- className = "org.onap.so.adapters.vnf.async.client.DeleteVnfNotification")
- @Action(input = "http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest")
- public void deleteVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId,
- @WebParam(name = "completed", targetNamespace = "") boolean completed,
- @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception,
- @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage);
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java
deleted file mode 100644
index 402d0af8e4..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
-
-
-/**
- * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2
- *
- */
-@WebServiceClient(name = "vnfAdapterNotify", targetNamespace = "http://org.onap.so/vnfNotify",
- wsdlLocation = "/VnfAdapterNotify.wsdl")
-public class VnfAdapterNotify_Service extends Service {
-
- private static final URL VNFADAPTERNOTIFY_WSDL_LOCATION;
- private static final WebServiceException VNFADAPTERNOTIFY_EXCEPTION;
- private static final String VNF_NOTIFY_URL = "http://org.onap.so/vnfNotify";
- private static final QName VNFADAPTERNOTIFY_QNAME = new QName(VNF_NOTIFY_URL, "vnfAdapterNotify");
-
- static {
- VNFADAPTERNOTIFY_WSDL_LOCATION = org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service.class
- .getResource("/VnfAdapterNotify.wsdl");
- WebServiceException e = null;
- if (VNFADAPTERNOTIFY_WSDL_LOCATION == null) {
- e = new WebServiceException(
- "Cannot find '/VnfAdapterNotify.wsdl' wsdl. Place the resource correctly in the classpath.");
- }
- VNFADAPTERNOTIFY_EXCEPTION = e;
- }
-
- public VnfAdapterNotify_Service() {
- super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME);
- }
-
- public VnfAdapterNotify_Service(WebServiceFeature... features) {
- super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME, features);
- }
-
- public VnfAdapterNotify_Service(URL wsdlLocation) {
- super(wsdlLocation, VNFADAPTERNOTIFY_QNAME);
- }
-
- public VnfAdapterNotify_Service(URL wsdlLocation, WebServiceFeature... features) {
- super(wsdlLocation, VNFADAPTERNOTIFY_QNAME, features);
- }
-
- public VnfAdapterNotify_Service(URL wsdlLocation, QName serviceName) {
- super(wsdlLocation, serviceName);
- }
-
- public VnfAdapterNotify_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
- super(wsdlLocation, serviceName, features);
- }
-
- /**
- *
- * @return returns VnfAdapterNotify
- */
- @WebEndpoint(name = "MsoVnfAdapterAsyncImplPort")
- public VnfAdapterNotify getMsoVnfAdapterAsyncImplPort() {
- return super.getPort(new QName(VNF_NOTIFY_URL, "MsoVnfAdapterAsyncImplPort"), VnfAdapterNotify.class);
- }
-
- /**
- *
- * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features
- * not in the <code>features</code> parameter will have their default values.
- * @return returns VnfAdapterNotify
- */
- @WebEndpoint(name = "MsoVnfAdapterAsyncImplPort")
- public VnfAdapterNotify getMsoVnfAdapterAsyncImplPort(WebServiceFeature... features) {
- return super.getPort(new QName(VNF_NOTIFY_URL, "MsoVnfAdapterAsyncImplPort"), VnfAdapterNotify.class, features);
- }
-
- private static URL getWsdlLocation() {
- if (VNFADAPTERNOTIFY_EXCEPTION != null) {
- throw VNFADAPTERNOTIFY_EXCEPTION;
- }
- return VNFADAPTERNOTIFY_WSDL_LOCATION;
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java
deleted file mode 100644
index 7d8b4d1b41..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for vnfRollback complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="vnfRollback">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="cloudSiteId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="msoRequest" type="{http://org.onap.so/vnfNotify}msoRequest" minOccurs="0"/>
- * &lt;element name="tenantCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="tenantId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;element name="vnfCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- * &lt;element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "vnfRollback",
- propOrder = {"cloudSiteId", "msoRequest", "tenantCreated", "tenantId", "vnfCreated", "vnfId"})
-public class VnfRollback {
-
- protected String cloudSiteId;
- protected MsoRequest msoRequest;
- protected boolean tenantCreated;
- protected String tenantId;
- protected boolean vnfCreated;
- protected String vnfId;
-
- /**
- * Gets the value of the cloudSiteId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getCloudSiteId() {
- return cloudSiteId;
- }
-
- /**
- * Sets the value of the cloudSiteId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setCloudSiteId(String value) {
- this.cloudSiteId = value;
- }
-
- /**
- * Gets the value of the msoRequest property.
- *
- * @return possible object is {@link MsoRequest }
- *
- */
- public MsoRequest getMsoRequest() {
- return msoRequest;
- }
-
- /**
- * Sets the value of the msoRequest property.
- *
- * @param value allowed object is {@link MsoRequest }
- *
- */
- public void setMsoRequest(MsoRequest value) {
- this.msoRequest = value;
- }
-
- /**
- * Gets the value of the tenantCreated property.
- *
- */
- public boolean isTenantCreated() {
- return tenantCreated;
- }
-
- /**
- * Sets the value of the tenantCreated property.
- *
- */
- public void setTenantCreated(boolean value) {
- this.tenantCreated = value;
- }
-
- /**
- * Gets the value of the tenantId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTenantId() {
- return tenantId;
- }
-
- /**
- * Sets the value of the tenantId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setTenantId(String value) {
- this.tenantId = value;
- }
-
- /**
- * Gets the value of the vnfCreated property.
- *
- */
- public boolean isVnfCreated() {
- return vnfCreated;
- }
-
- /**
- * Sets the value of the vnfCreated property.
- *
- */
- public void setVnfCreated(boolean value) {
- this.vnfCreated = value;
- }
-
- /**
- * Gets the value of the vnfId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getVnfId() {
- return vnfId;
- }
-
- /**
- * Sets the value of the vnfId property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setVnfId(String value) {
- this.vnfId = value;
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java
deleted file mode 100644
index 767777767c..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.vnf.async.client;
-
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>
- * Java class for vnfStatus.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- * <p>
- *
- * <pre>
- * &lt;simpleType name="vnfStatus">
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * &lt;enumeration value="ACTIVE"/>
- * &lt;enumeration value="FAILED"/>
- * &lt;enumeration value="NOTFOUND"/>
- * &lt;enumeration value="UNKNOWN"/>
- * &lt;/restriction>
- * &lt;/simpleType>
- * </pre>
- *
- */
-@XmlType(name = "vnfStatus")
-@XmlEnum
-public enum VnfStatus {
-
- ACTIVE, FAILED, NOTFOUND, UNKNOWN;
-
- public String value() {
- return name();
- }
-
- public static VnfStatus fromValue(String v) {
- return valueOf(v);
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java
deleted file mode 100644
index cc4a2a78ec..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://org.onap.so/vnfNotify")
-package org.onap.so.adapters.vnf.async.client;
diff --git a/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl
deleted file mode 100644
index 900389f205..0000000000
--- a/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl
+++ /dev/null
@@ -1,295 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. -->
-<definitions targetNamespace="http://org.onap.so/networkNotify" name="networkAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/networkNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <types>
- <xs:schema version="1.0" targetNamespace="http://org.onap.so/networkNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="createNetworkNotification" type="tns:createNetworkNotification"/>
-
- <xs:element name="createNetworkNotificationResponse" type="tns:createNetworkNotificationResponse"/>
-
- <xs:element name="deleteNetworkNotification" type="tns:deleteNetworkNotification"/>
-
- <xs:element name="deleteNetworkNotificationResponse" type="tns:deleteNetworkNotificationResponse"/>
-
- <xs:element name="queryNetworkNotification" type="tns:queryNetworkNotification"/>
-
- <xs:element name="queryNetworkNotificationResponse" type="tns:queryNetworkNotificationResponse"/>
-
- <xs:element name="rollbackNetworkNotification" type="tns:rollbackNetworkNotification"/>
-
- <xs:element name="rollbackNetworkNotificationResponse" type="tns:rollbackNetworkNotificationResponse"/>
-
- <xs:element name="updateNetworkNotification" type="tns:updateNetworkNotification"/>
-
- <xs:element name="updateNetworkNotificationResponse" type="tns:updateNetworkNotificationResponse"/>
-
- <xs:complexType name="queryNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkExists" type="xs:boolean" minOccurs="0"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="status" type="tns:networkStatus" minOccurs="0"/>
- <xs:element name="vlans" type="xs:int" minOccurs="0" maxOccurs="255"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="queryNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="deleteNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkDeleted" type="xs:boolean" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="deleteNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="rollbackNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="rollbackNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="createNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="createNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="updateNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="updateNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="networkRollback">
- <xs:sequence>
- <xs:element name="cloudId" type="xs:string" minOccurs="0"/>
- <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/>
- <xs:element name="networkCreated" type="xs:boolean"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="networkStackId" type="xs:string" minOccurs="0"/>
- <xs:element name="networkName" type="xs:string" minOccurs="0"/>
- <xs:element name="networkType" type="xs:string" minOccurs="0"/>
- <xs:element name="networkUpdated" type="xs:boolean"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="physicalNetwork" type="xs:string" minOccurs="0"/>
- <xs:element name="tenantId" type="xs:string" minOccurs="0"/>
- <xs:element name="vlans" type="xs:int" nillable="true" minOccurs="0" maxOccurs="255"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="msoRequest">
- <xs:sequence>
- <xs:element name="requestId" type="xs:string" minOccurs="0"/>
- <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:simpleType name="msoExceptionCategory">
- <xs:restriction base="xs:string">
- <xs:enumeration value="OPENSTACK"/>
- <xs:enumeration value="IO"/>
- <xs:enumeration value="INTERNAL"/>
- <xs:enumeration value="USERDATA"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="networkStatus">
- <xs:restriction base="xs:string">
- <xs:enumeration value="NOTFOUND"/>
- <xs:enumeration value="ACTIVE"/>
- <xs:enumeration value="DOWN"/>
- <xs:enumeration value="BUILD"/>
- <xs:enumeration value="ERROR"/>
- <xs:enumeration value="UNKNOWN"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
- </types>
- <message name="rollbackNetworkNotification">
- <part name="parameters" element="tns:rollbackNetworkNotification"/>
- </message>
- <message name="rollbackNetworkNotificationResponse">
- <part name="parameters" element="tns:rollbackNetworkNotificationResponse"/>
- </message>
- <message name="queryNetworkNotification">
- <part name="parameters" element="tns:queryNetworkNotification"/>
- </message>
- <message name="queryNetworkNotificationResponse">
- <part name="parameters" element="tns:queryNetworkNotificationResponse"/>
- </message>
- <message name="createNetworkNotification">
- <part name="parameters" element="tns:createNetworkNotification"/>
- </message>
- <message name="createNetworkNotificationResponse">
- <part name="parameters" element="tns:createNetworkNotificationResponse"/>
- </message>
- <message name="deleteNetworkNotification">
- <part name="parameters" element="tns:deleteNetworkNotification"/>
- </message>
- <message name="deleteNetworkNotificationResponse">
- <part name="parameters" element="tns:deleteNetworkNotificationResponse"/>
- </message>
- <message name="updateNetworkNotification">
- <part name="parameters" element="tns:updateNetworkNotification"/>
- </message>
- <message name="updateNetworkNotificationResponse">
- <part name="parameters" element="tns:updateNetworkNotificationResponse"/>
- </message>
- <portType name="networkAdapterNotify">
- <operation name="rollbackNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationRequest" message="tns:rollbackNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationResponse" message="tns:rollbackNetworkNotificationResponse"/>
- </operation>
- <operation name="queryNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationRequest" message="tns:queryNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationResponse" message="tns:queryNetworkNotificationResponse"/>
- </operation>
- <operation name="createNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationRequest" message="tns:createNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationResponse" message="tns:createNetworkNotificationResponse"/>
- </operation>
- <operation name="deleteNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationRequest" message="tns:deleteNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationResponse" message="tns:deleteNetworkNotificationResponse"/>
- </operation>
- <operation name="updateNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationRequest" message="tns:updateNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationResponse" message="tns:updateNetworkNotificationResponse"/>
- </operation>
- </portType>
- <binding name="MsoNetworkAdapterAsyncImplPortBinding" type="tns:networkAdapterNotify">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="rollbackNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="queryNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="createNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="deleteNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="updateNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="networkAdapterNotify">
- <port name="MsoNetworkAdapterAsyncImplPort" binding="tns:MsoNetworkAdapterAsyncImplPortBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
- </port>
- </service>
-</definitions>
-
diff --git a/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl
deleted file mode 100644
index eb3f1033cd..0000000000
--- a/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. -->
-<definitions targetNamespace="http://org.onap.so/vnfNotify" name="vnfAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/vnfNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <types>
- <xs:schema version="1.0" targetNamespace="http://org.onap.so/vnfNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="createVnfNotification" type="tns:createVnfNotification"/>
-
- <xs:element name="updateVnfNotification" type="tns:updateVnfNotification"/>
-
- <xs:element name="deleteVnfNotification" type="tns:deleteVnfNotification"/>
-
- <xs:element name="queryVnfNotification" type="tns:queryVnfNotification"/>
-
- <xs:element name="rollbackVnfNotification" type="tns:rollbackVnfNotification"/>
-
- <xs:complexType name="queryVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfExists" type="xs:boolean" minOccurs="0"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- <xs:element name="status" type="tns:vnfStatus" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="deleteVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="rollbackVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="createVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="updateVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="vnfRollback">
- <xs:sequence>
- <xs:element name="cloudSiteId" type="xs:string" minOccurs="0"/>
- <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/>
- <xs:element name="tenantCreated" type="xs:boolean"/>
- <xs:element name="tenantId" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfCreated" type="xs:boolean"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="msoRequest">
- <xs:sequence>
- <xs:element name="requestId" type="xs:string" minOccurs="0"/>
- <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:simpleType name="msoExceptionCategory">
- <xs:restriction base="xs:string">
- <xs:enumeration value="OPENSTACK"/>
- <xs:enumeration value="IO"/>
- <xs:enumeration value="INTERNAL"/>
- <xs:enumeration value="USERDATA"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="vnfStatus">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ACTIVE"/>
- <xs:enumeration value="FAILED"/>
- <xs:enumeration value="NOTFOUND"/>
- <xs:enumeration value="UNKNOWN"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
- </types>
- <message name="rollbackVnfNotification">
- <part name="parameters" element="tns:rollbackVnfNotification"/>
- </message>
- <message name="queryVnfNotification">
- <part name="parameters" element="tns:queryVnfNotification"/>
- </message>
- <message name="createVnfNotification">
- <part name="parameters" element="tns:createVnfNotification"/>
- </message>
- <message name="updateVnfNotification">
- <part name="parameters" element="tns:updateVnfNotification"/>
- </message>
- <message name="deleteVnfNotification">
- <part name="parameters" element="tns:deleteVnfNotification"/>
- </message>
- <portType name="vnfAdapterNotify">
- <operation name="rollbackVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest" message="tns:rollbackVnfNotification"/>
- </operation>
- <operation name="queryVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest" message="tns:queryVnfNotification"/>
- </operation>
- <operation name="createVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest" message="tns:createVnfNotification"/>
- </operation>
- <operation name="updateVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest" message="tns:updateVnfNotification"/>
- </operation>
- <operation name="deleteVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest" message="tns:deleteVnfNotification"/>
- </operation>
- </portType>
- <binding name="MsoVnfAdapterAsyncImplPortBinding" type="tns:vnfAdapterNotify">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="rollbackVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="queryVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="createVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="updateVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="deleteVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- </binding>
- <service name="vnfAdapterNotify">
- <port name="MsoVnfAdapterAsyncImplPort" binding="tns:MsoVnfAdapterAsyncImplPortBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
- </port>
- </service>
-</definitions>
-
diff --git a/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl
deleted file mode 100644
index 900389f205..0000000000
--- a/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl
+++ /dev/null
@@ -1,295 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. -->
-<definitions targetNamespace="http://org.onap.so/networkNotify" name="networkAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/networkNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <types>
- <xs:schema version="1.0" targetNamespace="http://org.onap.so/networkNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="createNetworkNotification" type="tns:createNetworkNotification"/>
-
- <xs:element name="createNetworkNotificationResponse" type="tns:createNetworkNotificationResponse"/>
-
- <xs:element name="deleteNetworkNotification" type="tns:deleteNetworkNotification"/>
-
- <xs:element name="deleteNetworkNotificationResponse" type="tns:deleteNetworkNotificationResponse"/>
-
- <xs:element name="queryNetworkNotification" type="tns:queryNetworkNotification"/>
-
- <xs:element name="queryNetworkNotificationResponse" type="tns:queryNetworkNotificationResponse"/>
-
- <xs:element name="rollbackNetworkNotification" type="tns:rollbackNetworkNotification"/>
-
- <xs:element name="rollbackNetworkNotificationResponse" type="tns:rollbackNetworkNotificationResponse"/>
-
- <xs:element name="updateNetworkNotification" type="tns:updateNetworkNotification"/>
-
- <xs:element name="updateNetworkNotificationResponse" type="tns:updateNetworkNotificationResponse"/>
-
- <xs:complexType name="queryNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkExists" type="xs:boolean" minOccurs="0"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="status" type="tns:networkStatus" minOccurs="0"/>
- <xs:element name="vlans" type="xs:int" minOccurs="0" maxOccurs="255"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="queryNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="deleteNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkDeleted" type="xs:boolean" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="deleteNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="rollbackNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="rollbackNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="createNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="createNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="updateNetworkNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="subnetIdMap" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="updateNetworkNotificationResponse">
- <xs:sequence/>
- </xs:complexType>
-
- <xs:complexType name="networkRollback">
- <xs:sequence>
- <xs:element name="cloudId" type="xs:string" minOccurs="0"/>
- <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/>
- <xs:element name="networkCreated" type="xs:boolean"/>
- <xs:element name="networkId" type="xs:string" minOccurs="0"/>
- <xs:element name="networkStackId" type="xs:string" minOccurs="0"/>
- <xs:element name="networkName" type="xs:string" minOccurs="0"/>
- <xs:element name="networkType" type="xs:string" minOccurs="0"/>
- <xs:element name="networkUpdated" type="xs:boolean"/>
- <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/>
- <xs:element name="physicalNetwork" type="xs:string" minOccurs="0"/>
- <xs:element name="tenantId" type="xs:string" minOccurs="0"/>
- <xs:element name="vlans" type="xs:int" nillable="true" minOccurs="0" maxOccurs="255"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="msoRequest">
- <xs:sequence>
- <xs:element name="requestId" type="xs:string" minOccurs="0"/>
- <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:simpleType name="msoExceptionCategory">
- <xs:restriction base="xs:string">
- <xs:enumeration value="OPENSTACK"/>
- <xs:enumeration value="IO"/>
- <xs:enumeration value="INTERNAL"/>
- <xs:enumeration value="USERDATA"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="networkStatus">
- <xs:restriction base="xs:string">
- <xs:enumeration value="NOTFOUND"/>
- <xs:enumeration value="ACTIVE"/>
- <xs:enumeration value="DOWN"/>
- <xs:enumeration value="BUILD"/>
- <xs:enumeration value="ERROR"/>
- <xs:enumeration value="UNKNOWN"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
- </types>
- <message name="rollbackNetworkNotification">
- <part name="parameters" element="tns:rollbackNetworkNotification"/>
- </message>
- <message name="rollbackNetworkNotificationResponse">
- <part name="parameters" element="tns:rollbackNetworkNotificationResponse"/>
- </message>
- <message name="queryNetworkNotification">
- <part name="parameters" element="tns:queryNetworkNotification"/>
- </message>
- <message name="queryNetworkNotificationResponse">
- <part name="parameters" element="tns:queryNetworkNotificationResponse"/>
- </message>
- <message name="createNetworkNotification">
- <part name="parameters" element="tns:createNetworkNotification"/>
- </message>
- <message name="createNetworkNotificationResponse">
- <part name="parameters" element="tns:createNetworkNotificationResponse"/>
- </message>
- <message name="deleteNetworkNotification">
- <part name="parameters" element="tns:deleteNetworkNotification"/>
- </message>
- <message name="deleteNetworkNotificationResponse">
- <part name="parameters" element="tns:deleteNetworkNotificationResponse"/>
- </message>
- <message name="updateNetworkNotification">
- <part name="parameters" element="tns:updateNetworkNotification"/>
- </message>
- <message name="updateNetworkNotificationResponse">
- <part name="parameters" element="tns:updateNetworkNotificationResponse"/>
- </message>
- <portType name="networkAdapterNotify">
- <operation name="rollbackNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationRequest" message="tns:rollbackNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationResponse" message="tns:rollbackNetworkNotificationResponse"/>
- </operation>
- <operation name="queryNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationRequest" message="tns:queryNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationResponse" message="tns:queryNetworkNotificationResponse"/>
- </operation>
- <operation name="createNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationRequest" message="tns:createNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationResponse" message="tns:createNetworkNotificationResponse"/>
- </operation>
- <operation name="deleteNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationRequest" message="tns:deleteNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationResponse" message="tns:deleteNetworkNotificationResponse"/>
- </operation>
- <operation name="updateNetworkNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationRequest" message="tns:updateNetworkNotification"/>
- <output wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationResponse" message="tns:updateNetworkNotificationResponse"/>
- </operation>
- </portType>
- <binding name="MsoNetworkAdapterAsyncImplPortBinding" type="tns:networkAdapterNotify">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="rollbackNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="queryNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="createNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="deleteNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="updateNetworkNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="networkAdapterNotify">
- <port name="MsoNetworkAdapterAsyncImplPort" binding="tns:MsoNetworkAdapterAsyncImplPortBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
- </port>
- </service>
-</definitions>
-
diff --git a/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl
deleted file mode 100644
index eb3f1033cd..0000000000
--- a/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. -->
-<definitions targetNamespace="http://org.onap.so/vnfNotify" name="vnfAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/vnfNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <types>
- <xs:schema version="1.0" targetNamespace="http://org.onap.so/vnfNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="createVnfNotification" type="tns:createVnfNotification"/>
-
- <xs:element name="updateVnfNotification" type="tns:updateVnfNotification"/>
-
- <xs:element name="deleteVnfNotification" type="tns:deleteVnfNotification"/>
-
- <xs:element name="queryVnfNotification" type="tns:queryVnfNotification"/>
-
- <xs:element name="rollbackVnfNotification" type="tns:rollbackVnfNotification"/>
-
- <xs:complexType name="queryVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfExists" type="xs:boolean" minOccurs="0"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- <xs:element name="status" type="tns:vnfStatus" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="deleteVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="rollbackVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="createVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="updateVnfNotification">
- <xs:sequence>
- <xs:element name="messageId" type="xs:string"/>
- <xs:element name="completed" type="xs:boolean"/>
- <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/>
- <xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
- <xs:element name="outputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="entry" minOccurs="0" maxOccurs="255">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="key" minOccurs="0" type="xs:string"/>
- <xs:element name="value" minOccurs="0" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="vnfRollback">
- <xs:sequence>
- <xs:element name="cloudSiteId" type="xs:string" minOccurs="0"/>
- <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/>
- <xs:element name="tenantCreated" type="xs:boolean"/>
- <xs:element name="tenantId" type="xs:string" minOccurs="0"/>
- <xs:element name="vnfCreated" type="xs:boolean"/>
- <xs:element name="vnfId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="msoRequest">
- <xs:sequence>
- <xs:element name="requestId" type="xs:string" minOccurs="0"/>
- <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:simpleType name="msoExceptionCategory">
- <xs:restriction base="xs:string">
- <xs:enumeration value="OPENSTACK"/>
- <xs:enumeration value="IO"/>
- <xs:enumeration value="INTERNAL"/>
- <xs:enumeration value="USERDATA"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="vnfStatus">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ACTIVE"/>
- <xs:enumeration value="FAILED"/>
- <xs:enumeration value="NOTFOUND"/>
- <xs:enumeration value="UNKNOWN"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
- </types>
- <message name="rollbackVnfNotification">
- <part name="parameters" element="tns:rollbackVnfNotification"/>
- </message>
- <message name="queryVnfNotification">
- <part name="parameters" element="tns:queryVnfNotification"/>
- </message>
- <message name="createVnfNotification">
- <part name="parameters" element="tns:createVnfNotification"/>
- </message>
- <message name="updateVnfNotification">
- <part name="parameters" element="tns:updateVnfNotification"/>
- </message>
- <message name="deleteVnfNotification">
- <part name="parameters" element="tns:deleteVnfNotification"/>
- </message>
- <portType name="vnfAdapterNotify">
- <operation name="rollbackVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest" message="tns:rollbackVnfNotification"/>
- </operation>
- <operation name="queryVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest" message="tns:queryVnfNotification"/>
- </operation>
- <operation name="createVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest" message="tns:createVnfNotification"/>
- </operation>
- <operation name="updateVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest" message="tns:updateVnfNotification"/>
- </operation>
- <operation name="deleteVnfNotification">
- <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest" message="tns:deleteVnfNotification"/>
- </operation>
- </portType>
- <binding name="MsoVnfAdapterAsyncImplPortBinding" type="tns:vnfAdapterNotify">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="rollbackVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="queryVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="createVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="updateVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- <operation name="deleteVnfNotification">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- </operation>
- </binding>
- <service name="vnfAdapterNotify">
- <port name="MsoVnfAdapterAsyncImplPort" binding="tns:MsoVnfAdapterAsyncImplPortBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
- </port>
- </service>
-</definitions>
-
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java
deleted file mode 100644
index dd59121a39..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-import static org.junit.Assert.assertTrue;
-import org.junit.Test;
-
-public class ContrailPolicyRefSeqTest {
- @Test
- public void ContrailPolicyRefSeqJson_Test() {
- ContrailPolicyRefSeq cprs = new ContrailPolicyRefSeq("majorVersion 1", "minorVersion 0.02");
- assertTrue(cprs.toString().contains("majorVersion 1"));
- assertTrue(cprs.toString().contains("minorVersion 0.02"));
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java
deleted file mode 100644
index e8e14417c0..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapters.network;
-
-import static org.junit.Assert.assertTrue;
-import org.junit.Test;
-
-public class ContrailPolicyRefTest {
-
- @Test
- public void ContrailPolicyRef_Test() {
- ContrailPolicyRef ref = new ContrailPolicyRef();
- ref.populate("majorVersion 1", "minorVersion 0.02");
- String strJson = ref.toJsonString();
- assertTrue(strJson.contains("majorVersion 1"));
- assertTrue(strJson.contains("minorVersion 0.02"));
- }
-
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java
deleted file mode 100644
index eb8395cd9b..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * ============LICENSE_START======================================================= ONAP : SO
- * ================================================================================ Copyright (C) 2018 TechMahindra
- * ================================================================================ 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.network;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.onap.so.openstack.beans.HostRoute;
-
-public class ContrailSubnetHostRouteTest {
-
- private ContrailSubnetHostRoute cshr = new ContrailSubnetHostRoute();
- HostRoute hr = new HostRoute();
-
- @Test
- public void testContrailSubnetHostRoute() {
-
- cshr.setPrefix("prefix");
- cshr.setNextHop("nextHop");
- assertEquals("prefix", cshr.getPrefix());
- assertEquals("nextHop", cshr.getNextHop());
- assert (cshr.toString() != null);
- cshr.populateWith(hr);
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java
deleted file mode 100644
index 830d94cf85..0000000000
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * ============LICENSE_START======================================================= ONAP : SO
- * ================================================================================ Copyright (C) 2018 TechMahindra
- * ================================================================================ 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.network;
-
-import static org.junit.Assert.*;
-import java.util.List;
-import org.junit.Test;
-
-public class ContrailSubnetHostRoutesTest {
-
- ContrailSubnetHostRoutes cshr = new ContrailSubnetHostRoutes();
- List<ContrailSubnetHostRoute> host_routes;
- StringBuilder buf = new StringBuilder();
-
- @Test
- public void testContrailSubnetHostRoutes() {
- cshr.setHostRoutes(host_routes);
- assertEquals(cshr.getHostRoutes(), host_routes);
- assert (cshr.toString() != null);
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
index 88c6992a0a..a7abdcab7f 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
@@ -23,22 +23,16 @@ package org.onap.so.adapters.network;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.patch;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-import static org.junit.Assert.assertEquals;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteNeutronNetwork;
+import static org.junit.Assert.assertNotNull;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_500;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetAllNeutronNetworks_200;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetAllNeutronNetworks_404;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetNeutronNetwork;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetNeutronNetwork_404;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreated_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackDeleteOrUpdateComplete_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStack_404;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStack_500;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostNeutronNetwork_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStack_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutNeutronNetwork;
-import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutNeutronNetwork_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackGet;
@@ -47,24 +41,36 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import javax.xml.ws.Holder;
+import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.http.HttpStatus;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onap.so.adapters.network.exceptions.NetworkException;
import org.onap.so.adapters.vnf.BaseRestTestUtils;
+import org.onap.so.entity.MsoRequest;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
import com.github.tomakehurst.wiremock.WireMockServer;
+import com.woorea.openstack.base.client.OpenStackResponseException;
public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
public static final String NETWORK_ID = "43173f6a-d699-414b-888f-ab243dda6dfe";
public static final String NETWORK_NAME = "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0";
+ @Autowired
+ MsoNetworkAdapterImpl impl;
+
+ @Rule
+ public final ExpectedException exception = ExpectedException.none();
@Test
- public void createNetworkByModelNameHeatMode() throws IOException {
+ public void createNetworkByModelNameHeatMode() throws IOException, NetworkException {
mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
@@ -77,62 +83,63 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
- }
-
- @Test
- public void createNetworkByModelNameAlreadyExistHeatMode() throws IOException {
-
- mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
-
- mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
+ request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
- mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json");
+ Holder<String> stackId = new Holder<String>();
- mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
- "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
+ impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null,
+ "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001", "dvs-mtjnj-01", null, null, null, null, false,
+ false, null, null, null, request, stackId, new MutableBoolean());
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ assertNotNull(stackId.value);
}
@Test
- public void createNetworkByModelNameAlreadyExistHeatModeFailIfExistTrue() throws IOException {
+ public void createNetworkByModelNameAlreadyExistHeatModeFailIfExistTrue() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"dvspg-VCE_VPE-mtjnj40avbc");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/CreateNetwork_Fail_If_Exist_True.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
+ request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null,
+ "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, true, false, null, null, null,
+ request, stackId, new MutableBoolean());
}
@Test
- public void createNetworkByModelNameHeatModeQueryNetworkException() throws IOException {
+ public void createNetworkByModelNameHeatModeQueryNetworkException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenstackGet(wireMockServer, "/mockPublicUrl/stacks/dvspg-VCE_VPE-mtjnj40avbc",
HttpStatus.SC_INTERNAL_SERVER_ERROR);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
+ request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null,
+ "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, true, false, null, null, null,
+ request, stackId, new MutableBoolean());
}
@Test
- public void createNetworkByModelNameHeatModeCreateNetworkException() throws IOException {
+ public void createNetworkByModelNameHeatModeCreateNetworkException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -140,14 +147,20 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenstackPost(wireMockServer, "/mockPublicUrl/stacks", HttpStatus.SC_INTERNAL_SERVER_ERROR);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
+ request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null,
+ "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, false, false, null, null, null,
+ request, stackId, new MutableBoolean());
}
@Test
- public void createNetworkByModelNameCloudSiteNotPresentError() throws IOException {
+ public void createNetworkByModelNameCloudSiteNotPresentError() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -156,15 +169,20 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"dvspg-VCE_VPE-mtjnj40avbc");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/CreateNetwork_InvalidCloudSiteId.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0");
+ request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.createNetwork("mtn14", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null,
+ "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, false, false, null, null, null,
+ request, stackId, new MutableBoolean());
+
}
@Test
- public void deleteNetworkHeatModeSuccess() throws IOException {
+ public void deleteNetworkHeatModeSuccess() throws IOException, NetworkException {
mockUpdateRequestDb(wireMockServer, "5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
@@ -177,14 +195,17 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"43173f6a-d699-414b-888f-ab243dda6dfe");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/DeleteNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ impl.deleteNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", request);
}
@Test
- public void deleteNetworkDeleteStackException() throws IOException {
+ public void deleteNetworkDeleteStackException() throws IOException, NetworkException {
+ exception.expect(OpenStackResponseException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -195,14 +216,17 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"43173f6a-d699-414b-888f-ab243dda6dfe");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/DeleteNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ impl.deleteNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", request);
}
@Test
- public void deleteNetworkError() throws IOException {
+ public void deleteNetworkError() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -213,31 +237,38 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
"43173f6a-d699-414b-888f-ab243dda6dfe");
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("mtn13", ""), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ impl.deleteNetwork("", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", request);
+
}
@Test
- public void updateNetworkNeutronUpdateException() throws IOException {
+ public void updateNetworkNeutronUpdateException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK);
mockOpenStackPutNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"),
- uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
@Test
- public void updateNetworkHeatUpdateException() throws IOException {
+ public void updateNetworkHeatUpdateException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
@@ -245,113 +276,95 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackPutStack(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
+
}
@Test
- public void updateNetworkHeatQueryException() throws IOException {
+ public void updateNetworkHeatQueryException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStack_500(wireMockServer, NETWORK_NAME);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
+
+ Holder<String> stackId = new Holder<String>();
+
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
@Test
- public void updateNetworkHeatStackNotFound() throws IOException {
+ public void updateNetworkHeatStackNotFound() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
mockOpenStackGetStack_404(wireMockServer, NETWORK_NAME);
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- }
-
- @Test
- public void updateNetworkNeutronQueryException() throws IOException {
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
- mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ Holder<String> stackId = new Holder<String>();
- mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR);
-
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"),
- uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
@Test
- public void updateNetworkNeutronStackNotFound() throws IOException {
+ public void updateNetworkNeutronQueryException() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
- mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_NOT_FOUND);
-
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"),
- uri, HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- }
-
- @Test
- public void queryNetworkHeatModesuccess() throws IOException {
+ mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR);
- mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
- mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", NETWORK_ID);
+ Holder<String> stackId = new Holder<String>();
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri,
- HttpMethod.POST);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
@Test
- public void queryNetworkHeatModeQueryException() throws IOException {
+ public void updateNetworkNeutronStackNotFound() throws IOException, NetworkException {
+ exception.expect(NetworkException.class);
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
- mockOpenStackGetStack_500(wireMockServer, NETWORK_ID);
-
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri,
- HttpMethod.POST);
- assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
- }
+ mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_NOT_FOUND);
- @Test
- public void queryNetworkNeutronModeSuccess() throws IOException {
+ MsoRequest request = new MsoRequest();
+ request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7");
+ request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0");
- mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ Holder<String> stackId = new Holder<String>();
- mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK);
-
- String uri = "/services/NetworkAdapter";
- headers.set("X-ECOMP-RequestID", "123456789456127");
- ResponseEntity<String> response =
- sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri,
- HttpMethod.POST);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null,
+ "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0",
+ "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId);
}
+
public ResponseEntity<String> sendXMLRequest(String requestJson, String uriPath, HttpMethod reqMethod) {
headers.set("Accept", MediaType.APPLICATION_XML);
headers.set("Content-Type", MediaType.APPLICATION_XML);
diff --git a/adapters/mso-requests-db-adapter/pom.xml b/adapters/mso-requests-db-adapter/pom.xml
index 09e2cc26d7..45acf2484d 100644
--- a/adapters/mso-requests-db-adapter/pom.xml
+++ b/adapters/mso-requests-db-adapter/pom.xml
@@ -19,7 +19,7 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
+ <artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java
index 06d75befd9..2325ffaa14 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java
@@ -20,10 +20,12 @@
package org.onap.so.adapters.requestsdb.application;
+import java.util.Arrays;
+import java.util.HashSet;
import javax.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.feature.LoggingFeature;
-import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
+import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter;
@@ -65,16 +67,16 @@ public class CXFConfiguration {
}
@Bean
- public Swagger2Feature createSwaggerFeature() {
- Swagger2Feature swagger2Feature = new Swagger2Feature();
- swagger2Feature.setPrettyPrint(true);
- swagger2Feature.setTitle("SO Request Adapter");
- swagger2Feature.setContact("The ONAP SO team");
- swagger2Feature.setDescription("This project is the SO Orchestration Engine");
- swagger2Feature.setVersion("1.0.0");
- swagger2Feature.setResourcePackage("org.onap.so.adapters.requestdb");
- swagger2Feature.setScan(true);
- return swagger2Feature;
+ public OpenApiFeature createSwaggerFeature() {
+ OpenApiFeature openApiFeature = new OpenApiFeature();
+ openApiFeature.setPrettyPrint(true);
+ openApiFeature.setTitle("SO Request Adapter");
+ openApiFeature.setContactName("The ONAP SO team");
+ openApiFeature.setDescription("This project is the SO Orchestration Engine");
+ openApiFeature.setVersion("1.0.0");
+ openApiFeature.setResourcePackages(new HashSet<String>(Arrays.asList("org.onap.so.adapters.requestdb")));
+ openApiFeature.setScan(true);
+ return openApiFeature;
}
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
index 09fea0644e..33805f9faa 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
@@ -331,4 +332,14 @@ public class RequestsDbClientTest extends RequestsAdapterBase {
List<InfraActiveRequests> infraActiveRequests = requestsDbClient.getInProgressVolumeGroupsAndVfModules();
assertThat(request, sameBeanAs(infraActiveRequests.get(0)).ignoring("modifyTime"));
}
+
+ @Test
+ public void getRequestProcessingDataBySoRequestIdAndNameAndTag() {
+ List<RequestProcessingData> requestProcessingData =
+ requestsDbClient.getRequestProcessingDataBySoRequestIdAndNameAndTagOrderByCreateTimeDesc(
+ "00032ab7-na18-42e5-965d-8ea592502018", "requestAction", "pincFabricConfigRequest");
+ assertNotNull(requestProcessingData);
+ assertTrue(requestProcessingData.size() == 1);
+ assertEquals("assign", requestProcessingData.get(0).getValue());
+ }
}
diff --git a/adapters/mso-sdnc-adapter/pom.xml b/adapters/mso-sdnc-adapter/pom.xml
index 358b14e37a..62ba731873 100644
--- a/adapters/mso-sdnc-adapter/pom.xml
+++ b/adapters/mso-sdnc-adapter/pom.xml
@@ -132,8 +132,8 @@
</dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-jaxrs2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -159,7 +159,7 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
+ <artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java
index dd1da98dd8..65eb39d019 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java
@@ -21,12 +21,13 @@
package org.onap.so.adapters.sdnc;
import java.util.Arrays;
+import java.util.HashSet;
import javax.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
+import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.onap.so.adapters.sdnc.sdncrest.SNIROResponse;
@@ -91,16 +92,15 @@ public class CXFConfiguration {
@Bean
- public Swagger2Feature createSwaggerFeature() {
- Swagger2Feature swagger2Feature = new Swagger2Feature();
- swagger2Feature.setBasePath("/services/rest");
- swagger2Feature.setPrettyPrint(true);
- swagger2Feature.setTitle("SO Orchestration Application");
- swagger2Feature.setContact("The ONAP SO team");
- swagger2Feature.setDescription("This project is the SO Orchestration Engine");
- swagger2Feature.setVersion("1.0.0");
- swagger2Feature.setResourcePackage("org.onap.so.adapters.sdnc");
- swagger2Feature.setScan(true);
- return swagger2Feature;
+ public OpenApiFeature createSwaggerFeature() {
+ OpenApiFeature openApiFeature = new OpenApiFeature();
+ openApiFeature.setPrettyPrint(true);
+ openApiFeature.setTitle("SO Orchestration Application");
+ openApiFeature.setContactName("The ONAP SO team");
+ openApiFeature.setDescription("This project is the SO Orchestration Engine");
+ openApiFeature.setVersion("1.0.0");
+ openApiFeature.setResourcePackages(new HashSet<String>(Arrays.asList("org.onap.so.adapters.sdnc")));
+ openApiFeature.setScan(true);
+ return openApiFeature;
}
}
diff --git a/asdc-controller/pom.xml b/asdc-controller/pom.xml
index 4d17f5510a..0eef01d0cc 100644
--- a/asdc-controller/pom.xml
+++ b/asdc-controller/pom.xml
@@ -190,8 +190,8 @@
</build>
<dependencies>
<dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-jaxrs2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
index 22265a0cc6..9929262dbc 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
@@ -20,41 +20,51 @@
package org.onap.so.asdc;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;
import org.onap.so.asdc.client.test.rest.ASDCRestInterface;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-import io.swagger.jaxrs.config.BeanConfig;
-import io.swagger.jaxrs.listing.ApiListingResource;
-import io.swagger.jaxrs.listing.SwaggerSerializers;
+import io.swagger.v3.jaxrs2.SwaggerSerializers;
+import io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder;
+import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource;
+import io.swagger.v3.oas.integration.OpenApiConfigurationException;
+import io.swagger.v3.oas.integration.SwaggerConfiguration;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
@Configuration
@ApplicationPath("/test")
public class JerseyConfiguration extends ResourceConfig {
- private Environment environment;
-
- @Autowired
- public JerseyConfiguration(final Environment environment) {
- this.environment = environment;
- }
+ private static final Logger logger = LoggerFactory.getLogger(JerseyConfiguration.class);
@PostConstruct
public void setUp() {
register(ASDCRestInterface.class);
- register(ApiListingResource.class);
+ register(OpenApiResource.class);
register(SwaggerSerializers.class);
- final BeanConfig beanConfig = new BeanConfig();
- beanConfig.setVersion("1.0.2");
- beanConfig.setSchemes(new String[] {"http"});
- beanConfig.setHost("localhost:" + environment.getProperty("server.port"));
- beanConfig.setBasePath("/mso");
- beanConfig.setResourcePackage("org.onap.so.apihandlerinfra");
- beanConfig.setPrettyPrint(true);
- beanConfig.setScan(true);
+ final OpenAPI openApi = new OpenAPI();
+ Info info = new Info();
+ info.setVersion("1.0.2");
+ info.setTitle("Swagger asdc-controller code");
+ openApi.setInfo(info);
+
+ SwaggerConfiguration swaggerConfig = new SwaggerConfiguration().openAPI(openApi).prettyPrint(true)
+ .resourcePackages(Stream.of("org.onap.so.asdc").collect(Collectors.toSet()));
+
+ try {
+ JaxrsOpenApiContextBuilder jaxrsConfig = new JaxrsOpenApiContextBuilder();
+ jaxrsConfig.application(this).openApiConfiguration(swaggerConfig).buildContext(true);
+ } catch (OpenApiConfigurationException e) {
+ logger.error("Error during jersey configuration", e);
+ throw new RuntimeException(e.getMessage(), e);
+ }
+
}
}
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
index bf2b8ad7bc..556e5b910f 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
@@ -262,7 +262,7 @@ public class ASDCControllerITTest extends BaseTest {
pnfCustomization.getBlueprintName());
assertEquals("cds blueprint version(sdnc_model_version property)", "v1.4.0",
pnfCustomization.getBlueprintVersion());
- assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf());
+ assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf());
assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor());
/**
@@ -533,7 +533,7 @@ public class ASDCControllerITTest extends BaseTest {
assertEquals("cds blueprint version(sdnc_model_version property)", "1.0.0",
pnfCustomization.getBlueprintVersion());
assertEquals("default software version", "4.0.0", pnfCustomization.getDefaultSoftwareVersion());
- assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf());
+ assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf());
assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor());
/**
@@ -643,7 +643,7 @@ public class ASDCControllerITTest extends BaseTest {
assertEquals("cds blueprint version(sdnc_model_version property)", "1.0.0",
pnfCustomization.getBlueprintVersion());
assertEquals("default software version", "foo-123", pnfCustomization.getDefaultSoftwareVersion());
- assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf());
+ assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf());
assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor());
/**
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index c91316ee5c..69c1c9f8ac 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -677,7 +677,7 @@ return json.toString()
requestInfo.setCallbackUrl(callbackUrl)
requestInfo.setSourceId("so")
requestInfo.setTimeout(timeOut)
- requestInfo.setNumSolutions(100)
+ requestInfo.setNumSolutions(1)
nsiReqBody.setRequestInfo(requestInfo)
nsiReqBody.setNSTInfo(nstInfo)
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java
index 1290f2aeef..df726fed22 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java
@@ -79,266 +79,266 @@ public class BBInputSetupParameter {
}
- protected CloudConfiguration getCloudConfiguration() {
+ public CloudConfiguration getCloudConfiguration() {
return cloudConfiguration;
}
- protected void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
+ public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
this.cloudConfiguration = cloudConfiguration;
}
- protected ConfigurationResourceKeys getConfigurationResourceKeys() {
+ public ConfigurationResourceKeys getConfigurationResourceKeys() {
return configurationResourceKeys;
}
- protected void setConfigurationResourceKeys(ConfigurationResourceKeys configurationResourceKeys) {
+ public void setConfigurationResourceKeys(ConfigurationResourceKeys configurationResourceKeys) {
this.configurationResourceKeys = configurationResourceKeys;
}
- protected List<Map<String, String>> getInstanceParams() {
+ public List<Map<String, String>> getInstanceParams() {
return instanceParams;
}
- protected void setInstanceParams(List<Map<String, String>> instanceParams) {
+ public void setInstanceParams(List<Map<String, String>> instanceParams) {
this.instanceParams = instanceParams;
}
- protected Map<ResourceKey, String> getLookupKeyMap() {
+ public Map<ResourceKey, String> getLookupKeyMap() {
return lookupKeyMap;
}
- protected void setLookupKeyMap(Map<ResourceKey, String> lookupKeyMap) {
+ public void setLookupKeyMap(Map<ResourceKey, String> lookupKeyMap) {
this.lookupKeyMap = lookupKeyMap;
}
- protected ModelInfo getModelInfo() {
+ public ModelInfo getModelInfo() {
return modelInfo;
}
- protected void setModelInfo(ModelInfo modelInfo) {
+ public void setModelInfo(ModelInfo modelInfo) {
this.modelInfo = modelInfo;
}
- protected LineOfBusiness getLineOfBusiness() {
+ public LineOfBusiness getLineOfBusiness() {
return lineOfBusiness;
}
- protected void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
+ public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
this.lineOfBusiness = lineOfBusiness;
}
- protected Platform getPlatform() {
+ public Platform getPlatform() {
return platform;
}
- protected void setPlatform(Platform platform) {
+ public void setPlatform(Platform platform) {
this.platform = platform;
}
- protected RelatedInstanceList[] getRelatedInstanceList() {
+ public RelatedInstanceList[] getRelatedInstanceList() {
return relatedInstanceList;
}
- protected void setRelatedInstanceList(RelatedInstanceList[] relatedInstanceList) {
+ public void setRelatedInstanceList(RelatedInstanceList[] relatedInstanceList) {
this.relatedInstanceList = relatedInstanceList;
}
- protected RequestDetails getRequestDetails() {
+ public RequestDetails getRequestDetails() {
return requestDetails;
}
- protected void setRequestDetails(RequestDetails requestDetails) {
+ public void setRequestDetails(RequestDetails requestDetails) {
this.requestDetails = requestDetails;
}
- protected Service getService() {
+ public Service getService() {
return service;
}
- protected void setService(Service service) {
+ public void setService(Service service) {
this.service = service;
}
- protected ServiceInstance getServiceInstance() {
+ public ServiceInstance getServiceInstance() {
return serviceInstance;
}
- protected void setServiceInstance(ServiceInstance serviceInstance) {
+ public void setServiceInstance(ServiceInstance serviceInstance) {
this.serviceInstance = serviceInstance;
}
- protected String getBbName() {
+ public String getBbName() {
return bbName;
}
- protected void setBbName(String bbName) {
+ public void setBbName(String bbName) {
this.bbName = bbName;
}
- protected String getInstanceGroupId() {
+ public String getInstanceGroupId() {
return instanceGroupId;
}
- protected void setInstanceGroupId(String instanceGroupId) {
+ public void setInstanceGroupId(String instanceGroupId) {
this.instanceGroupId = instanceGroupId;
}
- protected String getInstanceName() {
+ public String getInstanceName() {
return instanceName;
}
- protected void setInstanceName(String instanceName) {
+ public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
- protected String getProductFamilyId() {
+ public String getProductFamilyId() {
return productFamilyId;
}
- protected void setProductFamilyId(String productFamilyId) {
+ public void setProductFamilyId(String productFamilyId) {
this.productFamilyId = productFamilyId;
}
- protected String getResourceId() {
+ public String getResourceId() {
return resourceId;
}
- protected void setResourceId(String resourceId) {
+ public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
- protected String getVnfType() {
+ public String getVnfType() {
return vnfType;
}
- protected void setVnfType(String vnfType) {
+ public void setVnfType(String vnfType) {
this.vnfType = vnfType;
}
- protected ExecuteBuildingBlock getExecuteBB() {
+ public ExecuteBuildingBlock getExecuteBB() {
return executeBB;
}
- protected void setExecuteBB(ExecuteBuildingBlock executeBB) {
+ public void setExecuteBB(ExecuteBuildingBlock executeBB) {
this.executeBB = executeBB;
}
- protected String getRequestAction() {
+ public String getRequestAction() {
return requestAction;
}
- protected void setRequestAction(String requestAction) {
+ public void setRequestAction(String requestAction) {
this.requestAction = requestAction;
}
- protected boolean getaLaCarte() {
+ public boolean getaLaCarte() {
return aLaCarte;
}
- protected void setaLaCarte(boolean aLaCarte) {
+ public void setaLaCarte(boolean aLaCarte) {
this.aLaCarte = aLaCarte;
}
- protected Customer getCustomer() {
+ public Customer getCustomer() {
return customer;
}
- protected void setCustomer(Customer customer) {
+ public void setCustomer(Customer customer) {
this.customer = customer;
}
- protected void setRequestId(String requestId) {
+ public void setRequestId(String requestId) {
this.requestId = requestId;
}
- protected String getRequestId() {
+ public String getRequestId() {
return requestId;
}
- protected void setConfigurationKey(String configurationKey) {
+ public void setConfigurationKey(String configurationKey) {
this.configurationKey = configurationKey;
}
- protected String getConfigurationKey() {
+ public String getConfigurationKey() {
return configurationKey;
}
- protected String getKey() {
+ public String getKey() {
return key;
}
- protected void setKey(String key) {
+ public void setKey(String key) {
this.key = key;
}
- protected String getApplicationId() {
+ public String getApplicationId() {
return applicationId;
}
- protected void setApplicationId(String applicationId) {
+ public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
- protected boolean getIsReplace() {
+ public boolean getIsReplace() {
return isReplace;
}
- protected void setIsReplace(boolean isReplace) {
+ public void setIsReplace(boolean isReplace) {
this.isReplace = isReplace;
}
- protected ServiceModel getServiceModel() {
+ public ServiceModel getServiceModel() {
return this.serviceModel;
}
- protected void setServiceModel(ServiceModel serviceModel) {
+ public void setServiceModel(ServiceModel serviceModel) {
this.serviceModel = serviceModel;
}
- protected boolean getIsHelm() {
+ public boolean getIsHelm() {
return isHelm;
}
- protected void setIsHelm(boolean isHelm) {
+ public void setIsHelm(boolean isHelm) {
this.isHelm = isHelm;
}
@@ -492,27 +492,27 @@ public class BBInputSetupParameter {
return this;
}
- protected Builder setApplicationId(String applicationId) {
+ public Builder setApplicationId(String applicationId) {
this.applicationId = applicationId;
return this;
}
- protected Builder setIsReplace(boolean isReplace) {
+ public Builder setIsReplace(boolean isReplace) {
this.isReplace = isReplace;
return this;
}
- protected Builder setServiceModel(ServiceModel serviceModel) {
+ public Builder setServiceModel(ServiceModel serviceModel) {
this.serviceModel = serviceModel;
return this;
}
- protected boolean getIsHelm() {
+ public boolean getIsHelm() {
return isHelm;
}
- protected void setIsHelm(boolean isHelm) {
+ public void setIsHelm(boolean isHelm) {
this.isHelm = isHelm;
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
index 477dce1072..8d6e133a1c 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java
@@ -79,6 +79,7 @@ public class MSOInfrastructureApplication {
private static final String LOGS_DIR = "logs_dir";
private static final String BPMN_SUFFIX = ".bpmn";
private static final String SDC_SOURCE = "sdc";
+ private static final int CANNOT_INVOKE_COMMAND = 126;
private static void setLogsDir() {
@@ -88,9 +89,14 @@ public class MSOInfrastructureApplication {
}
public static void main(String... args) {
- SpringApplication.run(MSOInfrastructureApplication.class, args);
- System.getProperties().setProperty("mso.config.path", ".");
- setLogsDir();
+ try {
+ SpringApplication.run(MSOInfrastructureApplication.class, args);
+ System.getProperties().setProperty("mso.config.path", ".");
+ setLogsDir();
+ } catch (Exception e) {
+ logger.error("Exception has occurred during application startup. App will exit. ", e);
+ System.exit(CANNOT_INVOKE_COMMAND);
+ }
}
@PostConstruct
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CnfAdapterBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CnfAdapterBB.bpmn
deleted file mode 100644
index 1dc371e054..0000000000
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CnfAdapterBB.bpmn
+++ /dev/null
@@ -1,80 +0,0 @@
-<?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="1.10.0">
- <bpmn:process id="CnfAdapterBB" name="CnfAdapterBB" isExecutable="true">
- <bpmn:startEvent id="StartEvent_1">
- <bpmn:outgoing>SequenceFlow_0xb4elc</bpmn:outgoing>
- </bpmn:startEvent>
- <bpmn:endEvent id="EndEvent_1ee5kqt">
- <bpmn:incoming>SequenceFlow_0lc785k</bpmn:incoming>
- </bpmn:endEvent>
- <bpmn:sequenceFlow id="SequenceFlow_0xb4elc" sourceRef="StartEvent_1" targetRef="Task_0amo55n" />
- <bpmn:sequenceFlow id="SequenceFlow_0lc785k" sourceRef="Task_0amo55n" targetRef="EndEvent_1ee5kqt" />
- <bpmn:serviceTask id="Task_0amo55n" name="Call CnfAdapter" camunda:expression="${CnfAdapter.callCnfAdapter(execution)}">
- <bpmn:incoming>SequenceFlow_0xb4elc</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0lc785k</bpmn:outgoing>
- </bpmn:serviceTask>
- <bpmn:subProcess id="SubProcess_12ghmoa" name="Java Exception Handling Sub Process" triggeredByEvent="true">
- <bpmn:startEvent id="StartEvent_1pwqeib" name="error">
- <bpmn:outgoing>SequenceFlow_0hqxgyk</bpmn:outgoing>
- <bpmn:errorEventDefinition errorRef="Error_0oqb77k" camunda:errorCodeVariable="BPMN_javaExpCode" camunda:errorMessageVariable="BPMN_javaExpMsg" />
- </bpmn:startEvent>
- <bpmn:endEvent id="EndEvent_1ysk6aa">
- <bpmn:incoming>SequenceFlow_0hqxgyk</bpmn:incoming>
- </bpmn:endEvent>
- <bpmn:sequenceFlow id="SequenceFlow_0hqxgyk" sourceRef="StartEvent_1pwqeib" targetRef="EndEvent_1ysk6aa" />
- </bpmn:subProcess>
- </bpmn:process>
- <bpmn:error id="Error_0oqb77k" name="java.lang.Exception" errorCode="java.lang.Exception" />
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
- <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
- <dc:Bounds x="173" y="102" width="36" height="36" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1ee5kqt_di" bpmnElement="EndEvent_1ee5kqt">
- <dc:Bounds x="636" y="102" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="654" y="142" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0xb4elc_di" bpmnElement="SequenceFlow_0xb4elc">
- <di:waypoint xsi:type="dc:Point" x="209" y="120" />
- <di:waypoint xsi:type="dc:Point" x="377" y="120" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="293" y="99" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0lc785k_di" bpmnElement="SequenceFlow_0lc785k">
- <di:waypoint xsi:type="dc:Point" x="477" y="120" />
- <di:waypoint xsi:type="dc:Point" x="636" y="120" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="556.5" y="99" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ServiceTask_1vbkgmd_di" bpmnElement="Task_0amo55n">
- <dc:Bounds x="377" y="80" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="SubProcess_12ghmoa_di" bpmnElement="SubProcess_12ghmoa" isExpanded="true">
- <dc:Bounds x="225" y="284" width="404" height="165" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="StartEvent_1pwqeib_di" bpmnElement="StartEvent_1pwqeib">
- <dc:Bounds x="340" y="350" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="346" y="393" width="26" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="EndEvent_1ysk6aa_di" bpmnElement="EndEvent_1ysk6aa">
- <dc:Bounds x="472" y="350" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="-235" y="114" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0hqxgyk_di" bpmnElement="SequenceFlow_0hqxgyk">
- <di:waypoint xsi:type="dc:Point" x="376" y="368" />
- <di:waypoint xsi:type="dc:Point" x="472" y="368" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="424" y="347" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy
index b2415e296f..1b09c49124 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy
@@ -136,7 +136,7 @@ class AAISliceUtil {
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMsg)
}
AAIResultWrapper wrapper = getAAIClient().get(uri, NotFoundException.class)
- LOGGER.trace(" *****${PREFIX} Exit queryAAI *****")
+ LOGGER.trace(" ***** Exit queryAAI *****")
return wrapper
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
index e5d390e2aa..ba87614937 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy
@@ -275,8 +275,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor {
execution.setVariable("sliceTaskParams", sliceTaskParams)
- String paramJson = sliceTaskParams.convertToJson()
- execution.setVariable("CSSOT_paramJson", paramJson)
+ execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceTaskParams))
logger.debug("Finish createOrchestrationTask")
}
@@ -372,9 +371,9 @@ public class CreateSliceService extends AbstractServiceTaskProcessor {
String taskStatus = execution.getVariable("taskStatus")
SliceTaskParamsAdapter sliceTaskParams =
execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
- String paramJson = sliceTaskParams.convertToJson()
+
execution.setVariable("CSSOT_status", taskStatus)
- execution.setVariable("CSSOT_paramJson", paramJson)
+ execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceTaskParams))
execution.setVariable("CSSOT_requestMethod", requestMethod)
logger.debug("Finish prepareUpdateOrchestrationTask")
}
@@ -402,10 +401,8 @@ public class CreateSliceService extends AbstractServiceTaskProcessor {
String paramJson = orchestrationTask.getParams()
logger.debug("paramJson: " + paramJson)
- SliceTaskParamsAdapter sliceTaskParams =
- execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+ SliceTaskParamsAdapter sliceTaskParams = objectMapper.readValue(paramJson, SliceTaskParamsAdapter.class)
- sliceTaskParams.convertFromJson(paramJson)
execution.setVariable("sliceTaskParams", sliceTaskParams)
logger.debug("Finish processUserOptions")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
index 276b6f0500..e4281045bd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
@@ -120,17 +120,17 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
//set new nsiId to sliceParams suggestNsiId
- sliceParams.setSuggestNsiId(sliceInstanceId)
-
ServiceInstance nsi = new ServiceInstance()
-
String sliceInstanceName = "nsi_"+execution.getVariable("sliceServiceInstanceName")
String serviceType = sliceParams.serviceProfile.get("sST")
String serviceStatus = "deactivated"
String modelInvariantUuid = sliceParams.getNSTInfo().invariantUUID
String modelUuid = sliceParams.getNSTInfo().UUID
+ sliceParams.setSuggestNsiId(sliceInstanceId)
+ sliceParams.setSuggestNsiName(sliceInstanceName)
+
String uuiRequest = execution.getVariable("uuiRequest")
String serviceInstanceLocationid = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs.plmnIdList")
String serviceRole = "nsi"
@@ -428,7 +428,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID
serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID
serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST")
- serviceInfo.nssiName = allocateAnNssi.nssiName
+ serviceInfo.nssiName = sliceTaskInfo.suggestNssiId ? sliceTaskInfo.NSSTInfo.name : allocateAnNssi.nssiName
+ serviceInfo.nssiId = sliceTaskInfo.suggestNssiId
nbiRequest.setServiceInfo(serviceInfo)
nbiRequest.setEsrInfo(esrInfo)
@@ -669,6 +670,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest()
AllocateTnNssi allocateTnNssi = new AllocateTnNssi()
+ allocateTnNssi.setNssiId(sliceTaskInfo.suggestNssiId)
//todo: AllocateTnNssi
//todo: endPointId -> set into tn
List<TransportSliceNetwork> transportSliceNetworks = new ArrayList<>()
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
index e88b1c747f..a784cbee6e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
@@ -131,8 +131,7 @@ class DoAllocateNSSI extends AbstractServiceTaskProcessor {
sliceTaskInfo.statusDescription = response.getStatusDescription()
updateNssiResult(sliceParams, subnetType, sliceTaskInfo)
- String paramJson = sliceParams.convertToJson()
- execution.setVariable("CSSOT_paramJson", paramJson)
+ execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceParams))
execution.setVariable("CSSOT_requestMethod", requestMethod)
execution.setVariable("sliceTaskParams", sliceParams)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
index 91a69b3123..ac959543a2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy
@@ -374,14 +374,15 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
if (solution != null) {
if (execution.getVariable("queryNsiFirst")) {
if (solution.get("existingNSI")) {
+ processSharedNSI(solution, sliceTaskParams, execution)
execution.setVariable("needQuerySliceProfile", true)
} else {
- processNewNSI(solution, sliceTaskParams)
+ processNewSliceProfiles(solution, sliceTaskParams)
execution.setVariable("needQuerySliceProfile", false)
}
execution.setVariable("queryNsiFirst", false)
} else {
- processSharedNSI(solution, sliceTaskParams, execution)
+ processNewSliceProfiles(solution, sliceTaskParams)
execution.setVariable("needQuerySliceProfile", false)
}
}
@@ -400,18 +401,17 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
List<String> nssiId = aaiSliceUtil.getNSSIIdList(execution,nsiId)
List<ServiceInstance> nssiInstances = aaiSliceUtil.getNSSIListFromAAI(execution, nssiId)
- List<Map> sliceProfiles = sharedNSISolution.get("sliceProfiles") as List<Map>
- handleSliceProfiles(sliceProfiles, sliceParams)
Map<String, Object> nssiSolution = new HashMap<>()
for(ServiceInstance instance: nssiInstances){
nssiSolution.put("NSSIId", instance.getServiceInstanceId())
nssiSolution.put("NSSIName", instance.getServiceInstanceName())
- processNssiResult(sliceParams, instance.getEnvironmentContext(), nssiSolution)
+ SubnetType subnetType = instance.getWorkloadContext() as SubnetType
+ processNssiResult(sliceParams, subnetType, nssiSolution)
}
}
- private void processNewNSI(Map<String, Object> solution, SliceTaskParamsAdapter sliceParams) {
+ private void processNewSliceProfiles(Map<String, Object> solution, SliceTaskParamsAdapter sliceParams) {
Map<String, Object> newNSISolution = solution.get("newNSISolution") as Map
List<Map> sliceProfiles = newNSISolution.get("sliceProfiles") as List<Map>
handleSliceProfiles(sliceProfiles, sliceParams)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
index 37b9376e14..0136c30bee 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
@@ -73,7 +73,7 @@ public class ConfigCheckerDelegate implements JavaDelegate {
catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
if (pnfCustomizations != null && !pnfCustomizations.isEmpty()) {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
- boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf();
+ boolean skipPostInstantiationConfiguration = pnfResourceCustomization.getSkipPostInstConf();
delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION,
skipPostInstantiationConfiguration);
delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName());
diff --git a/bpmn/so-bpmn-infrastructure-flows/pom.xml b/bpmn/so-bpmn-infrastructure-flows/pom.xml
index 9f78182811..0602522c67 100644
--- a/bpmn/so-bpmn-infrastructure-flows/pom.xml
+++ b/bpmn/so-bpmn-infrastructure-flows/pom.xml
@@ -11,7 +11,7 @@
<packaging>jar</packaging>
<properties>
<assertj.core.version>1.7.0</assertj.core.version>
- <grpc.version>1.17.1</grpc.version>
+ <grpc.version>1.25.0</grpc.version>
</properties>
<build>
<plugins>
@@ -177,7 +177,6 @@
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
- <version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java
index 7aaf558901..35c5fe1c14 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java
@@ -26,7 +26,7 @@ import javax.annotation.PostConstruct;
import org.junit.Rule;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.slf4j.Logger;
@@ -35,7 +35,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
-public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
+public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class);
@@ -55,7 +55,7 @@ public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
@PostConstruct
public void start() throws IOException {
- final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() {
+ final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() {
@Override
public StreamObserver<ExecutionServiceInput> process(
StreamObserver<ExecutionServiceOutput> responseObserver) {
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
index 786ee1e239..f93492bea5 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
@@ -116,6 +116,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
mockAai();
mockDmaapForPnf();
+ grpcNettyServer.resetList();
+
final String msoRequestId = UUID.randomUUID().toString();
executionVariables.put("mso-request-id", msoRequestId);
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java
index 1c00f3628d..35853a3794 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java
+++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/GenericPnfSoftwareUpgradeTest.java
@@ -107,6 +107,8 @@ public class GenericPnfSoftwareUpgradeTest extends BaseBPMNTest {
mockRequestDb();
mockAai();
+ grpcNettyServer.resetList();
+
final String msoRequestId = UUID.randomUUID().toString();
executionVariables.put(ExecutionVariableNames.MSO_REQUEST_ID, msoRequestId);
@@ -146,7 +148,6 @@ public class GenericPnfSoftwareUpgradeTest extends BaseBPMNTest {
fail("GenericPnfSoftwareUpgrade request exception", e);
}
assertTrue(count == actionNames.length);
- grpcNettyServer.resetList();
}
private boolean isProcessInstanceEnded() {
diff --git a/bpmn/so-bpmn-tasks/pom.xml b/bpmn/so-bpmn-tasks/pom.xml
index 881cb30548..276b546072 100644
--- a/bpmn/so-bpmn-tasks/pom.xml
+++ b/bpmn/so-bpmn-tasks/pom.xml
@@ -105,7 +105,7 @@
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
- <groupId>io.swagger</groupId>
+ <groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<goals>
<goal>generate</goal>
@@ -164,7 +164,7 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
- <version>1.17.1</version>
+ <version>1.25.0</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java
deleted file mode 100644
index a556d3088c..0000000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.onap.so.bpmn.infrastructure.adapter.cnf.tasks;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.onap.so.client.adapter.cnf.CnfAdapterClient;
-import org.onap.so.client.adapter.cnf.entities.InstanceRequest;
-import org.onap.so.client.adapter.cnf.entities.InstanceResponse;
-import org.onap.so.client.adapter.cnf.entities.Labels;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class CnfAdapter {
-
- @Autowired
- private CnfAdapterClient cnfAdapterClient;
-
- private static final Logger logger = LoggerFactory.getLogger(CnfAdapter.class);
-
- public void callCnfAdapter(DelegateExecution execution) throws Exception {
- try {
- InstanceRequest request = new InstanceRequest();
- request.setRbName("test-rbdef");
- request.setRbVersion("v1");
- request.setCloudRegion("krd");
- request.setVfModuleUUID("VF module UUID");
- request.setProfileName("p1");
- Map<String, String> overrideValues = new HashMap<>();
- overrideValues.put("image.tag", "latest");
- overrideValues.put("dcae_collector_ip", "1.2.3.4");
- Map<String, String> labels = new HashMap<String, String>();
- labels.put("custom-label-1", "abcdef");
- request.setLabels(labels);
- request.setOverrideValues(overrideValues);
- InstanceResponse response = cnfAdapterClient.createVfModule(request);
- } catch (Exception ex) {
- logger.error("Exception in callCnfAdapter", ex);
- throw ex;
- }
- }
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java
index 7624bcb811..1220dc05c1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java
@@ -114,6 +114,7 @@ public class CnfAdapterCreateTasks {
request.setCloudRegion(cloudRegion.getLcpCloudRegionId());
request.setVfModuleUUID(vfModule.getVfModuleId());
request.setProfileName(sdncDirectives.get("k8s-rb-profile-name"));
+ request.setReleaseName(sdncDirectives.get("k8s-rb-instance-release-name"));
request.setOverrideValues(sdncDirectives);
return request;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index ee4e56bc18..29206a6aa9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -26,18 +26,30 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CONTROLLER;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCERETAINASSIGNMENTS;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.SERVICE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import org.apache.commons.lang3.SerializationUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.javatuples.Pair;
-import org.onap.aai.domain.yang.Relationship;
-import org.onap.aai.domain.yang.ServiceInstance;
import org.onap.aai.domain.yang.Vnfc;
import org.onap.aai.domain.yang.VolumeGroup;
-import org.onap.aai.domain.yang.VpnBinding;
-import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
import org.onap.aaiclient.client.aai.AAIObjectName;
import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.Relationships;
@@ -46,22 +58,16 @@ 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.bpmn.common.BBConstants;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.ServiceEBBLoader;
import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.VnfEBBLoader;
import org.onap.so.bpmn.infrastructure.workflow.tasks.excpetion.VnfcMultipleRelationshipException;
import org.onap.so.bpmn.infrastructure.workflow.tasks.utils.WorkflowResourceIdsUtils;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.client.orchestration.AAIConfigurationResources;
import org.onap.so.client.orchestration.AAIEntityNotFoundException;
-import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
-import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
-import org.onap.so.db.catalog.beans.InstanceGroup;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
@@ -79,26 +85,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CONTROLLER;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.NETWORKCOLLECTION;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCE;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCERETAINASSIGNMENTS;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.SERVICE;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE;
-import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE;
+import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class WorkflowAction {
@@ -131,21 +118,15 @@ public class WorkflowAction {
@Autowired
private CatalogDbClient catalogDbClient;
@Autowired
- private AAIConfigurationResources aaiConfigurationResources;
- @Autowired
- private WorkflowActionExtractResourcesAAI workflowActionUtils;
- @Autowired
- private VrfValidation vrfValidation;
- @Autowired
private Environment environment;
@Autowired
- private UserParamsServiceTraversal userParamsServiceTraversal;
- @Autowired
private AaiResourceIdValidator aaiResourceIdValidator;
@Autowired
private ExecuteBuildingBlockBuilder executeBuildingBlockBuilder;
@Autowired
private VnfEBBLoader vnfEBBLoader;
+ @Autowired
+ private ServiceEBBLoader serviceEBBLoader;
public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) {
this.bbInputSetupUtils = bbInputSetupUtils;
@@ -295,52 +276,12 @@ public class WorkflowAction {
String cloudOwner, String serviceType, String requestId, String apiVersion, String vnfType,
RequestDetails requestDetails) throws IOException, VrfBondingServiceException {
List<ExecuteBuildingBlock> flowsToExecute;
- boolean containsService = false;
List<Resource> resourceList = new ArrayList<>();
List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
- List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
- if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) {
- // SERVICE-MACRO-ASSIGN will always get user params with a
- // service.
-
- if (userParams != null) {
- containsService = isContainsService(sIRequest);
- if (containsService) {
- resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
- serviceInstanceId, requestAction);
- }
- } else {
- buildAndThrowException(execution,
- "Service-Macro-Assign request details must contain user params with a service");
- }
- } else if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
- // SERVICE-MACRO-CREATE will get user params with a service,
- // a service with a network, a service with a
- // network collection, OR an empty service.
- // If user params is just a service or null and macro
- // queries the SI and finds a VNF, macro fails.
-
- if (userParams != null) {
- containsService = isContainsService(sIRequest);
- }
- if (containsService) {
- resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
- serviceInstanceId, requestAction);
- }
- if (!foundRelated(resourceList)) {
- traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds);
- }
- } else if (resourceType == WorkflowType.SERVICE && ("activateInstance".equalsIgnoreCase(requestAction)
- || "unassignInstance".equalsIgnoreCase(requestAction)
- || "deleteInstance".equalsIgnoreCase(requestAction)
- || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) {
- // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and
- // SERVICE-MACRO-DELETE
- // Will never get user params with service, macro will have
- // to query the SI in AAI to find related instances.
- traverseAAIService(execution, resourceList, resourceId, aaiResourceIds);
- } else if (resourceType == WorkflowType.SERVICE && "deactivateInstance".equalsIgnoreCase(requestAction)) {
- resourceList.add(new Resource(WorkflowType.SERVICE, "", false));
+
+ if (resourceType == WorkflowType.SERVICE) {
+ resourceList = serviceEBBLoader.getResourceListForService(sIRequest, requestAction, execution,
+ serviceInstanceId, resourceId, aaiResourceIds);
} else if (resourceType == WorkflowType.VNF && (REPLACEINSTANCE.equalsIgnoreCase(requestAction)
|| ("recreateInstance".equalsIgnoreCase(requestAction)))) {
vnfEBBLoader.traverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
@@ -370,7 +311,7 @@ public class WorkflowAction {
}
flowsToExecute = executeBuildingBlockBuilder.buildExecuteBuildingBlockList(orchFlows, resourceList, requestId,
apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, vnfReplace);
- if (isNetworkCollectionInTheResourceList(resourceList)) {
+ if (serviceEBBLoader.isNetworkCollectionInTheResourceList(resourceList)) {
logger.info("Sorting for Vlan Tagging");
flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction);
}
@@ -400,13 +341,6 @@ public class WorkflowAction {
execution.setVariable("isRollbackComplete", false);
}
- private boolean isContainsService(ServiceInstancesRequest sIRequest) {
- boolean containsService;
- List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
- containsService = userParams.stream().anyMatch(param -> param.containsKey(USER_PARAM_SERVICE));
- return containsService;
- }
-
private List<ExecuteBuildingBlock> loadExecuteBuildingBlocks(DelegateExecution execution, String requestId,
String errorMessage) {
List<ExecuteBuildingBlock> flowsToExecute;
@@ -699,8 +633,6 @@ public class WorkflowAction {
return orchFlows;
}
-
-
private void updateResourceIdsFromAAITraversal(List<ExecuteBuildingBlock> flowsToExecute,
List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds, String serviceInstanceId) {
for (Pair<WorkflowType, String> pair : aaiResourceIds) {
@@ -759,342 +691,6 @@ public class WorkflowAction {
}
}
- protected CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution,
- org.onap.so.db.catalog.beans.Service service) {
- CollectionResourceCustomization networkCollection = null;
- int count = 0;
- for (CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()) {
- if (catalogDbClient.getNetworkCollectionResourceCustomizationByID(
- collectionCust.getModelCustomizationUUID()) != null) {
- networkCollection = collectionCust;
- count++;
- }
- }
- if (count == 0) {
- return null;
- } else if (count > 1) {
- buildAndThrowException(execution,
- "Found multiple Network Collections in the Service model, only one per Service is supported.");
- }
- return networkCollection;
- }
-
- protected void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest,
- List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds)
- throws JsonProcessingException, VrfBondingServiceException {
- String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId();
- org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID);
-
- if (service == null) {
- buildAndThrowException(execution, "Could not find the service model in catalog db.");
- } else {
- resourceList.add(new Resource(WorkflowType.SERVICE, service.getModelUUID(), false));
- RelatedInstance relatedVpnBinding =
- bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding);
- RelatedInstance relatedLocalNetwork =
- bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network);
-
- if (relatedVpnBinding != null && relatedLocalNetwork != null) {
- traverseVrfConfiguration(aaiResourceIds, resourceList, service, relatedVpnBinding, relatedLocalNetwork);
- } else {
- traverseNetworkCollection(execution, resourceList, service);
- }
- }
- }
-
- protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds,
- List<Resource> resourceList, org.onap.so.db.catalog.beans.Service service,
- RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork)
- throws VrfBondingServiceException, JsonProcessingException {
- org.onap.aai.domain.yang.L3Network aaiLocalNetwork =
- bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId());
- vrfValidation.vrfServiceValidation(service);
- vrfValidation.vrfCatalogDbChecks(service);
- vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(),
- bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId()));
- vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork);
- vrfValidation.aaiSubnetValidation(aaiLocalNetwork);
- vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork);
- vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork);
- String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork);
- if (existingAAIVrfConfiguration != null) {
- aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration));
- }
- resourceList.add(new Resource(WorkflowType.CONFIGURATION,
- service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false));
-
- }
-
- protected String getExistingAAIVrfConfiguration(RelatedInstance relatedVpnBinding,
- org.onap.aai.domain.yang.L3Network aaiLocalNetwork)
- throws JsonProcessingException, VrfBondingServiceException {
- Optional<Relationships> relationshipsOp = new AAIResultWrapper(
- new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiLocalNetwork)).getRelationships();
- if (relationshipsOp.isPresent()) {
- List<AAIResultWrapper> configurationsRelatedToLocalNetwork =
- relationshipsOp.get().getByType(Types.CONFIGURATION);
- if (configurationsRelatedToLocalNetwork.size() > 1) {
- throw new VrfBondingServiceException(
- "Network: " + aaiLocalNetwork.getNetworkId() + " has more than 1 configuration related to it");
- }
- if (configurationsRelatedToLocalNetwork.size() == 1) {
- AAIResultWrapper configWrapper = configurationsRelatedToLocalNetwork.get(0);
- Optional<Configuration> relatedConfiguration = configWrapper.asBean(Configuration.class);
- if (relatedConfiguration.isPresent() && vrfConfigurationAlreadyExists(relatedVpnBinding,
- relatedConfiguration.get(), configWrapper)) {
- return relatedConfiguration.get().getConfigurationId();
- }
- }
- }
- return null;
- }
-
- protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration,
- AAIResultWrapper configWrapper) throws VrfBondingServiceException {
- if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) {
- Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships();
- if (relationshipsConfigOp.isPresent()) {
- Optional<VpnBinding> relatedInfraVpnBindingOp =
- workflowActionUtils.extractRelationshipsVpnBinding(relationshipsConfigOp.get());
- if (relatedInfraVpnBindingOp.isPresent()) {
- VpnBinding relatedInfraVpnBinding = relatedInfraVpnBindingOp.get();
- if (!relatedInfraVpnBinding.getVpnId().equalsIgnoreCase(relatedVpnBinding.getInstanceId())) {
- throw new VrfBondingServiceException("Configuration: " + vrfConfiguration.getConfigurationId()
- + " is not connected to the same vpn binding id provided in request: "
- + relatedVpnBinding.getInstanceId());
- } else {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- protected void traverseNetworkCollection(DelegateExecution execution, List<Resource> resourceList,
- org.onap.so.db.catalog.beans.Service service) {
- if (isVnfCustomizationsInTheService(service)) {
- buildAndThrowException(execution,
- "Cannot orchestrate Service-Macro-Create without user params with a vnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
- }
- if (isPnfCustomizationsInTheService(service)) {
- buildAndThrowException(execution,
- "Cannot orchestrate Service-Macro-Create without user params with a pnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
- }
- List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations();
- if (customizations.isEmpty()) {
- logger.debug("No Collections found. CollectionResourceCustomization list is empty.");
- } else {
- CollectionResourceCustomization collectionResourceCustomization =
- findCatalogNetworkCollection(execution, service);
- traverseNetworkCollectionResourceCustomization(resourceList, collectionResourceCustomization);
- }
- traverseNetworkCollectionCustomization(resourceList, service);
- }
-
- private void traverseNetworkCollectionResourceCustomization(List<Resource> resourceList,
- CollectionResourceCustomization collectionResourceCustomization) {
- if (collectionResourceCustomizationShouldNotBeProcessed(resourceList, collectionResourceCustomization))
- return;
- int minNetworks = 0;
- org.onap.so.db.catalog.beans.InstanceGroup instanceGroup =
- collectionResourceCustomization.getCollectionResource().getInstanceGroup();
- CollectionResourceInstanceGroupCustomization collectionInstCust = null;
- if (!instanceGroup.getCollectionInstanceGroupCustomizations().isEmpty()) {
- for (CollectionResourceInstanceGroupCustomization collectionInstanceGroupTemp : instanceGroup
- .getCollectionInstanceGroupCustomizations()) {
- if (collectionInstanceGroupTemp.getModelCustomizationUUID()
- .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) {
- collectionInstCust = collectionInstanceGroupTemp;
- break;
- }
- }
- if (interfaceNetworkQuantityIsAvailableInCollection(collectionInstCust)) {
- minNetworks = collectionInstCust.getSubInterfaceNetworkQuantity();
- }
- }
- logger.debug("minNetworks: {}", minNetworks);
- CollectionNetworkResourceCustomization collectionNetworkResourceCust =
- getCollectionNetworkResourceCustomization(collectionResourceCustomization, instanceGroup);
- for (int i = 0; i < minNetworks; i++) {
- if (collectionNetworkResourceCust != null) {
- Resource resource = new Resource(WorkflowType.VIRTUAL_LINK,
- collectionNetworkResourceCust.getModelCustomizationUUID(), false);
- resource.setVirtualLinkKey(Integer.toString(i));
- resourceList.add(resource);
- }
- }
- }
-
- private CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomization(
- CollectionResourceCustomization collectionResourceCustomization, InstanceGroup instanceGroup) {
- CollectionNetworkResourceCustomization collectionNetworkResourceCust = null;
- for (CollectionNetworkResourceCustomization collectionNetworkTemp : instanceGroup
- .getCollectionNetworkResourceCustomizations()) {
- if (collectionNetworkTemp.getNetworkResourceCustomization().getModelCustomizationUUID()
- .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) {
- collectionNetworkResourceCust = collectionNetworkTemp;
- break;
- }
- }
- return collectionNetworkResourceCust;
- }
-
- private boolean collectionResourceCustomizationShouldNotBeProcessed(List<Resource> resourceList,
- CollectionResourceCustomization collectionResourceCustomization) {
- if (collectionResourceCustomization == null) {
- logger.debug("No Network Collection Customization found");
- return true;
- }
- resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
- collectionResourceCustomization.getModelCustomizationUUID(), false));
- logger.debug("Found a network collection");
- if (collectionResourceCustomization.getCollectionResource() == null) {
- logger.debug("No Network Collection found. collectionResource is null");
- return true;
- }
- if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) {
- logger.debug("No Instance Group found for network collection.");
- return true;
- }
- String toscaNodeType =
- collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType();
- if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) {
- logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType);
- return true;
- }
- return false;
- }
-
- private boolean interfaceNetworkQuantityIsAvailableInCollection(
- CollectionResourceInstanceGroupCustomization collectionInstCust) {
- return collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null;
- }
-
- private boolean toscaNodeTypeHasNetworkCollection(String toscaNodeType) {
- return toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION);
- }
-
- private void traverseNetworkCollectionCustomization(List<Resource> resourceList,
- org.onap.so.db.catalog.beans.Service service) {
- if (isNetworkCollectionInTheResourceList(resourceList)) {
- return;
- }
- if (service.getNetworkCustomizations() == null) {
- logger.debug("No networks were found on this service model");
- return;
- }
- for (int i = 0; i < service.getNetworkCustomizations().size(); i++) {
- resourceList.add(new Resource(WorkflowType.NETWORK,
- service.getNetworkCustomizations().get(i).getModelCustomizationUUID(), false));
- }
- }
-
- private boolean isNetworkCollectionInTheResourceList(List<Resource> resourceList) {
- return resourceList.stream().anyMatch(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType());
- }
-
- private boolean isVnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) {
- return !(service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty());
- }
-
- private boolean isPnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) {
- return !(service.getPnfCustomizations() == null || service.getPnfCustomizations().isEmpty());
- }
-
- protected void traverseAAIService(DelegateExecution execution, List<Resource> resourceList, String resourceId,
- List<Pair<WorkflowType, String>> aaiResourceIds) {
- try {
- ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(resourceId);
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO =
- bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
- resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false));
- traverseServiceInstanceMSOVnfs(resourceList, aaiResourceIds, serviceInstanceMSO);
- traverseServiceInstanceMSOPnfs(resourceList, aaiResourceIds, serviceInstanceMSO);
- if (serviceInstanceMSO.getNetworks() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network network : serviceInstanceMSO
- .getNetworks()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.NETWORK, network.getNetworkId()));
- resourceList.add(new Resource(WorkflowType.NETWORK, network.getNetworkId(), false));
- }
- }
- if (serviceInstanceMSO.getCollection() != null) {
- logger.debug("found networkcollection");
- aaiResourceIds
- .add(new Pair<>(WorkflowType.NETWORKCOLLECTION, serviceInstanceMSO.getCollection().getId()));
- resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
- serviceInstanceMSO.getCollection().getId(), false));
- }
- if (serviceInstanceMSO.getConfigurations() != null) {
- for (Configuration config : serviceInstanceMSO.getConfigurations()) {
- Optional<org.onap.aai.domain.yang.Configuration> aaiConfig =
- aaiConfigurationResources.getConfiguration(config.getConfigurationId());
- if (aaiConfig.isPresent() && aaiConfig.get().getRelationshipList() != null) {
- for (Relationship relationship : aaiConfig.get().getRelationshipList().getRelationship()) {
- if (relationship.getRelatedTo().contains("vnfc")
- || relationship.getRelatedTo().contains("vpn-binding")) {
- aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.getConfigurationId()));
- resourceList.add(
- new Resource(WorkflowType.CONFIGURATION, config.getConfigurationId(), false));
- break;
- }
- }
- }
- }
- }
- } catch (Exception ex) {
- logger.error("Exception in traverseAAIService", ex);
- buildAndThrowException(execution,
- "Could not find existing Service Instance or related Instances to execute the request on.");
- }
- }
-
- private void traverseServiceInstanceMSOVnfs(List<Resource> resourceList,
- List<Pair<WorkflowType, String>> aaiResourceIds,
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
- if (serviceInstanceMSO.getVnfs() == null) {
- return;
- }
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
- resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false));
- traverseVnfModules(resourceList, aaiResourceIds, vnf);
- if (vnf.getVolumeGroups() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf.getVolumeGroups()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
- resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
- }
- }
- }
- }
-
- private void traverseServiceInstanceMSOPnfs(List<Resource> resourceList,
- List<Pair<WorkflowType, String>> aaiResourceIds,
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
- if (serviceInstanceMSO.getPnfs() == null) {
- return;
- }
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId()));
- resourceList.add(new Resource(WorkflowType.PNF, pnf.getPnfId(), false));
- }
- }
-
- private void traverseVnfModules(List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds,
- org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf) {
- if (vnf.getVfModules() == null) {
- return;
- }
- for (VfModule vfModule : vnf.getVfModules()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
- Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false);
- resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean());
- resourceList.add(resource);
- }
- }
-
-
-
protected WorkflowResourceIds populateResourceIdsFromApiHandler(DelegateExecution execution) {
return WorkflowResourceIdsUtils.getWorkflowResourceIdsFromExecution(execution);
}
@@ -1296,17 +892,6 @@ public class WorkflowAction {
&& (bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId) != null));
}
- protected boolean foundRelated(List<Resource> resourceList) {
- return (containsWorkflowType(resourceList, WorkflowType.VNF)
- || containsWorkflowType(resourceList, WorkflowType.PNF)
- || containsWorkflowType(resourceList, WorkflowType.NETWORK)
- || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION));
- }
-
- protected boolean containsWorkflowType(List<Resource> resourceList, WorkflowType workflowType) {
- return resourceList.stream().anyMatch(resource -> resource.getResourceType().equals(workflowType));
- }
-
private void fillExecutionDefault(DelegateExecution execution) {
execution.setVariable("sentSyncResponse", false);
execution.setVariable(HOMING, false);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index ec2ca74fa7..cd151bafea 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -37,6 +37,7 @@ import org.onap.aai.domain.yang.Vnfc;
import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.aaiclient.client.aai.entities.Configuration;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
+import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
import org.onap.so.bpmn.common.listener.db.RequestsDbListenerRunner;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
@@ -68,10 +69,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class WorkflowActionBBTasks {
- private static final String G_CURRENT_SEQUENCE = "gCurrentSequence";
- private static final String G_REQUEST_ID = "mso-request-id";
- private static final String G_ALACARTE = "aLaCarte";
- private static final String G_ACTION = "requestAction";
private static final String RETRY_COUNT = "retryCount";
private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
private static final String ADD_FABRIC_CONFIGURATION_BB = "AddFabricConfigurationBB";
@@ -112,14 +109,15 @@ public class WorkflowActionBBTasks {
} catch (NullPointerException ex) {
workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex);
}
- int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
execution.setVariable("buildingBlock", ebb);
currentSequence++;
execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size());
- execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
+ execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence);
+
} catch (Exception e) {
workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e);
}
@@ -127,7 +125,7 @@ public class WorkflowActionBBTasks {
public void updateFlowStatistics(DelegateExecution execution) {
try {
- int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
if (currentSequence > 1) {
InfraActiveRequests request = this.getUpdatedRequest(execution, currentSequence);
requestDbclient.updateInfraActiveRequests(request);
@@ -142,7 +140,7 @@ public class WorkflowActionBBTasks {
protected InfraActiveRequests getUpdatedRequest(DelegateExecution execution, int currentSequence) {
List<ExecuteBuildingBlock> flowsToExecute =
(List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
- String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
ExecuteBuildingBlock completedBB = flowsToExecute.get(currentSequence - 2);
ExecuteBuildingBlock nextBB = flowsToExecute.get(currentSequence - 1);
@@ -171,7 +169,7 @@ public class WorkflowActionBBTasks {
}
public void sendSyncAck(DelegateExecution execution) {
- final String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
final String resourceId = (String) execution.getVariable("resourceId");
ServiceInstancesResponse serviceInstancesResponse = new ServiceInstancesResponse();
RequestReferences requestRef = new RequestReferences();
@@ -199,7 +197,7 @@ public class WorkflowActionBBTasks {
}
public void sendErrorSyncAck(DelegateExecution execution) {
- final String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
try {
ExceptionBuilder exceptionBuilder = new ExceptionBuilder();
String errorMsg = (String) execution.getVariable("WorkflowActionErrorMessage");
@@ -225,10 +223,10 @@ public class WorkflowActionBBTasks {
public void updateRequestStatusToComplete(DelegateExecution execution) {
try {
- final String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
- final String action = (String) execution.getVariable(G_ACTION);
- final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
+ final String action = (String) execution.getVariable(BBConstants.G_ACTION);
+ final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE);
final String resourceName = (String) execution.getVariable("resourceName");
String statusMessage = (String) execution.getVariable("StatusMessage");
String macroAction;
@@ -258,7 +256,7 @@ public class WorkflowActionBBTasks {
public void checkRetryStatus(DelegateExecution execution) {
String handlingCode = (String) execution.getVariable(HANDLINGCODE);
- String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
String retryDuration = (String) execution.getVariable("RetryDuration");
int retryCount = (int) execution.getVariable(RETRY_COUNT);
int envMaxRetries;
@@ -280,8 +278,8 @@ public class WorkflowActionBBTasks {
logger.warn("Failed to update Request Db Infra Active Requests with Retry Status", ex);
}
if (retryCount < envMaxRetries) {
- int currSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
- execution.setVariable(G_CURRENT_SEQUENCE, currSequence - 1);
+ int currSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
+ execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currSequence - 1);
execution.setVariable(RETRY_COUNT, nextCount);
} else {
workflowAction.buildAndThrowException(execution,
@@ -297,7 +295,7 @@ public class WorkflowActionBBTasks {
* working on.
*/
public void rollbackExecutionPath(DelegateExecution execution) {
- final String action = (String) execution.getVariable(G_ACTION);
+ final String action = (String) execution.getVariable(BBConstants.G_ACTION);
final String resourceName = (String) execution.getVariable("resourceName");
if (!(boolean) execution.getVariable("isRollback")) {
List<ExecuteBuildingBlock> flowsToExecute =
@@ -308,7 +306,7 @@ public class WorkflowActionBBTasks {
.collect(Collectors.toList());
List<ExecuteBuildingBlock> rollbackFlows = new ArrayList<>();
- int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
int listSize = flowsToExecute.size();
for (int i = listSize - 1; i >= 0; i--) {
@@ -381,7 +379,7 @@ public class WorkflowActionBBTasks {
execution.setVariable("flowsToExecute", rollbackFlowsFiltered);
execution.setVariable(HANDLINGCODE, "PreformingRollback");
execution.setVariable("isRollback", true);
- execution.setVariable(G_CURRENT_SEQUENCE, 0);
+ execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, 0);
execution.setVariable(RETRY_COUNT, 0);
} else {
workflowAction.buildAndThrowException(execution,
@@ -391,7 +389,7 @@ public class WorkflowActionBBTasks {
protected void updateInstanceId(DelegateExecution execution) {
try {
- String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
String resourceId = (String) execution.getVariable("resourceId");
WorkflowType resourceType = (WorkflowType) execution.getVariable("resourceType");
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
@@ -424,8 +422,8 @@ public class WorkflowActionBBTasks {
List<ExecuteBuildingBlock> flowsToExecute =
(List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
String handlingCode = (String) execution.getVariable(HANDLINGCODE);
- final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
- int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE);
+ int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
logger.debug("Current Sequence: {}", currentSequence);
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1);
String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName();
@@ -444,7 +442,7 @@ public class WorkflowActionBBTasks {
protected void postProcessingExecuteBBActivateVfModule(DelegateExecution execution, ExecuteBuildingBlock ebb,
List<ExecuteBuildingBlock> flowsToExecute) {
try {
- String requestAction = (String) execution.getVariable(G_ACTION);
+ String requestAction = (String) execution.getVariable(BBConstants.G_ACTION);
String serviceInstanceId = ebb.getWorkflowResourceIds().getServiceInstanceId();
String vnfId = ebb.getWorkflowResourceIds().getVnfId();
String vfModuleId = ebb.getResourceId();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java
index 9128e9e3e1..b2cc89545b 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java
@@ -32,15 +32,15 @@ public final class WorkflowActionConstants {
throw new IllegalStateException("Utility class");
}
- static final String USER_PARAM_SERVICE = "service";
- static final String CREATE_INSTANCE = "createInstance";
- static final String FABRIC_CONFIGURATION = "FabricConfiguration";
+ public static final String USER_PARAM_SERVICE = "service";
+ public static final String CREATE_INSTANCE = "createInstance";
+ public static final String FABRIC_CONFIGURATION = "FabricConfiguration";
public static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage";
static final String SERVICE = "Service";
static final String CONTROLLER = "Controller";
- static final String NETWORKCOLLECTION = "NetworkCollection";
+ public static final String NETWORKCOLLECTION = "NetworkCollection";
static final String CONFIGURATION = "Configuration";
- static final String ASSIGNINSTANCE = "assignInstance";
+ public static final String ASSIGNINSTANCE = "assignInstance";
static final String REPLACEINSTANCE = "replaceInstance";
static final String VOLUMEGROUP = "VolumeGroup";
static final String REPLACEINSTANCERETAINASSIGNMENTS = "replaceInstanceRetainAssignments";
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java
new file mode 100644
index 0000000000..068c287ee7
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java
@@ -0,0 +1,484 @@
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.javatuples.Pair;
+import org.onap.aai.domain.yang.Relationship;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.VpnBinding;
+import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
+import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
+import org.onap.aaiclient.client.aai.entities.Relationships;
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIConfigurationResources;
+import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.InstanceGroup;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.serviceinstancebeans.ModelType;
+import org.onap.so.serviceinstancebeans.RelatedInstance;
+import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.NETWORKCOLLECTION;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE;
+import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE;
+
+
+@Component
+public class ServiceEBBLoader {
+
+ private static final Logger logger = LoggerFactory.getLogger(ServiceEBBLoader.class);
+
+ private final UserParamsServiceTraversal userParamsServiceTraversal;
+ private final CatalogDbClient catalogDbClient;
+ private final VrfValidation vrfValidation;
+ private final AAIConfigurationResources aaiConfigurationResources;
+ private final WorkflowActionExtractResourcesAAI workflowActionUtils;
+ private final BBInputSetupUtils bbInputSetupUtils;
+ private final BBInputSetup bbInputSetup;
+ private final ExceptionBuilder exceptionBuilder;
+
+ public ServiceEBBLoader(UserParamsServiceTraversal userParamsServiceTraversal, CatalogDbClient catalogDbClient,
+ VrfValidation vrfValidation, AAIConfigurationResources aaiConfigurationResources,
+ WorkflowActionExtractResourcesAAI workflowActionUtils, BBInputSetupUtils bbInputSetupUtils,
+ BBInputSetup bbInputSetup, ExceptionBuilder exceptionBuilder) {
+ this.userParamsServiceTraversal = userParamsServiceTraversal;
+ this.catalogDbClient = catalogDbClient;
+ this.vrfValidation = vrfValidation;
+ this.aaiConfigurationResources = aaiConfigurationResources;
+ this.workflowActionUtils = workflowActionUtils;
+ this.bbInputSetupUtils = bbInputSetupUtils;
+ this.bbInputSetup = bbInputSetup;
+ this.exceptionBuilder = exceptionBuilder;
+ }
+
+ public List<Resource> getResourceListForService(ServiceInstancesRequest sIRequest, String requestAction,
+ DelegateExecution execution, String serviceInstanceId, String resourceId,
+ List<Pair<WorkflowType, String>> aaiResourceIds) throws IOException, VrfBondingServiceException {
+ boolean containsService = false;
+ List<Resource> resourceList = new ArrayList<>();
+ List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
+ if (requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) {
+ // SERVICE-MACRO-ASSIGN will always get user params with a
+ // service.
+
+ if (userParams != null) {
+ containsService = isContainsService(sIRequest);
+ if (containsService) {
+ resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
+ serviceInstanceId, requestAction);
+ }
+ } else {
+ buildAndThrowException(execution,
+ "Service-Macro-Assign request details must contain user params with a service");
+ }
+ } else if (requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
+ // SERVICE-MACRO-CREATE will get user params with a service,
+ // a service with a network, a service with a
+ // network collection, OR an empty service.
+ // If user params is just a service or null and macro
+ // queries the SI and finds a VNF, macro fails.
+
+ if (userParams != null) {
+ containsService = isContainsService(sIRequest);
+ }
+ if (containsService) {
+ resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
+ serviceInstanceId, requestAction);
+ }
+ if (!foundRelated(resourceList)) {
+ traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds);
+ }
+ } else if (("activateInstance".equalsIgnoreCase(requestAction)
+ || "unassignInstance".equalsIgnoreCase(requestAction)
+ || "deleteInstance".equalsIgnoreCase(requestAction)
+ || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) {
+ // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and
+ // SERVICE-MACRO-DELETE
+ // Will never get user params with service, macro will have
+ // to query the SI in AAI to find related instances.
+ traverseAAIService(execution, resourceList, resourceId, aaiResourceIds);
+ } else if ("deactivateInstance".equalsIgnoreCase(requestAction)) {
+ resourceList.add(new Resource(WorkflowType.SERVICE, "", false));
+ }
+ return resourceList;
+ }
+
+ private boolean isContainsService(ServiceInstancesRequest sIRequest) {
+ boolean containsService;
+ List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
+ containsService = userParams.stream().anyMatch(param -> param.containsKey(USER_PARAM_SERVICE));
+ return containsService;
+ }
+
+ public void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest,
+ List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds)
+ throws JsonProcessingException, VrfBondingServiceException {
+ String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId();
+ org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID);
+
+ if (service == null) {
+ buildAndThrowException(execution, "Could not find the service model in catalog db.");
+ } else {
+ resourceList.add(new Resource(WorkflowType.SERVICE, service.getModelUUID(), false));
+ RelatedInstance relatedVpnBinding =
+ bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding);
+ RelatedInstance relatedLocalNetwork =
+ bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network);
+
+ if (relatedVpnBinding != null && relatedLocalNetwork != null) {
+ traverseVrfConfiguration(aaiResourceIds, resourceList, service, relatedVpnBinding, relatedLocalNetwork);
+ } else {
+ traverseNetworkCollection(execution, resourceList, service);
+ }
+ }
+ }
+
+ public boolean foundRelated(List<Resource> resourceList) {
+ return (containsWorkflowType(resourceList, WorkflowType.VNF)
+ || containsWorkflowType(resourceList, WorkflowType.PNF)
+ || containsWorkflowType(resourceList, WorkflowType.NETWORK)
+ || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION));
+ }
+
+ public void traverseAAIService(DelegateExecution execution, List<Resource> resourceList, String resourceId,
+ List<Pair<WorkflowType, String>> aaiResourceIds) {
+ try {
+ ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(resourceId);
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO =
+ bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
+ resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false));
+ traverseServiceInstanceMSOVnfs(resourceList, aaiResourceIds, serviceInstanceMSO);
+ traverseServiceInstanceMSOPnfs(resourceList, aaiResourceIds, serviceInstanceMSO);
+ if (serviceInstanceMSO.getNetworks() != null) {
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network network : serviceInstanceMSO
+ .getNetworks()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.NETWORK, network.getNetworkId()));
+ resourceList.add(new Resource(WorkflowType.NETWORK, network.getNetworkId(), false));
+ }
+ }
+ if (serviceInstanceMSO.getCollection() != null) {
+ logger.debug("found networkcollection");
+ aaiResourceIds
+ .add(new Pair<>(WorkflowType.NETWORKCOLLECTION, serviceInstanceMSO.getCollection().getId()));
+ resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
+ serviceInstanceMSO.getCollection().getId(), false));
+ }
+ if (serviceInstanceMSO.getConfigurations() != null) {
+ for (Configuration config : serviceInstanceMSO.getConfigurations()) {
+ Optional<org.onap.aai.domain.yang.Configuration> aaiConfig =
+ aaiConfigurationResources.getConfiguration(config.getConfigurationId());
+ if (aaiConfig.isPresent() && aaiConfig.get().getRelationshipList() != null) {
+ for (Relationship relationship : aaiConfig.get().getRelationshipList().getRelationship()) {
+ if (relationship.getRelatedTo().contains("vnfc")
+ || relationship.getRelatedTo().contains("vpn-binding")) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.getConfigurationId()));
+ resourceList.add(
+ new Resource(WorkflowType.CONFIGURATION, config.getConfigurationId(), false));
+ break;
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ logger.error("Exception in traverseAAIService", ex);
+ buildAndThrowException(execution,
+ "Could not find existing Service Instance or related Instances to execute the request on.");
+ }
+ }
+
+ private void traverseServiceInstanceMSOVnfs(List<Resource> resourceList,
+ List<Pair<WorkflowType, String>> aaiResourceIds,
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
+ if (serviceInstanceMSO.getVnfs() == null) {
+ return;
+ }
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
+ resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false));
+ traverseVnfModules(resourceList, aaiResourceIds, vnf);
+ if (vnf.getVolumeGroups() != null) {
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf.getVolumeGroups()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
+ resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
+ }
+ }
+ }
+ }
+
+ private void traverseServiceInstanceMSOPnfs(List<Resource> resourceList,
+ List<Pair<WorkflowType, String>> aaiResourceIds,
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
+ if (serviceInstanceMSO.getPnfs() == null) {
+ return;
+ }
+ for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId()));
+ resourceList.add(new Resource(WorkflowType.PNF, pnf.getPnfId(), false));
+ }
+ }
+
+ protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds,
+ List<Resource> resourceList, org.onap.so.db.catalog.beans.Service service,
+ RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork)
+ throws VrfBondingServiceException, JsonProcessingException {
+ org.onap.aai.domain.yang.L3Network aaiLocalNetwork =
+ bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId());
+ vrfValidation.vrfServiceValidation(service);
+ vrfValidation.vrfCatalogDbChecks(service);
+ vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(),
+ bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId()));
+ vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork);
+ vrfValidation.aaiSubnetValidation(aaiLocalNetwork);
+ vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork);
+ vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork);
+ String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork);
+ if (existingAAIVrfConfiguration != null) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration));
+ }
+ resourceList.add(new Resource(WorkflowType.CONFIGURATION,
+ service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false));
+
+ }
+
+ protected void traverseNetworkCollection(DelegateExecution execution, List<Resource> resourceList,
+ org.onap.so.db.catalog.beans.Service service) {
+ if (isVnfCustomizationsInTheService(service)) {
+ buildAndThrowException(execution,
+ "Cannot orchestrate Service-Macro-Create without user params with a vnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
+ }
+ if (isPnfCustomizationsInTheService(service)) {
+ buildAndThrowException(execution,
+ "Cannot orchestrate Service-Macro-Create without user params with a pnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
+ }
+ List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations();
+ if (customizations.isEmpty()) {
+ logger.debug("No Collections found. CollectionResourceCustomization list is empty.");
+ } else {
+ CollectionResourceCustomization collectionResourceCustomization =
+ findCatalogNetworkCollection(execution, service);
+ traverseNetworkCollectionResourceCustomization(resourceList, collectionResourceCustomization);
+ }
+ traverseNetworkCollectionCustomization(resourceList, service);
+ }
+
+ private void traverseNetworkCollectionResourceCustomization(List<Resource> resourceList,
+ CollectionResourceCustomization collectionResourceCustomization) {
+ if (collectionResourceCustomizationShouldNotBeProcessed(resourceList, collectionResourceCustomization))
+ return;
+ int minNetworks = 0;
+ org.onap.so.db.catalog.beans.InstanceGroup instanceGroup =
+ collectionResourceCustomization.getCollectionResource().getInstanceGroup();
+ CollectionResourceInstanceGroupCustomization collectionInstCust = null;
+ if (!instanceGroup.getCollectionInstanceGroupCustomizations().isEmpty()) {
+ for (CollectionResourceInstanceGroupCustomization collectionInstanceGroupTemp : instanceGroup
+ .getCollectionInstanceGroupCustomizations()) {
+ if (collectionInstanceGroupTemp.getModelCustomizationUUID()
+ .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) {
+ collectionInstCust = collectionInstanceGroupTemp;
+ break;
+ }
+ }
+ if (interfaceNetworkQuantityIsAvailableInCollection(collectionInstCust)) {
+ minNetworks = collectionInstCust.getSubInterfaceNetworkQuantity();
+ }
+ }
+ logger.debug("minNetworks: {}", minNetworks);
+ CollectionNetworkResourceCustomization collectionNetworkResourceCust =
+ getCollectionNetworkResourceCustomization(collectionResourceCustomization, instanceGroup);
+ for (int i = 0; i < minNetworks; i++) {
+ if (collectionNetworkResourceCust != null) {
+ Resource resource = new Resource(WorkflowType.VIRTUAL_LINK,
+ collectionNetworkResourceCust.getModelCustomizationUUID(), false);
+ resource.setVirtualLinkKey(Integer.toString(i));
+ resourceList.add(resource);
+ }
+ }
+ }
+
+ private CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomization(
+ CollectionResourceCustomization collectionResourceCustomization, InstanceGroup instanceGroup) {
+ CollectionNetworkResourceCustomization collectionNetworkResourceCust = null;
+ for (CollectionNetworkResourceCustomization collectionNetworkTemp : instanceGroup
+ .getCollectionNetworkResourceCustomizations()) {
+ if (collectionNetworkTemp.getNetworkResourceCustomization().getModelCustomizationUUID()
+ .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) {
+ collectionNetworkResourceCust = collectionNetworkTemp;
+ break;
+ }
+ }
+ return collectionNetworkResourceCust;
+ }
+
+ private boolean collectionResourceCustomizationShouldNotBeProcessed(List<Resource> resourceList,
+ CollectionResourceCustomization collectionResourceCustomization) {
+ if (collectionResourceCustomization == null) {
+ logger.debug("No Network Collection Customization found");
+ return true;
+ }
+ resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
+ collectionResourceCustomization.getModelCustomizationUUID(), false));
+ logger.debug("Found a network collection");
+ if (collectionResourceCustomization.getCollectionResource() == null) {
+ logger.debug("No Network Collection found. collectionResource is null");
+ return true;
+ }
+ if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) {
+ logger.debug("No Instance Group found for network collection.");
+ return true;
+ }
+ String toscaNodeType =
+ collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType();
+ if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) {
+ logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean interfaceNetworkQuantityIsAvailableInCollection(
+ CollectionResourceInstanceGroupCustomization collectionInstCust) {
+ return collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null;
+ }
+
+ private boolean toscaNodeTypeHasNetworkCollection(String toscaNodeType) {
+ return toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION);
+ }
+
+ private void traverseNetworkCollectionCustomization(List<Resource> resourceList,
+ org.onap.so.db.catalog.beans.Service service) {
+ if (isNetworkCollectionInTheResourceList(resourceList)) {
+ return;
+ }
+ if (service.getNetworkCustomizations() == null) {
+ logger.debug("No networks were found on this service model");
+ return;
+ }
+ for (int i = 0; i < service.getNetworkCustomizations().size(); i++) {
+ resourceList.add(new Resource(WorkflowType.NETWORK,
+ service.getNetworkCustomizations().get(i).getModelCustomizationUUID(), false));
+ }
+ }
+
+ private boolean isVnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) {
+ return !(service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty());
+ }
+
+ private boolean isPnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) {
+ return !(service.getPnfCustomizations() == null || service.getPnfCustomizations().isEmpty());
+ }
+
+ private void traverseVnfModules(List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds,
+ org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf) {
+ if (vnf.getVfModules() == null) {
+ return;
+ }
+ for (VfModule vfModule : vnf.getVfModules()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
+ Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false);
+ resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean());
+ resourceList.add(resource);
+ }
+ }
+
+
+ protected String getExistingAAIVrfConfiguration(RelatedInstance relatedVpnBinding,
+ org.onap.aai.domain.yang.L3Network aaiLocalNetwork)
+ throws JsonProcessingException, VrfBondingServiceException {
+ Optional<Relationships> relationshipsOp = new AAIResultWrapper(
+ new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiLocalNetwork)).getRelationships();
+ if (relationshipsOp.isPresent()) {
+ List<AAIResultWrapper> configurationsRelatedToLocalNetwork =
+ relationshipsOp.get().getByType(AAIFluentTypeBuilder.Types.CONFIGURATION);
+ if (configurationsRelatedToLocalNetwork.size() > 1) {
+ throw new VrfBondingServiceException(
+ "Network: " + aaiLocalNetwork.getNetworkId() + " has more than 1 configuration related to it");
+ }
+ if (configurationsRelatedToLocalNetwork.size() == 1) {
+ AAIResultWrapper configWrapper = configurationsRelatedToLocalNetwork.get(0);
+ Optional<Configuration> relatedConfiguration = configWrapper.asBean(Configuration.class);
+ if (relatedConfiguration.isPresent() && vrfConfigurationAlreadyExists(relatedVpnBinding,
+ relatedConfiguration.get(), configWrapper)) {
+ return relatedConfiguration.get().getConfigurationId();
+ }
+ }
+ }
+ return null;
+ }
+
+ protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration,
+ AAIResultWrapper configWrapper) throws VrfBondingServiceException {
+ if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) {
+ Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships();
+ if (relationshipsConfigOp.isPresent()) {
+ Optional<VpnBinding> relatedInfraVpnBindingOp =
+ workflowActionUtils.extractRelationshipsVpnBinding(relationshipsConfigOp.get());
+ if (relatedInfraVpnBindingOp.isPresent()) {
+ VpnBinding relatedInfraVpnBinding = relatedInfraVpnBindingOp.get();
+ if (!relatedInfraVpnBinding.getVpnId().equalsIgnoreCase(relatedVpnBinding.getInstanceId())) {
+ throw new VrfBondingServiceException("Configuration: " + vrfConfiguration.getConfigurationId()
+ + " is not connected to the same vpn binding id provided in request: "
+ + relatedVpnBinding.getInstanceId());
+ } else {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean containsWorkflowType(List<Resource> resourceList, WorkflowType workflowType) {
+ return resourceList.stream().anyMatch(resource -> resource.getResourceType().equals(workflowType));
+ }
+
+ public boolean isNetworkCollectionInTheResourceList(List<Resource> resourceList) {
+ return resourceList.stream().anyMatch(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType());
+ }
+
+ public CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution,
+ org.onap.so.db.catalog.beans.Service service) {
+ CollectionResourceCustomization networkCollection = null;
+ int count = 0;
+ for (CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()) {
+ if (catalogDbClient.getNetworkCollectionResourceCustomizationByID(
+ collectionCust.getModelCustomizationUUID()) != null) {
+ networkCollection = collectionCust;
+ count++;
+ }
+ }
+ if (count == 0) {
+ return null;
+ } else if (count > 1) {
+ buildAndThrowException(execution,
+ "Found multiple Network Collections in the Service model, only one per Service is supported.");
+ }
+ return networkCollection;
+ }
+
+ protected void buildAndThrowException(DelegateExecution execution, String msg) {
+ logger.error(msg);
+ execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java
index aa1108cbb9..4b1fdd8da1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java
@@ -24,10 +24,12 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
@@ -44,6 +46,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE;
@@ -59,32 +62,33 @@ public class UserParamsServiceTraversal {
private final CatalogDbClient catalogDbClient;
private final ExceptionBuilder exceptionBuilder;
private boolean foundVfModuleOrVG;
+ private String vnfCustomizationUUID;
+ private String vfModuleCustomizationUUID;
UserParamsServiceTraversal(CatalogDbClient catalogDbClient, ExceptionBuilder exceptionBuilder) {
this.catalogDbClient = catalogDbClient;
this.exceptionBuilder = exceptionBuilder;
}
- protected List<Resource> getResourceListFromUserParams(DelegateExecution execution,
+ public List<Resource> getResourceListFromUserParams(DelegateExecution execution,
List<Map<String, Object>> userParams, String serviceModelVersionId, String requestAction)
throws IOException {
- List<Resource> resourceList = new ArrayList<>();
if (userParams != null) {
for (Map<String, Object> params : userParams) {
if (params.containsKey(USER_PARAM_SERVICE)) {
ObjectMapper obj = new ObjectMapper();
String input = obj.writeValueAsString(params.get(USER_PARAM_SERVICE));
Service validate = obj.readValue(input, Service.class);
- setResourceList(execution, serviceModelVersionId, requestAction, resourceList, validate);
- break;
+ return getResourceList(execution, serviceModelVersionId, requestAction, validate);
}
}
}
- return resourceList;
+ return Collections.emptyList();
}
- private void setResourceList(DelegateExecution execution, String serviceModelVersionId, String requestAction,
- List<Resource> resourceList, Service validate) {
+ private List<Resource> getResourceList(DelegateExecution execution, String serviceModelVersionId,
+ String requestAction, Service validate) {
+ List<Resource> resourceList = new ArrayList<>();
resourceList.add(new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false));
if (validate.getResources().getVnfs() != null) {
setResourceListForVnfs(execution, resourceList, validate);
@@ -95,11 +99,12 @@ public class UserParamsServiceTraversal {
if (validate.getResources().getNetworks() != null) {
setResourceListForNetworks(execution, serviceModelVersionId, requestAction, resourceList, validate);
}
+ return resourceList;
}
private void setResourceListForVnfs(DelegateExecution execution, List<Resource> resourceList, Service validate) {
- foundVfModuleOrVG = false;
for (Vnfs vnf : validate.getResources().getVnfs()) {
+ setVnfCustomizationUUID(vnf);
resourceList.add(new Resource(WorkflowType.VNF, vnf.getModelInfo().getModelCustomizationId(), false));
setResourceListForVfModules(execution, resourceList, validate, vnf);
}
@@ -109,10 +114,10 @@ public class UserParamsServiceTraversal {
Vnfs vnf) {
if (vnf.getVfModules() != null) {
for (VfModules vfModule : vnf.getVfModules()) {
+ setVfModuleCustomizationUUID(vfModule);
VfModuleCustomization vfModuleCustomization =
- catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(
- vfModule.getModelInfo().getModelCustomizationUuid());
- if (vfModuleCustomization != null) {
+ catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(vfModuleCustomizationUUID);
+ if (vfModuleCustomization != null && vfModuleCustomization.getVfModule() != null) {
setVolumeGroupWorkFlowTypeToResourceList(resourceList, vfModuleCustomization);
setVfModuleAndConfigurationWorkFlowTypeToResourceList(resourceList, validate, vnf, vfModule,
vfModuleCustomization);
@@ -127,8 +132,7 @@ public class UserParamsServiceTraversal {
private void setVolumeGroupWorkFlowTypeToResourceList(List<Resource> resourceList,
VfModuleCustomization vfModuleCustomization) {
- if (vfModuleCustomization.getVfModule() != null
- && vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null
+ if (vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null
&& vfModuleCustomization.getVolumeHeatEnv() != null) {
foundVfModuleOrVG = true;
resourceList.add(
@@ -138,11 +142,9 @@ public class UserParamsServiceTraversal {
private void setVfModuleAndConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Service validate,
Vnfs vnf, VfModules vfModule, VfModuleCustomization vfModuleCustomization) {
- if ((vfModuleCustomization.getVfModule() != null)
- && ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null
- && vfModuleCustomization.getHeatEnvironment() != null))
- || (vfModuleCustomization.getVfModule() != null
- && vfModuleCustomization.getVfModule().getModelName() != null
+ if ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null
+ && vfModuleCustomization.getHeatEnvironment() != null)
+ || (vfModuleCustomization.getVfModule().getModelName() != null
&& vfModuleCustomization.getVfModule().getModelName().contains("helm"))) {
foundVfModuleOrVG = true;
Resource resource = setVfModuleWorkFlowTypeToResourceList(resourceList, vfModuleCustomization);
@@ -162,11 +164,9 @@ public class UserParamsServiceTraversal {
private void setConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Service validate, Vnfs vnf,
VfModules vfModule, Resource resource) {
- String vfModuleCustomizationUUID = getVfModuleCustomizationUUID(vfModule);
- String vnfCustomizationUUID = getVnfCustomizationUUID(vnf);
if (!vnfCustomizationUUID.isEmpty() && !vfModuleCustomizationUUID.isEmpty()) {
- List<CvnfcConfigurationCustomization> configs = traverseCatalogDbForConfiguration(
- validate.getModelInfo().getModelVersionId(), vnfCustomizationUUID, vfModuleCustomizationUUID);
+ List<CvnfcConfigurationCustomization> configs =
+ traverseCatalogDbForConfiguration(validate.getModelInfo().getModelVersionId());
for (CvnfcConfigurationCustomization config : configs) {
Resource configResource = new Resource(WorkflowType.CONFIGURATION,
config.getConfigurationResource().getModelUUID(), false);
@@ -177,24 +177,20 @@ public class UserParamsServiceTraversal {
}
}
- private String getVfModuleCustomizationUUID(VfModules vfModule) {
- String vfModuleCustomizationUUID;
+ private void setVfModuleCustomizationUUID(VfModules vfModule) {
if (vfModule.getModelInfo() != null && vfModule.getModelInfo().getModelCustomizationUuid() != null) {
vfModuleCustomizationUUID = vfModule.getModelInfo().getModelCustomizationUuid();
} else {
vfModuleCustomizationUUID = "";
}
- return vfModuleCustomizationUUID;
}
- private String getVnfCustomizationUUID(Vnfs vnf) {
- String vnfCustomizationUUID;
+ private void setVnfCustomizationUUID(Vnfs vnf) {
if (vnf.getModelInfo() != null && vnf.getModelInfo().getModelCustomizationUuid() != null) {
vnfCustomizationUUID = vnf.getModelInfo().getModelCustomizationUuid();
} else {
vnfCustomizationUUID = "";
}
- return vnfCustomizationUUID;
}
private void setResourceListForPnfs(List<Resource> resourceList, Service validate) {
@@ -218,25 +214,29 @@ public class UserParamsServiceTraversal {
}
- private List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID,
- String vnfCustomizationUUID, String vfModuleCustomizationUUID) {
- List<CvnfcConfigurationCustomization> configurations = new ArrayList<>();
+ private List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID) {
try {
List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomization(serviceModelUUID,
vnfCustomizationUUID, vfModuleCustomizationUUID);
- for (CvnfcCustomization cvnfc : cvnfcCustomizations) {
- for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) {
- if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) {
- configurations.add(customization);
- }
- }
- }
- logger.debug("found {} fabric configuration(s)", configurations.size());
- return configurations;
+ return getCvnfcConfigurationCustomizations(cvnfcCustomizations);
} catch (Exception ex) {
logger.error("Error in finding configurations", ex);
- return configurations;
+ return Collections.emptyList();
+ }
+ }
+
+ private List<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomizations(
+ List<CvnfcCustomization> cvnfcCustomizations) {
+ List<CvnfcConfigurationCustomization> configurations = new ArrayList<>();
+ for (CvnfcCustomization cvnfc : cvnfcCustomizations) {
+ for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) {
+ if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) {
+ configurations.add(customization);
+ }
+ }
}
+ logger.debug("found {} fabric configuration(s)", configurations.size());
+ return configurations;
}
private String queryCatalogDbForNetworkCollection(DelegateExecution execution, String serviceModelVersionId) {
@@ -261,9 +261,7 @@ public class UserParamsServiceTraversal {
count++;
}
}
- if (count == 0) {
- return null;
- } else if (count > 1) {
+ if (count > 1) {
buildAndThrowException(execution,
"Found multiple Network Collections in the Service model, only one per Service is supported.");
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java
index 7db93e7979..b271226414 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java
@@ -28,15 +28,16 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.javatuples.Pair;
-import org.onap.aai.domain.yang.ServiceInstance;
import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.Relationships;
import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
-import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI;
import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.client.exception.ExceptionBuilder;
@@ -69,35 +70,12 @@ public class VnfEBBLoader {
public void traverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId, String vnfId,
List<Pair<WorkflowType, String>> aaiResourceIds) {
try {
- ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO =
- bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
+ org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI =
+ bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
+ ServiceInstance serviceInstanceMSO = bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false));
if (serviceInstanceMSO.getVnfs() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
- if (vnf.getVnfId().equals(vnfId)) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
- resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false));
- if (vnf.getVfModules() != null) {
- for (VfModule vfModule : vnf.getVfModules()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
- resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false));
- findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(),
- resourceList, aaiResourceIds);
- }
- }
- if (vnf.getVolumeGroups() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf
- .getVolumeGroups()) {
- aaiResourceIds
- .add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
- resourceList.add(
- new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
- }
- }
- break;
- }
- }
+ findVnfWithGivenId(serviceInstanceMSO, vnfId, aaiResourceIds, resourceList, execution);
}
} catch (Exception ex) {
logger.error("Exception in traverseAAIVnf", ex);
@@ -109,39 +87,13 @@ public class VnfEBBLoader {
public void customTraverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId,
String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds) {
try {
- ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO =
- bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
+ org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI =
+ bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
+ ServiceInstance serviceInstanceMSO = bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false));
if (serviceInstanceMSO.getVnfs() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
- if (vnf.getVnfId().equals(vnfId)) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
-
- String vnfCustomizationUUID =
- bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId();
- resourceList.add(new Resource(WorkflowType.VNF, vnfCustomizationUUID, false));
-
- if (vnf.getVfModules() != null) {
- for (VfModule vfModule : vnf.getVfModules()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
- resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false));
- findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(),
- resourceList, aaiResourceIds);
- }
- }
- if (vnf.getVolumeGroups() != null) {
- for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf
- .getVolumeGroups()) {
- aaiResourceIds
- .add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
- resourceList.add(
- new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
- }
- }
- break;
- }
- }
+ findVnfWithGivenIdAndAddCustomizationUUID(serviceInstanceMSO, vnfId, aaiResourceIds, resourceList,
+ execution);
}
} catch (Exception ex) {
logger.error("Exception in customTraverseAAIVnf", ex);
@@ -151,6 +103,33 @@ public class VnfEBBLoader {
}
+ private void findVnfWithGivenId(ServiceInstance serviceInstanceMSO, String vnfId,
+ List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, DelegateExecution execution) {
+ for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
+ if (vnf.getVnfId().equals(vnfId)) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
+ resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false));
+ processVfModules(vnf, aaiResourceIds, resourceList, execution);
+ processVolumeGroups(vnf, aaiResourceIds, resourceList);
+ break;
+ }
+ }
+ }
+
+ private void findVnfWithGivenIdAndAddCustomizationUUID(ServiceInstance serviceInstanceMSO, String vnfId,
+ List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, DelegateExecution execution) {
+ for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
+ if (vnf.getVnfId().equals(vnfId)) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
+ resourceList.add(new Resource(WorkflowType.VNF,
+ bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId(), false));
+ processVfModules(vnf, aaiResourceIds, resourceList, execution);
+ processVolumeGroups(vnf, aaiResourceIds, resourceList);
+ break;
+ }
+ }
+ }
+
private void findConfigurationsInsideVfModule(DelegateExecution execution, String vnfId, String vfModuleId,
List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) {
try {
@@ -161,15 +140,7 @@ public class VnfEBBLoader {
relationshipsOp = vfModuleWrapper.getRelationships();
if (relationshipsOp.isPresent()) {
relationshipsOp = workflowActionUtils.extractRelationshipsVnfc(relationshipsOp.get());
- if (relationshipsOp.isPresent()) {
- Optional<Configuration> config =
- workflowActionUtils.extractRelationshipsConfiguration(relationshipsOp.get());
- if (config.isPresent()) {
- aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.get().getConfigurationId()));
- resourceList.add(
- new Resource(WorkflowType.CONFIGURATION, config.get().getConfigurationId(), false));
- }
- }
+ addConfigToResources(relationshipsOp, resourceList, aaiResourceIds);
}
} catch (Exception ex) {
logger.error("Exception in findConfigurationsInsideVfModule", ex);
@@ -177,6 +148,40 @@ public class VnfEBBLoader {
}
}
+ private void processVfModules(GenericVnf vnf, List<Pair<WorkflowType, String>> aaiResourceIds,
+ List<Resource> resourceList, DelegateExecution execution) {
+ if (vnf.getVfModules() != null) {
+ for (VfModule vfModule : vnf.getVfModules()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId()));
+ resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false));
+ findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(), resourceList,
+ aaiResourceIds);
+ }
+ }
+ }
+
+ private void processVolumeGroups(GenericVnf vnf, List<Pair<WorkflowType, String>> aaiResourceIds,
+ List<Resource> resourceList) {
+ if (vnf.getVolumeGroups() != null) {
+ for (VolumeGroup volumeGroup : vnf.getVolumeGroups()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
+ resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false));
+ }
+ }
+ }
+
+ private void addConfigToResources(Optional<Relationships> relationshipsOp, List<Resource> resourceList,
+ List<Pair<WorkflowType, String>> aaiResourceIds) {
+ if (relationshipsOp.isPresent()) {
+ Optional<Configuration> config =
+ workflowActionUtils.extractRelationshipsConfiguration(relationshipsOp.get());
+ if (config.isPresent()) {
+ aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.get().getConfigurationId()));
+ resourceList.add(new Resource(WorkflowType.CONFIGURATION, config.get().getConfigurationId(), false));
+ }
+ }
+ }
+
private void buildAndThrowException(DelegateExecution execution, String msg) {
logger.error(msg);
execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidation.java
index 304cb9f4b4..3b54645b35 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidation.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import java.util.List;
import java.util.Optional;
@@ -26,6 +26,7 @@ import org.onap.aai.domain.yang.L3Network;
import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAI.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAI.java
index 4140692b44..7f1eb0ef07 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAI.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAI.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import java.util.List;
import java.util.Optional;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
index 3af839fbec..272c6189b4 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
@@ -27,12 +27,15 @@ import java.util.Set;
import org.apache.logging.log4j.util.Strings;
import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.bpmn.common.listener.flowmanipulator.PreFlowManipulator;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -40,6 +43,8 @@ import org.springframework.util.CollectionUtils;
@Component
public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
+ private static Logger logger = LoggerFactory.getLogger(SkipCDSBuildingBlockListener.class);
+
@Autowired
private CatalogDbClient catalogDbClient;
@@ -84,7 +89,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(customizationUUID,
vnfResourceCustomizations);
if (null != vrc) {
- boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue();
+ logger.debug("getSkipPostInstConf value: " + vrc.getSkipPostInstConf().booleanValue());
+ boolean skipConfigVNF = vrc.getSkipPostInstConf().booleanValue();
currentSequenceSkipCheck(execution, skipConfigVNF);
}
@@ -96,7 +102,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(customizationUUID);
if (null != vfc) {
- boolean skipVfModule = vfc.isSkipPostInstConf();
+ logger.debug("getSkipPostInstConf value: " + vfc.getSkipPostInstConf().booleanValue());
+ boolean skipVfModule = vfc.getSkipPostInstConf();
currentSequenceSkipCheck(execution, skipVfModule);
}
@@ -106,7 +113,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator {
catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(customizationUUID);
if (null != pnfResourceCustomization) {
- boolean skipConfigPNF = pnfResourceCustomization.isSkipPostInstConf();
+ logger.debug("getSkipPostInstConf value: " + pnfResourceCustomization.getSkipPostInstConf());
+ boolean skipConfigPNF = pnfResourceCustomization.getSkipPostInstConf();
currentSequenceSkipCheck(execution, skipConfigPNF);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
index 5ffba455b3..8c74e3df69 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
@@ -34,7 +34,7 @@ public class SkipConfigVnfListener implements PreFlowManipulator {
if (vnfResourceCustomizations != null && !vnfResourceCustomizations.isEmpty()) {
VnfResourceCustomization vrc =
catalogDbClient.findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations);
- boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue();
+ boolean skipConfigVNF = vrc.getSkipPostInstConf().booleanValue();
if (skipConfigVNF) {
execution.setVariable(BBConstants.G_CURRENT_SEQUENCE,
((int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE)) + 1);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java
index 37d4e41553..f4b2a8b4b1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java
@@ -17,6 +17,8 @@ public class InstanceRequest {
private String rbVersion;
@JsonProperty("k8sRBProfileName")
private String profileName;
+ @JsonProperty("k8sRBInstanceReleaseName")
+ private String releaseName;
@JsonProperty("vfModuleUUID")
private String vfModuleUUID;
@JsonProperty("cloudRegionId")
@@ -56,6 +58,16 @@ public class InstanceRequest {
this.profileName = profileName;
}
+ @JsonProperty("release-name")
+ public String getReleaseName() {
+ return releaseName;
+ }
+
+ @JsonProperty("release-name")
+ public void setReleaseName(String releaseName) {
+ this.releaseName = releaseName;
+ }
+
@JsonProperty("cloud-region")
public String getCloudRegion() {
return cloudRegion;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
index e089da6ac7..a6e29227a0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
@@ -24,7 +24,6 @@ import io.grpc.stub.StreamObserver;
import io.grpc.testing.GrpcCleanupRule;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
@@ -32,7 +31,7 @@ import javax.annotation.PostConstruct;
import org.junit.Rule;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.slf4j.Logger;
@@ -41,7 +40,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
-public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
+public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class);
@@ -61,7 +60,7 @@ public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
@PostConstruct
public void start() throws IOException {
- final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() {
+ final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() {
@Override
public StreamObserver<ExecutionServiceInput> process(
StreamObserver<ExecutionServiceOutput> responseObserver) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
index ab83acaec2..78b9bf1ee6 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
@@ -27,7 +27,7 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.common.data.TestDataSetup;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils;
-import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.WorkflowActionExtractResourcesAAI;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java
index cfaa4040c7..fb15ffa2b3 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java
@@ -21,35 +21,85 @@
package org.onap.so.bpmn.infrastructure.service.level;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import java.util.ArrayList;
+import java.util.List;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
import org.junit.Test;
-import java.util.List;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.infrastructure.service.level.impl.ServiceLevelConstants;
+import org.onap.so.client.exception.ExceptionBuilder;
+@RunWith(MockitoJUnitRunner.class)
public class ServiceLevelTest {
private static final String EXECUTION_KEY_PNF_NAME_LIST = "pnfNameList";
private static final String EXECUTION_KEY_PNF_COUNTER = "pnfCounter";
+ private static final String PARAM_NAME = "param1";
+ private static final String SCOPE = "scope1";
+ private static final String PNF_NAME = "pnfName1";
+
+ @Mock
+ private ExceptionBuilder exceptionBuilderMock;
+ @InjectMocks
+ private ServiceLevel testedObject;
+
+ private DelegateExecution execution;
+
+ @Before
+ public void init() {
+ execution = new DelegateExecutionFake();
+ }
@Test
public void pnfCounterExecution_success() {
// given
- String pnfName = "pnfName1";
- DelegateExecution execution = new DelegateExecutionFake();
- execution.setVariable(EXECUTION_KEY_PNF_NAME_LIST, createPnfNameList(pnfName));
+ execution.setVariable(EXECUTION_KEY_PNF_NAME_LIST, createPnfNameList());
execution.setVariable(EXECUTION_KEY_PNF_COUNTER, 0);
// when
- new ServiceLevel().pnfCounterExecution(execution);
+ testedObject.pnfCounterExecution(execution);
// then
- assertThat(execution.getVariable(ServiceLevelConstants.PNF_NAME)).isEqualTo(pnfName);
+ assertThat(execution.getVariable(ServiceLevelConstants.PNF_NAME)).isEqualTo(PNF_NAME);
assertThat(execution.getVariable(EXECUTION_KEY_PNF_COUNTER)).isEqualTo(1);
}
- private List<String> createPnfNameList(String pnfName) {
+ @Test
+ public void validateParams_success_paramExistsInExecution() {
+ // given
+ execution.setVariable(PARAM_NAME, "anyValue");
+ // when
+ testedObject.validateParamsWithScope(execution, "anyScope", createParamList());
+ // then
+ verify(exceptionBuilderMock, times(0)).buildAndThrowWorkflowException(any(DelegateExecution.class),
+ eq(ServiceLevelConstants.ERROR_CODE), any(String.class));
+ }
+
+ @Test
+ public void validateParams_exceptionParamDoesNotExistInExecution() {
+ // when
+ testedObject.validateParamsWithScope(execution, SCOPE, createParamList());
+ // then
+ verify(exceptionBuilderMock).buildAndThrowWorkflowException(execution, ServiceLevelConstants.ERROR_CODE,
+ "Validation of health check workflow parameters failed for the scope: " + SCOPE);
+ }
+
+ private List<String> createParamList() {
+ List<String> params = new ArrayList<>();
+ params.add(PARAM_NAME);
+ return params;
+ }
+
+ private List<String> createPnfNameList() {
List<String> pnfNameList = new ArrayList<>();
- pnfNameList.add(pnfName);
+ pnfNameList.add(PNF_NAME);
return pnfNameList;
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
index 26e0d2f8c9..10e6ed4895 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
@@ -24,16 +24,13 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
-import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.anyObject;
@@ -57,7 +54,6 @@ import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
-import org.javatuples.Pair;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
@@ -78,6 +74,8 @@ 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.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.ServiceEBBLoader;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.UserParamsServiceTraversal;
import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.VnfEBBLoader;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
@@ -141,6 +139,10 @@ public class WorkflowActionTest extends BaseTaskTest {
@Spy
protected VnfEBBLoader vnfEBBLoaderSpy;
+ @InjectMocks
+ @Spy
+ protected ServiceEBBLoader serviceEBBLoader;
+
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -232,7 +234,6 @@ public class WorkflowActionTest extends BaseTaskTest {
when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource,
true, "my-custom-cloud-owner")).thenReturn(northBoundRequest);
-
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs, "AssignServiceInstanceBB", "ActivateServiceInstanceBB");
@@ -1044,7 +1045,7 @@ public class WorkflowActionTest extends BaseTaskTest {
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB",
- "AssignFabricConfigurationBB", "ActivateFabricConfigurationBB");
+ "AddFabricConfigurationBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
List<CvnfcCustomization> cvnfcCustomizations = new ArrayList<CvnfcCustomization>();
@@ -1078,15 +1079,14 @@ public class WorkflowActionTest extends BaseTaskTest {
when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource,
true, "my-custom-cloud-owner")).thenReturn(northBoundRequest);
- // when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("fc25201d-36d6-43a3-8d39-fdae88e526ae",
- // "9a6d01fd-19a7-490a-9800-460830a12e0b")).thenReturn(cvnfcCustomizations);
+
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
- assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB",
- "AssignFabricConfigurationBB", "ActivateFabricConfigurationBB", "AssignFabricConfigurationBB",
- "ActivateFabricConfigurationBB");
+ assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB");
}
+
+
@Test
public void selectExecutionListALaCarteVfModuleNoVolumeGroupReplaceTest() throws Exception {
String gAction = "replaceInstance";
@@ -1450,7 +1450,6 @@ public class WorkflowActionTest extends BaseTaskTest {
"ChangeModelVnfBB", "ChangeModelServiceInstanceBB");
}
-
@Test
public void selectExecutionListALaCarteVfModuleFabricDeleteTest() throws Exception {
String gAction = "deleteInstance";
@@ -2061,178 +2060,6 @@ public class WorkflowActionTest extends BaseTaskTest {
}
}
- @Ignore
- @Test
- public void traverseCatalogDbServiceMultipleNetworkTest() throws IOException, VrfBondingServiceException {
- execution.setVariable("testProcessKey", "testProcessKeyValue");
- Service service = new Service();
- List<NetworkResourceCustomization> networkCustomizations = new ArrayList<>();
- NetworkResourceCustomization networkCust = new NetworkResourceCustomization();
- networkCust.setModelCustomizationUUID("123");
- networkCustomizations.add(networkCust);
- service.setNetworkCustomizations(networkCustomizations);
- NetworkCollectionResourceCustomization collectionResourceCustomization =
- new NetworkCollectionResourceCustomization();
- collectionResourceCustomization.setModelCustomizationUUID("123");
- CollectionResource collectionResource = new CollectionResource();
- collectionResource.setToscaNodeType("NetworkCollection");
- InstanceGroup instanceGroup = new InstanceGroup();
- List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations = new ArrayList<>();
- CollectionResourceInstanceGroupCustomization collectionInstanceGroupCustomization =
- new CollectionResourceInstanceGroupCustomization();
- collectionInstanceGroupCustomization.setSubInterfaceNetworkQuantity(3);
- collectionInstanceGroupCustomizations.add(collectionInstanceGroupCustomization);
- instanceGroup.setCollectionInstanceGroupCustomizations(collectionInstanceGroupCustomizations);
- collectionResource.setInstanceGroup(instanceGroup);
- collectionResourceCustomization.setCollectionResource(collectionResource);;
- service.setModelUUID("abc");
- service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
- service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
- doReturn(service).when(catalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");
- doReturn(collectionResourceCustomization).when(catalogDbClient)
- .getNetworkCollectionResourceCustomizationByID("123");
- String bpmnRequest = readBpmnRequestFromFile(MACRO_ACTIVATE_DELETE_UNASSIGN_JSON);
- ObjectMapper mapper = new ObjectMapper();
- ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
- List<Resource> resourceCounter = new ArrayList<>();
- thrown.expect(BpmnError.class);
- List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
- workflowAction.traverseCatalogDbService(execution, sIRequest, resourceCounter, aaiResourceIds);
- }
-
-
-
- @Test
- public void findCatalogNetworkCollectionTest() {
- Service service = new Service();
- NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization();
- networkCustomization.setModelCustomizationUUID("123");
- service.getCollectionResourceCustomizations().add(networkCustomization);
- doReturn(networkCustomization).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123");
- CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service);
- assertNotNull(customization);
- }
-
- @Test
- public void findCatalogNetworkCollectionEmptyTest() {
- Service service = new Service();
- NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization();
- networkCustomization.setModelCustomizationUUID("123");
- service.getCollectionResourceCustomizations().add(networkCustomization);
- CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service);
- assertNull(customization);
- }
-
- @Test
- public void findCatalogNetworkCollectionMoreThanOneTest() {
- Service service = new Service();
- NetworkCollectionResourceCustomization networkCustomization1 = new NetworkCollectionResourceCustomization();
- networkCustomization1.setModelCustomizationUUID("123");
- NetworkCollectionResourceCustomization networkCustomization2 = new NetworkCollectionResourceCustomization();
- networkCustomization2.setModelCustomizationUUID("321");
- service.getCollectionResourceCustomizations().add(networkCustomization1);
- service.getCollectionResourceCustomizations().add(networkCustomization2);
- doReturn(networkCustomization1).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123");
- doReturn(networkCustomization2).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("321");
- workflowAction.findCatalogNetworkCollection(execution, service);
- assertEquals("Found multiple Network Collections in the Service model, only one per Service is supported.",
- execution.getVariable("WorkflowActionErrorMessage"));
- }
-
-
- @Test
- public void traverseAAIServiceTest() {
- List<Resource> resourceCounter = new ArrayList<>();
- String resourceId = "si0";
- List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
-
- ServiceInstance serviceInstanceAAI = new ServiceInstance();
- serviceInstanceAAI.setServiceInstanceId(resourceId);
-
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstance = setServiceInstance();
- setGenericVnf();
- setVfModule(true);
- setVolumeGroup();
- setL3Network();
- setCollection();
- setConfiguration();
-
- Configuration config = new Configuration();
- config.setConfigurationId("testConfigurationId2");
- serviceInstance.getConfigurations().add(config);
-
- Relationship relationship1 = new Relationship();
- relationship1.setRelatedTo("vnfc");
- RelationshipList relationshipList1 = new RelationshipList();
- relationshipList1.getRelationship().add(relationship1);
-
- Relationship relationship2 = new Relationship();
- relationship2.setRelatedTo("vpn-binding");
- RelationshipList relationshipList2 = new RelationshipList();
- relationshipList2.getRelationship().add(relationship2);
-
- org.onap.aai.domain.yang.Configuration aaiConfiguration1 = new org.onap.aai.domain.yang.Configuration();
- aaiConfiguration1.setConfigurationId("testConfigurationId");
- aaiConfiguration1.setRelationshipList(relationshipList1);
-
- org.onap.aai.domain.yang.Configuration aaiConfiguration2 = new org.onap.aai.domain.yang.Configuration();
- aaiConfiguration2.setConfigurationId("testConfigurationId2");
- aaiConfiguration2.setRelationshipList(relationshipList1);
-
- try {
- doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById(resourceId);
- doReturn(serviceInstance).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
- doReturn(Optional.of(aaiConfiguration1)).when(aaiConfigurationResources)
- .getConfiguration("testConfigurationId");
- doReturn(Optional.of(aaiConfiguration2)).when(aaiConfigurationResources)
- .getConfiguration("testConfigurationId2");
- workflowAction.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds);
- assertEquals(8, resourceCounter.size());
- assertTrue(resourceCounter.get(2).isBaseVfModule());
- assertThat(aaiResourceIds, sameBeanAs(getExpectedResourceIds()));
- } catch (Exception e) {
- fail("Unexpected exception was thrown.");
- }
- }
-
- @Test
- public void foundRelatedTest() {
- List<Resource> resourceList = new ArrayList<>();
- resourceList.add(new Resource(WorkflowType.PNF, "model customization id", false));
- resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false));
- resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false));
- resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false));
-
- assertEquals(workflowAction.foundRelated(resourceList), true);
- }
-
- @Test
- public void containsWorkflowTypeTest() {
- List<Resource> resourceList = new ArrayList<>();
- resourceList.add(new Resource(WorkflowType.PNF, "resource id", false));
- resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false));
- resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false));
- resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false));
-
- assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.PNF), true);
- assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.VNF), true);
- assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORK), true);
- assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION), true);
- assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.CONFIGURATION), false);
- }
-
- private List<Pair<WorkflowType, String>> getExpectedResourceIds() {
- List<Pair<WorkflowType, String>> resourceIds = new ArrayList<>();
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VNF, "testVnfId1"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VFMODULE, "testVfModuleId1"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VOLUMEGROUP, "testVolumeGroupId1"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.NETWORK, "testNetworkId1"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.NETWORKCOLLECTION, "testId"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, "testConfigurationId"));
- resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, "testConfigurationId2"));
- return resourceIds;
- }
-
private List<OrchestrationFlow> createFlowList(String... flowNames) {
List<OrchestrationFlow> result = new ArrayList<>();
int sequenceNumber = 1;
@@ -2249,6 +2076,7 @@ public class WorkflowActionTest extends BaseTaskTest {
for (int i = 0; i < ebbs.size(); i++) {
assertEquals(ebbs.get(i).getBuildingBlock().getBpmnFlowName(), flowNames[i]);
}
+ assertEquals(ebbs.size(), flowNames.length);
}
private void initExecution(String gAction, String bpmnRequest, boolean isAlaCarte) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java
new file mode 100644
index 0000000000..a5ecf364a6
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java
@@ -0,0 +1,357 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (c) 2020 Nokia
+ * ================================================================================
+ * 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.bpmn.infrastructure.workflow.tasks.ebb.loader;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.javatuples.Pair;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.mockito.Mock;
+import org.onap.aai.domain.yang.Relationship;
+import org.onap.aai.domain.yang.RelationshipList;
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aaiclient.client.aai.entities.Relationships;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIConfigurationResources;
+import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
+import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResource;
+import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.InstanceGroup;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.serviceinstancebeans.RelatedInstance;
+import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyList;
+import static org.mockito.Mockito.anyString;
+
+public class ServiceEBBLoaderTest extends BaseTaskTest {
+
+ private static final String MACRO_ACTIVATE_DELETE_UNASSIGN_JSON = "Macro/ServiceMacroActivateDeleteUnassign.json";
+ private static final String MACRO_ASSIGN_JSON = "Macro/ServiceMacroAssign.json";
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Mock
+ protected Relationships relationships;
+
+ private DelegateExecution execution;
+ private ServiceEBBLoader serviceEBBLoader;
+ private UserParamsServiceTraversal mockUserParamsServiceTraversal;
+ private CatalogDbClient mockCatalogDbClient;
+ private VrfValidation mockVrfValidation;
+ private AAIConfigurationResources mockAaiConfigurationResources;
+ private WorkflowActionExtractResourcesAAI mockWorkflowActionExtractResourcesAAI;
+ private BBInputSetupUtils mockBbInputSetupUtils;
+ private BBInputSetup mockBbInputSetup;
+
+ @Before
+ public void before() throws Exception {
+ execution = new DelegateExecutionFake();
+ mockUserParamsServiceTraversal = mock(UserParamsServiceTraversal.class);
+ mockCatalogDbClient = mock(CatalogDbClient.class);
+ mockVrfValidation = mock(VrfValidation.class);
+ mockAaiConfigurationResources = mock(AAIConfigurationResources.class);
+ mockWorkflowActionExtractResourcesAAI = mock(WorkflowActionExtractResourcesAAI.class);
+ mockBbInputSetupUtils = mock(BBInputSetupUtils.class);
+ mockBbInputSetup = mock(BBInputSetup.class);
+ serviceEBBLoader = new ServiceEBBLoader(mockUserParamsServiceTraversal, mockCatalogDbClient, mockVrfValidation,
+ mockAaiConfigurationResources, mockWorkflowActionExtractResourcesAAI, mockBbInputSetupUtils,
+ mockBbInputSetup, mock(ExceptionBuilder.class));
+ }
+
+
+ @Test
+ public void getResourceListForServiceWithRequestActionAssignInstance()
+ throws IOException, VrfBondingServiceException {
+ String bpmnRequest = readBpmnRequestFromFile(MACRO_ASSIGN_JSON);
+ ObjectMapper mapper = new ObjectMapper();
+ ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
+ String requestAction = "assignInstance";
+ String serviceInstanceId = "123";
+ String resourceId = "si0";
+ List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+ doReturn(prepareListWithResources()).when(mockUserParamsServiceTraversal).getResourceListFromUserParams(any(),
+ anyList(), anyString(), anyString());
+ List<Resource> resources = serviceEBBLoader.getResourceListForService(sIRequest, requestAction, execution,
+ serviceInstanceId, resourceId, aaiResourceIds);
+ assertNotNull(resources);
+ assertEquals(resources.size(), 6);
+ }
+
+ @Test
+ public void findCatalogNetworkCollectionTest() {
+ Service service = new Service();
+ NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization();
+ networkCustomization.setModelCustomizationUUID("123");
+ service.getCollectionResourceCustomizations().add(networkCustomization);
+ doReturn(networkCustomization).when(mockCatalogDbClient).getNetworkCollectionResourceCustomizationByID("123");
+ CollectionResourceCustomization customization =
+ serviceEBBLoader.findCatalogNetworkCollection(execution, service);
+ assertNotNull(customization);
+ }
+
+ @Test
+ public void findCatalogNetworkCollectionEmptyTest() {
+ Service service = new Service();
+ NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization();
+ networkCustomization.setModelCustomizationUUID("123");
+ service.getCollectionResourceCustomizations().add(networkCustomization);
+ CollectionResourceCustomization customization =
+ serviceEBBLoader.findCatalogNetworkCollection(execution, service);
+ assertNull(customization);
+ }
+
+ @Test
+ public void findCatalogNetworkCollectionMoreThanOneTest() {
+ Service service = new Service();
+ NetworkCollectionResourceCustomization networkCustomization1 = new NetworkCollectionResourceCustomization();
+ networkCustomization1.setModelCustomizationUUID("123");
+ NetworkCollectionResourceCustomization networkCustomization2 = new NetworkCollectionResourceCustomization();
+ networkCustomization2.setModelCustomizationUUID("321");
+ service.getCollectionResourceCustomizations().add(networkCustomization1);
+ service.getCollectionResourceCustomizations().add(networkCustomization2);
+ doReturn(networkCustomization1).when(mockCatalogDbClient).getNetworkCollectionResourceCustomizationByID("123");
+ doReturn(networkCustomization2).when(mockCatalogDbClient).getNetworkCollectionResourceCustomizationByID("321");
+ serviceEBBLoader.findCatalogNetworkCollection(execution, service);
+ assertEquals("Found multiple Network Collections in the Service model, only one per Service is supported.",
+ execution.getVariable("WorkflowActionErrorMessage"));
+ }
+
+ @Test
+ public void foundRelatedTest() {
+ List<Resource> resourceList = new ArrayList<>();
+ resourceList.add(new Resource(WorkflowType.PNF, "model customization id", false));
+ resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false));
+ resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false));
+ resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false));
+
+ assertTrue(serviceEBBLoader.foundRelated(resourceList));
+ }
+
+ @Test
+ public void containsWorkflowTypeTest() {
+ List<Resource> resourceList = new ArrayList<>();
+ resourceList.add(new Resource(WorkflowType.PNF, "resource id", false));
+ resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false));
+ resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false));
+ resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false));
+
+ assertTrue(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.PNF));
+ assertTrue(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.VNF));
+ assertTrue(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.NETWORK));
+ assertTrue(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION));
+ assertFalse(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.CONFIGURATION));
+ }
+
+ @Test
+ public void traverseAAIServiceTest() {
+ List<Resource> resourceCounter = new ArrayList<>();
+ String resourceId = "si0";
+ List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+
+ ServiceInstance serviceInstanceAAI = new ServiceInstance();
+ serviceInstanceAAI.setServiceInstanceId(resourceId);
+
+ org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstance = setServiceInstance();
+ setGenericVnf();
+ setVfModule(true);
+ setVolumeGroup();
+ setL3Network();
+ setCollection();
+ setConfiguration();
+
+ Configuration config = new Configuration();
+ config.setConfigurationId("testConfigurationId2");
+ serviceInstance.getConfigurations().add(config);
+
+ Relationship relationship1 = new Relationship();
+ relationship1.setRelatedTo("vnfc");
+ RelationshipList relationshipList1 = new RelationshipList();
+ relationshipList1.getRelationship().add(relationship1);
+
+ Relationship relationship2 = new Relationship();
+ relationship2.setRelatedTo("vpn-binding");
+ RelationshipList relationshipList2 = new RelationshipList();
+ relationshipList2.getRelationship().add(relationship2);
+
+ org.onap.aai.domain.yang.Configuration aaiConfiguration1 = new org.onap.aai.domain.yang.Configuration();
+ aaiConfiguration1.setConfigurationId("testConfigurationId");
+ aaiConfiguration1.setRelationshipList(relationshipList1);
+
+ org.onap.aai.domain.yang.Configuration aaiConfiguration2 = new org.onap.aai.domain.yang.Configuration();
+ aaiConfiguration2.setConfigurationId("testConfigurationId2");
+ aaiConfiguration2.setRelationshipList(relationshipList1);
+
+ try {
+ doReturn(serviceInstanceAAI).when(mockBbInputSetupUtils).getAAIServiceInstanceById(resourceId);
+ doReturn(serviceInstance).when(mockBbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
+ doReturn(Optional.of(aaiConfiguration1)).when(mockAaiConfigurationResources)
+ .getConfiguration("testConfigurationId");
+ doReturn(Optional.of(aaiConfiguration2)).when(mockAaiConfigurationResources)
+ .getConfiguration("testConfigurationId2");
+ serviceEBBLoader.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds);
+ assertEquals(8, resourceCounter.size());
+ assertTrue(resourceCounter.get(2).isBaseVfModule());
+ assertThat(aaiResourceIds, sameBeanAs(getExpectedResourceIds()));
+ } catch (Exception e) {
+ fail("Unexpected exception was thrown.");
+ }
+ }
+
+ @Test
+ public void traverseVrfConfigurationTest() throws VrfBondingServiceException, JsonProcessingException {
+ List<Resource> resource = new ArrayList<>();
+ List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+
+ Service service = new Service();
+ List<ConfigurationResourceCustomization> resourceCustomizations = new ArrayList<>();
+
+ ConfigurationResourceCustomization configuration = new ConfigurationResourceCustomization();
+ configuration.setModelCustomizationUUID("123");
+ resourceCustomizations.add(configuration);
+ service.setConfigurationCustomizations(resourceCustomizations);
+
+ Relationship relationship = new Relationship();
+ relationship.setRelatedTo("vpn-binding");
+
+ RelationshipList relationshipList = new RelationshipList();
+ relationshipList.getRelationship().add(relationship);
+
+ org.onap.aai.domain.yang.L3Network aaiLocalNetwork = new org.onap.aai.domain.yang.L3Network();
+ aaiLocalNetwork.setNetworkId("localNetworkId");
+ aaiLocalNetwork.setRelationshipList(relationshipList);
+
+ RelatedInstance relatedVpnBinding = new RelatedInstance();
+ relatedVpnBinding.setInstanceId("vpnBindingInstanceId");
+ RelatedInstance relatedLocalNetwork = new RelatedInstance();
+ relatedLocalNetwork.setInstanceId("localNetworkInstanceId");
+
+
+ doReturn(aaiLocalNetwork).when(mockBbInputSetupUtils).getAAIL3Network("localNetworkInstanceId");
+
+ serviceEBBLoader.traverseVrfConfiguration(aaiResourceIds, resource, service, relatedVpnBinding,
+ relatedLocalNetwork);
+ assertEquals(resource.size(), 1);
+ assertEquals(aaiResourceIds.size(), 0);
+ }
+
+ private List<Pair<WorkflowType, String>> getExpectedResourceIds() {
+ List<Pair<WorkflowType, String>> resourceIds = new ArrayList<>();
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VNF, "testVnfId1"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VFMODULE, "testVfModuleId1"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VOLUMEGROUP, "testVolumeGroupId1"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.NETWORK, "testNetworkId1"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.NETWORKCOLLECTION, "testId"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, "testConfigurationId"));
+ resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.CONFIGURATION, "testConfigurationId2"));
+ return resourceIds;
+ }
+
+ @Test
+ public void traverseCatalogDbServiceMultipleNetworkTest() throws IOException, VrfBondingServiceException {
+ execution.setVariable("testProcessKey", "testProcessKeyValue");
+ Service service = new Service();
+ List<NetworkResourceCustomization> networkCustomizations = new ArrayList<>();
+ NetworkResourceCustomization networkCust = new NetworkResourceCustomization();
+ networkCust.setModelCustomizationUUID("123");
+ networkCustomizations.add(networkCust);
+ service.setNetworkCustomizations(networkCustomizations);
+ NetworkCollectionResourceCustomization collectionResourceCustomization =
+ new NetworkCollectionResourceCustomization();
+ collectionResourceCustomization.setModelCustomizationUUID("123");
+ CollectionResource collectionResource = new CollectionResource();
+ collectionResource.setToscaNodeType("NetworkCollection");
+ InstanceGroup instanceGroup = new InstanceGroup();
+ List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations = new ArrayList<>();
+ CollectionResourceInstanceGroupCustomization collectionInstanceGroupCustomization =
+ new CollectionResourceInstanceGroupCustomization();
+ collectionInstanceGroupCustomization.setSubInterfaceNetworkQuantity(3);
+ collectionInstanceGroupCustomizations.add(collectionInstanceGroupCustomization);
+ instanceGroup.setCollectionInstanceGroupCustomizations(collectionInstanceGroupCustomizations);
+ collectionResource.setInstanceGroup(instanceGroup);
+ collectionResourceCustomization.setCollectionResource(collectionResource);;
+ service.setModelUUID("abc");
+ service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
+ service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
+
+
+ doReturn(service).when(mockCatalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");
+ doReturn(collectionResourceCustomization).when(mockCatalogDbClient)
+ .getNetworkCollectionResourceCustomizationByID("123");
+ String bpmnRequest = readBpmnRequestFromFile(MACRO_ACTIVATE_DELETE_UNASSIGN_JSON);
+ ObjectMapper mapper = new ObjectMapper();
+ ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class);
+
+ List<Resource> resource = new ArrayList<>();
+ List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+
+ serviceEBBLoader.traverseCatalogDbService(execution, sIRequest, resource, aaiResourceIds);
+ assertEquals(resource.size(), 2);
+ }
+
+ private String readBpmnRequestFromFile(String fileName) throws IOException {
+ return new String(Files.readAllBytes(Paths.get("src/test/resources/__files/" + fileName)));
+ }
+
+ private List<Resource> prepareListWithResources() {
+ List<Resource> resourceList = new ArrayList<>();
+ resourceList.add(new Resource(WorkflowType.SERVICE, "3c40d244-808e-42ca-b09a-256d83d19d0a", false));
+ resourceList.add(new Resource(WorkflowType.VNF, "ab153b6e-c364-44c0-bef6-1f2982117f04", false));
+ resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, "a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f", false));
+ resourceList.add(new Resource(WorkflowType.VFMODULE, "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", false));
+ resourceList.add(new Resource(WorkflowType.VFMODULE, "3c40d244-808e-42ca-b09a-256d83d19d0a", false));
+ resourceList.add(new Resource(WorkflowType.VFMODULE, "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", false));
+ return resourceList;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversalTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversalTest.java
index 99f17a3628..9f4bd97ac6 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversalTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversalTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -28,6 +28,8 @@ import org.junit.Test;
import org.mockito.Mockito;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BBConstants;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.beans.ConfigurationResource;
import org.onap.so.db.catalog.beans.CvnfcCustomization;
@@ -59,6 +61,7 @@ public class UserParamsServiceTraversalTest extends BaseTaskTest {
private static final String MACRO_ASSIGN_JSON = "Macro/ServiceMacroAssign.json";
private static final String MACRO_ASSIGN_PNF_JSON = "Macro/ServiceMacroAssignPnf.json";
private static final String NETWORK_COLLECTION_JSON = "Macro/CreateNetworkCollection.json";
+ private static final String MACRO_CREATE_WITHOUT_RESOURCES_JSON = "Macro/ServiceMacroCreateWithoutResources.json";
private static final String serviceInstanceId = "123";
private DelegateExecution execution;
private CatalogDbClient mockCatalogDbClient;
@@ -74,6 +77,24 @@ public class UserParamsServiceTraversalTest extends BaseTaskTest {
}
@Test
+ public void getResourceListFromUserParams() throws Exception {
+ initExecution(requestAction, readBpmnRequestFromFile(MACRO_CREATE_WITHOUT_RESOURCES_JSON), false);
+ Mockito.doReturn(getVfModuleCustomization()).when(mockCatalogDbClient)
+ .getVfModuleCustomizationByModelCuztomizationUUID("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f");
+ Mockito.doReturn(getCvnfcCustomizations()).when(mockCatalogDbClient).getCvnfcCustomization(anyString(),
+ anyString(), anyString());
+
+ List<Resource> resourceListFromUserParams = userParamsServiceTraversal.getResourceListFromUserParams(execution,
+ getUserParams(), serviceInstanceId, requestAction);
+ List<WorkflowType> expected = List.of(WorkflowType.SERVICE);
+ List<WorkflowType> result =
+ resourceListFromUserParams.stream().map(Resource::getResourceType).collect(Collectors.toList());
+
+ assertEquals(1, resourceListFromUserParams.size());
+ assertThat(expected, is(result));
+ }
+
+ @Test
public void getResourceListFromUserParamsForVnfs() throws Exception {
initExecution(requestAction, readBpmnRequestFromFile(MACRO_ASSIGN_JSON), false);
Mockito.doReturn(getVfModuleCustomization()).when(mockCatalogDbClient)
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java
new file mode 100644
index 0000000000..a9bfde9bab
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2021 Nokia
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * Modifications Copyright (c) 2021 Nokia
+ * ================================================================================
+ * Modifications Copyright (c) 2020 Tech Mahindra
+ * ================================================================================
+ * 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.bpmn.infrastructure.workflow.tasks.ebb.loader;
+
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.javatuples.Pair;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+
+public class VnfEBBLoaderTest {
+
+ private String serviceId;
+ private String vnfId;
+ private BBInputSetupUtils bbInputSetupUtils;
+ private BBInputSetup bbInputSetup;
+ private WorkflowActionExtractResourcesAAI workflowActionUtils;
+ private ExceptionBuilder exceptionBuilder;
+ private DelegateExecution delegateExecution;
+ private VnfEBBLoader cut;
+
+ private org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI;
+ private ServiceInstance serviceInstanceMSO;
+
+ @Before
+ public void setup() {
+ serviceId = "service123";
+ vnfId = "vnf123";
+ serviceInstanceAAI = mock(org.onap.aai.domain.yang.ServiceInstance.class);
+ serviceInstanceMSO = mock(ServiceInstance.class);
+ bbInputSetupUtils = mock(BBInputSetupUtils.class);
+ bbInputSetup = mock(BBInputSetup.class);
+ workflowActionUtils = mock(WorkflowActionExtractResourcesAAI.class);
+ exceptionBuilder = mock(ExceptionBuilder.class);
+ delegateExecution = new DelegateExecutionFake();
+ }
+
+ @Test
+ public void traverseAAIVnf_shouldAddServiceToResourceList() throws Exception {
+ List<Resource> resourceList = new ArrayList<>();
+ List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+ doReturn(serviceInstanceAAI).when(bbInputSetupUtils).getAAIServiceInstanceById(serviceId);
+ doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
+ cut = new VnfEBBLoader(bbInputSetupUtils, bbInputSetup, workflowActionUtils, exceptionBuilder);
+ cut.traverseAAIVnf(delegateExecution, resourceList, serviceId, vnfId, aaiResourceIds);
+ assertEquals(WorkflowType.SERVICE, resourceList.get(0).getResourceType());
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidationTest.java
index 7f9f0417ea..dcccb74f58 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidationTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidationTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doReturn;
@@ -45,6 +45,7 @@ import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException;
import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAITest.java
index 7ac245d0f4..ba55dd0365 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/WorkflowActionExtractResourcesAAITest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.workflow.tasks;
+package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
@@ -38,6 +38,7 @@ import org.onap.aaiclient.client.aai.entities.Relationships;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.aai.entities.uri.AAISimpleUri;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.WorkflowActionExtractResourcesAAI;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/Macro/ServiceMacroCreateWithoutResources.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/Macro/ServiceMacroCreateWithoutResources.json
new file mode 100644
index 0000000000..579c924d9b
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/Macro/ServiceMacroCreateWithoutResources.json
@@ -0,0 +1,48 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b",
+ "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a",
+ "modelName": "Sample Service Model",
+ "modelVersion": "10.0"
+ },
+ "cloudConfiguration": {
+ "cloudOwner" : "my-custom-cloud-owner"
+ },
+ "owningEntity": {
+ "owningEntityId": "038d99af-0427-42c2-9d15-971b99b9b489",
+ "owningEntityName": "PACKET CORE"
+ },
+ "project": {
+ "projectName": "{some project name}"
+ },
+ "subscriberInfo": {
+ "globalSubscriberId": "{some subscriber id}"
+ },
+ "requestInfo": {
+ "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
+ "source": "VID",
+ "suppressRollback": true,
+ "requestorId": "xxxxxx",
+ "instanceName": "test"
+ },
+ "requestParameters": {
+ "subscriptionServiceType": "VMX",
+ "aLaCarte": false,
+ "userParams": [
+ {
+ "service": {
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "Sample Service Model",
+ "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a"
+ },
+ "instanceParams": [],
+ "resources": {}
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/common/pom.xml b/common/pom.xml
index 45359231d0..dd296e8504 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -11,10 +11,10 @@
<name>common</name>
<description>MSO Common classes:- Logger</description>
<properties>
- <grpc.version>1.17.1</grpc.version>
- <protobuf.version>3.6.1</protobuf.version>
+ <grpc.version>1.25.0</grpc.version>
+ <protobuf.version>3.10.0</protobuf.version>
<grpc.netty.version>4.1.30.Final</grpc.netty.version>
- <ccsdk.version>0.4.2</ccsdk.version>
+ <ccsdk.version>1.1.2</ccsdk.version>
</properties>
<dependencies>
<dependency>
@@ -163,9 +163,15 @@
</dependency>
<!-- CDS dependencies -->
<dependency>
- <groupId>org.onap.ccsdk.cds.components</groupId>
- <artifactId>proto-definition</artifactId>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
<version>${ccsdk.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-boot-starter</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- protobuf dependencies -->
<dependency>
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
index 1b0986ca0d..3d25ef1d45 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
@@ -39,4 +39,6 @@ public class AllocateTnNssi implements Serializable {
private NsiInfo nsiInfo;
private String scriptName;
+
+ private String nssiId;
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
index 3d0f70805c..be4833a0c6 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java
@@ -66,4 +66,7 @@ public class AnSliceProfile implements Serializable {
@JsonProperty(value = "resourceSharingLevel")
private ResourceSharingLevel resourceSharingLevel;
+ @JsonProperty(value = "maxNumberofPDUSession")
+ private int maxNumberOfPDUSession;
+
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
index 90cee2794a..0bd6d64dc3 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
@@ -131,6 +131,7 @@ public class SliceProfileAdapter implements Serializable {
anSliceProfile.setUeMobilityLevel(UeMobilityLevel.fromString(this.ueMobilityLevel));
anSliceProfile.setResourceSharingLevel(ResourceSharingLevel.fromString(this.resourceSharingLevel));
+ anSliceProfile.setMaxNumberOfPDUSession(this.maxNumberOfPDUSession);
anSliceProfile.setPerfReq(generatePerfReq());
return anSliceProfile;
@@ -158,6 +159,8 @@ public class SliceProfileAdapter implements Serializable {
List<PerfReqEmbb> perfReqEmbbs = new ArrayList<>();
PerfReqEmbb perfReqEmbb = new PerfReqEmbb();
BeanUtils.copyProperties(this, perfReqEmbb);
+ perfReqEmbb.setExpDataRateDL(this.expDataRateDL);
+ perfReqEmbb.setExpDataRateUL(this.expDataRateUL);
perfReqEmbbs.add(perfReqEmbb);
perfReq.setPerfReqEmbbList(perfReqEmbbs);
} else if ("ullc".equalsIgnoreCase(sST)) {
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java
index f904e1c466..50f0e3d8ce 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java
@@ -48,4 +48,7 @@ public class TnSliceProfile implements Serializable {
@JsonProperty(value = "jitter")
private int jitter;
+
+ @JsonProperty(value = "resourceSharingLevel")
+ private ResourceSharingLevel resourceSharingLevel;
}
diff --git a/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java b/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
index fa309b54fe..e40b936daa 100644
--- a/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
+++ b/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
@@ -22,7 +22,6 @@ package org.onap.so.client.cds;
import io.grpc.ManagedChannel;
import io.grpc.internal.DnsNameResolverProvider;
-import io.grpc.internal.PickFirstLoadBalancerProvider;
import io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.NettyChannelBuilder;
import java.security.KeyStore;
@@ -81,8 +80,7 @@ public class CDSProcessingClient implements AutoCloseable {
"No RestProperty.CDSProperties implementation found on classpath, can't create client.");
}
NettyChannelBuilder builder = NettyChannelBuilder.forAddress(props.getHost(), props.getPort())
- .nameResolverFactory(new DnsNameResolverProvider())
- .loadBalancerFactory(new PickFirstLoadBalancerProvider());
+ .nameResolverFactory(new DnsNameResolverProvider());
if (props.getUseSSL()) {
log.info("Configure SSL connection");
KeyStore ks = KeyStoreLoader.getKeyStore();
diff --git a/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java b/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java
index 6097f7e3fd..a0a5577402 100644
--- a/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java
+++ b/common/src/main/java/org/onap/so/client/cds/CDSProcessingHandler.java
@@ -24,8 +24,8 @@ import io.grpc.ManagedChannel;
import io.grpc.stub.StreamObserver;
import java.util.concurrent.CountDownLatch;
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceStub;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.slf4j.Logger;
@@ -50,7 +50,7 @@ class CDSProcessingHandler {
final CountDownLatch finishLatch = new CountDownLatch(1);
- final BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
+ final BlueprintProcessingServiceStub asyncStub = BlueprintProcessingServiceGrpc.newStub(channel);
final StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() {
@Override
diff --git a/common/src/main/java/org/onap/so/logger/MaskLogStatements.java b/common/src/main/java/org/onap/so/logger/MaskLogStatements.java
new file mode 100644
index 0000000000..cadadcf9f3
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logger/MaskLogStatements.java
@@ -0,0 +1,71 @@
+package org.onap.so.logger;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import ch.qos.logback.classic.PatternLayout;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+
+public class MaskLogStatements extends PatternLayout {
+
+ private String patternsProperty;
+ private String maskChar = "*";
+ private Optional<Pattern> pattern = Optional.empty();
+ private static final Pattern authPattern =
+ Pattern.compile("Authorization(?:\\:|=)\\s?(?:\"|\\[)(?:Basic|Bearer) (.*?)(?:\"|\\])");
+ private static final Pattern openstackPattern = Pattern.compile("\"password\"\\s?:\\s?\"(.*?)\"");
+
+ public String getPatternsProperty() {
+ return patternsProperty;
+ }
+
+ public void setPatternsProperty(String patternsProperty) {
+ this.patternsProperty = patternsProperty;
+ if (this.patternsProperty != null) {
+ this.pattern = Optional.of(Pattern.compile(patternsProperty, Pattern.MULTILINE));
+ }
+ }
+
+ public String getMaskChar() {
+ return maskChar;
+ }
+
+ public void setMaskChar(String maskChar) {
+ this.maskChar = maskChar;
+ }
+
+
+ protected Collection<Pattern> getPatterns() {
+ return Arrays.asList(authPattern, openstackPattern);
+ }
+
+ @Override
+ public String doLayout(ILoggingEvent event) {
+
+ final StringBuilder message = new StringBuilder(super.doLayout(event));
+ List<Pattern> patterns = new ArrayList<>(getPatterns());
+ if (pattern.isPresent()) {
+ patterns.add(pattern.get());
+ }
+ patterns.forEach(p -> {
+ Matcher matcher = p.matcher(message);
+ while (matcher.find()) {
+ int group = 1;
+ while (group <= matcher.groupCount()) {
+ if (matcher.group(group) != null) {
+ for (int i = matcher.start(group); i < matcher.end(group); i++) {
+ message.setCharAt(i, maskChar.charAt(0));
+ }
+ }
+ group++;
+ }
+ }
+ });
+ return message.toString();
+ }
+
+}
diff --git a/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java b/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java
index 5792c28f5f..b92326cc89 100644
--- a/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java
+++ b/common/src/test/java/org/onap/so/client/cds/CDSProcessingClientTest.java
@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mock;
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
@@ -72,7 +72,7 @@ public class CDSProcessingClientTest {
client = new CDSProcessingClient(InProcessChannelBuilder.forName(serverName).directExecutor().build(), handler);
- final BluePrintProcessingServiceImplBase routeChatImpl = new BluePrintProcessingServiceImplBase() {
+ final BlueprintProcessingServiceImplBase routeChatImpl = new BlueprintProcessingServiceImplBase() {
@Override
public StreamObserver<ExecutionServiceInput> process(
StreamObserver<ExecutionServiceOutput> responseObserver) {
diff --git a/common/src/test/java/org/onap/so/logging/MaskLogStatementsTest.java b/common/src/test/java/org/onap/so/logging/MaskLogStatementsTest.java
new file mode 100644
index 0000000000..ba5aeb522a
--- /dev/null
+++ b/common/src/test/java/org/onap/so/logging/MaskLogStatementsTest.java
@@ -0,0 +1,90 @@
+package org.onap.so.logging;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import org.junit.Test;
+import org.onap.so.logger.MaskLogStatements;
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.classic.spi.LoggingEvent;
+
+public class MaskLogStatementsTest {
+
+ private LoggerContext lc = new LoggerContext();
+ private Logger logger = lc.getLogger(MaskLogStatementsTest.class);
+
+ @Test
+ public void verifyOpenStackPayload() throws IOException {
+ String payload =
+ new String(Files.readAllBytes(Paths.get("src/test/resources/__files/logging/openstack-payload.json")));
+
+ ILoggingEvent event = makeLoggingEvent(payload);
+
+ MaskLogStatements mask = new MaskLogStatements();
+
+ mask.setContext(lc);
+ mask.setPattern("%m");
+ mask.start();
+ String result = mask.doLayout(event);
+
+ assertTrue(result.matches("(?s).*?\"password\"\\s?:\\s?\"\\*+\".*"));
+
+ }
+
+ @Test
+ public void maskAuthHeaderTest() {
+ String msg = "Headers : [Accept:\"application/json\", Authorization:\"Basic dklfjeaklfjdkalf\","
+ + "Content-Type:\"application/json\", Content-Length:\"10\","
+ + "X-RequestID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\", X-TransactionID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\","
+ + "X-ECOMP-RequestID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\", X-ONAP-PartnerName:\"SO.APIH\","
+ + "X-InvocationID:\"885e4f99-6f24-4f17-ab1b-584b37715b49\"]";
+
+ String expected = "Headers : [Accept:\"application/json\", Authorization:\"Basic ****************\","
+ + "Content-Type:\"application/json\", Content-Length:\"10\","
+ + "X-RequestID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\", X-TransactionID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\","
+ + "X-ECOMP-RequestID:\"db2a0462-69d0-499f-93ec-e2a064ef1f59\", X-ONAP-PartnerName:\"SO.APIH\","
+ + "X-InvocationID:\"885e4f99-6f24-4f17-ab1b-584b37715b49\"]";
+ ILoggingEvent event = makeLoggingEvent(msg);
+
+ MaskLogStatements mask = new MaskLogStatements();
+
+ mask.setContext(lc);
+ mask.setPattern("%m");
+ mask.start();
+ String result = mask.doLayout(event);
+
+ assertEquals(expected, result);
+ }
+
+ @Test
+ public void maskAuthHeaderObjectStringTest() {
+ String msg = "Headers: {Accept=[text/plain, application/json, application/*+json, */*],"
+ + "Authorization=[Basic aaaaa],"
+ + "connection=[keep-alive], Content-Length=[217], content-type=[application/xml],"
+ + "host=[mso-bpmn-infra-svc:9200], user-agent=[Java/11.0.6]}";
+ String expected = "Headers: {Accept=[text/plain, application/json, application/*+json, */*],"
+ + "Authorization=[Basic -----],"
+ + "connection=[keep-alive], Content-Length=[217], content-type=[application/xml],"
+ + "host=[mso-bpmn-infra-svc:9200], user-agent=[Java/11.0.6]}";
+ ILoggingEvent event = makeLoggingEvent(msg);
+
+ MaskLogStatements mask = new MaskLogStatements();
+
+ mask.setContext(lc);
+ mask.setPattern("%m");
+ mask.setMaskChar("-");
+ mask.start();
+ String result = mask.doLayout(event);
+
+ assertEquals(expected, result);
+ }
+
+ private ILoggingEvent makeLoggingEvent(String message) {
+ return new LoggingEvent(MaskLogStatementsTest.class.getName(), logger, Level.INFO, message, null, null);
+ }
+}
diff --git a/common/src/test/resources/__files/logging/openstack-payload.json b/common/src/test/resources/__files/logging/openstack-payload.json
new file mode 100644
index 0000000000..ac4d1639dc
--- /dev/null
+++ b/common/src/test/resources/__files/logging/openstack-payload.json
@@ -0,0 +1,26 @@
+{
+ "auth": {
+ "identity": {
+ "password": {
+ "user": {
+ "name": "j0000",
+ "domain": {
+ "name": "name"
+ },
+ "password": "my-password-wow"
+ }
+ },
+ "methods": [
+ "password"
+ ]
+ },
+ "scope": {
+ "project": {
+ "id": "ad299b37da30413391e9c28138f0b0dd",
+ "domain": {
+ "name": "name"
+ }
+ }
+ }
+ }
+}
diff --git a/docs/api/apis/serviceInstances-api.rst b/docs/api/apis/serviceInstances-api.rst
index a46af713dc..8eafe05a2e 100644
--- a/docs/api/apis/serviceInstances-api.rst
+++ b/docs/api/apis/serviceInstances-api.rst
@@ -43,6 +43,14 @@ Create service instance
|Content-Type |application/json |
+--------------------+--------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -238,6 +246,14 @@ Delete service instance
|Content-Type |application/json |
+--------------------+--------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -294,6 +310,14 @@ Create Volume Group
|Content-Type |application/json |
+--------------------+------------------------------------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -427,6 +451,14 @@ Delete Volume Group
|Content-Type |application/json |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -490,6 +522,14 @@ Create VF Module
|Content-Type |application/json |
+--------------------+---------------------------------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -587,6 +627,14 @@ Delete VF Module
|Content-Type |application/json |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -659,6 +707,14 @@ Create VNF
|Content-Type |application/json |
+--------------------+-------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -808,6 +864,14 @@ Delete VNF
|Content-Type |application/json |
+--------------------+-----------------------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Request Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -891,6 +955,14 @@ GET Orchestration Request
|Content-Type |application/json |
+--------------------+-------------------------------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
Response Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
@@ -1045,6 +1117,37 @@ GET Orchestration Requests
|Content-Type |application/json |
+--------------------+--------------------------------------------------------------+
+Request Headers:
+
++-------------------+---------+-----------------------------------------------------------------------------------------+
+|Header Name |Required |Description |
++===================+=========+=========================================================================================+
+|Authorization |Y |Base64 encoded username:password |
++-------------------+---------+-----------------------------------------------------------------------------------------+
+
+Query Parameters:
+
++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+
+|Attribute |Required |Cardinality|Content|Description |
++===================+=========+===========+=======+=====================================================================================================+
+|filter |Y |1 |String | Orchestration filter (scheme KeyTypes:Option:Value) |
+| | | | | |
+| | | | | KeyTypes: |
+| | | | | serviceInstanceId, serviceInstanceName, vnfInstanceId, pnfName, vnfInstanceName, |
+| | | | | vfModuleInstanceId, vfModuleInstanceName, volumeGroupInstanceId, volumeGroupInstanceName, |
+| | | | | networkInstanceId, networkInstanceName, configurationInstanceId, configurationInstanceName, |
+| | | | | lcpCloudRegionId, tenantId, modelType, requestorId, requestExecutionDate, startTime, requestScope |
+| | | | | |
+| | | | | Option: |
+| | | | | EQUALS (or any not null string), DOES_NOT_EQUAL [e.g. modelType:EQUALS:VNF, modelType:qwe:VNF] |
+| | | | | for KeyTypes equals startTime or requestExecutionDate: DOES_NOT_EQUAL, BETWEEN_DATES |
+| | | | | [e.g. startTime:BETWEEN_DATES:30-5-2000:30-5-2030] |
++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+
+|includeCloudRequest|N |1 |Boolean| Enable or disable cloud data request |
++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+
+|format |N |1 |String | Orchestration request format [DETAIL, STATUSDETAIL, SIMPLE, SIMPLENOTASKINFO] |
++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+
+
Response Body:
+----------------+---------+-----------+--------------------------+-------------------------------------------+
diff --git a/docs/developer_info/BBUnderstanding.rst b/docs/developer_info/BBUnderstanding.rst
index 6e96e5dca2..a4984d3b03 100644
--- a/docs/developer_info/BBUnderstanding.rst
+++ b/docs/developer_info/BBUnderstanding.rst
@@ -1,447 +1,686 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2018 Huawei Technologies Co., Ltd.
-
-Building Block Understanding
-============================
-
-UNDERSTANDING BUILDING BLOCKS USING MACRO FLOW
-----------------------------------------------
-
-
-
-There are basically 2 flows - macro , a la carte.
-
-In a la carte we manually will initiate each step for a process.
-
-In macro , the whole flow happens at a single click - like if we want to create a service, the flow will itself look whether there are vnfs, pnfs or networks in the service and it will be created and activated in the flow also.
-
-Thus these independent tasks like if vnf is present, then assign create and activate vnf are all taken up as individual building blocks and are only called on need basis.
-
-
-Each and every request will reach to the api handler first.
-
-API HANDLER( ServiceInstances.java )
-------------------------------------
-
-
-
-# 1. Rest call reaching SO Api handler with the input json - According to the below path it is mapped to the createServiceInstance function in ServiceInstances file.
-
-curl -v -H "Content-Type: application/json" -X POST --data @serviceinstance.json -u mso_admin:password1$ http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances.
-
-# 2. Herein a unique requestid is generated corresponding to every request, and is checked whether that particular requestid exists in request db (Happens in createServiceInstance in ServiceInstances).
-
- a. http://request-db-adapter:8083/infraActiveRequests/requestid (GET), which will return a 404 if not exists.
-
- b. CreateInstance is set to the action variable. Here the request scope is set to service from the inputjson - modelType.
-
-# 3. Running local validations on input json.
-
-# 4. create InfraActiveRequests, to store request details in request db adapter and as a payload to bpmn.
-
- a. A new InfraActiveRequests object is created. And all the necessary information from the input is set to it.
-
- b. Retrieving productFamilyName from the input json to put into requests db. http://aai/servicedesigncreation/services/service/{productfamilyid} (GET), which will return a 404 if not exists in aai. If service exists, then that service's serviceDescritiption is set as productfamilyName.
-
- c. http://aai/cloudinfrastructure/cloudregions/cloudregion/cloudowner/{lcpCloudRegionId}/tenants/tenant/{tenantId} (GET), checks for whether the particular cloud configuration exists in aai, if not exists returns 404. If we are able to get, then the tenant's name derived from aai is set as tenantName.
-
- d. serviceInstanceNamee is derived from requestInfo.instanceName and is set.
-
- e. Request json is also set as RequestBody of InfraActiveRequests.
-
-# 5. Checks fro whether duplicate name exists.
-
- a. version v[integer] is converted to the particular integer and stored.
-
- b. Checks whether instance name already exists in with a POST request in http://request-db-adapter:8083/infraActiveRequests/checkInstanceNameDuplicate, with the data { instanceIdmap = null, instanceName = {instanceName} , instanceservice = service } . It checks for the current progress and if in progress it throws the particular status.
-
-# 6. Gets the orchestration url from the recipe table.
-
- a. Checks whether the service already exists in catalogdb http://catalog-db-adapter:8082/service/{modelNameVersionId} (GET).
-
- b. Checks the service recipe table with the modelNameVersionId and the action to be performed http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID={modelNameVersionId}&action=createInstance . Returns a 404 if no recipe exists with the corresponding id.
-
- c. As recipe corresponding to this doesn't exist, we try to get with a default value. This flow comes under generic resource flow so the default value is GR-API-DEFAULT. First we get service with this value http://catalog-db-adapter:8082/service/search/findFirstByModelNameOrderByModelVersionDesc?modelName=GR-API-DEFAULT (GET). It returns a service with modelUUID as d88da85c-d9e8-4f73-b837-3a72a431622b, and further can be used to get the recipe.
-
- d. http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID=d88da85c-d9e8-4f73-b837-3a72a431622b&action=createInstance (GET), gives a recipe which has a parameter "orchestrationUri" as "/mso/async/services/WorkflowActionBB".
-
-# 7. Updates the infraActiveRequests with the current request.
- a. http://request-db-adapter:8083/infraActiveRequests/ (POST) with the data formed. And a 201 created response is received.
-
-# 8. Call the bpmn with a post call on orchestrationUri. The data to bpmn is prepared having parameters like
- a. bpmnRequest - formed from input request.
-
- b. vfModuleId, pnfCorrelationId, networkId, configurationId, vfModuleType, serviceInstanceId , serviceType are updated if present in the input json or else set to empty string.
-
- c. apiVersion , requestId, aLaCarte = false (def), recipeTimeout = 180(def), requestAction= createInstance are all updated accordingly.
-
- d. requestUri - v7/serviceInstances ,which is formed from the request url.
-
-
-# 9. A sync response is obtained on reaching bpmn like {"requestReferences":{"requestId":"c45702f7-3f08-4081-bc98-2f9f18b81607","instanceId":"cadca18f-9bff-44be-8910-ad29d342e91f","requestSelfLink":"http://159.138.57.166:30277/orchestrationRequests/v7/c45702f7-3f08-4081-bc98-2f9f18b81607"}}.
-
-
-
-
-
-
-BPMN
------
-
-
-Hits WorkflowActionBB.bpmn
---------------------------
-
-.. image:: ../images/workflow.png
-
-
-# 1. RetrieveBBExecutionList - implemented in selectExecutionList in WorkflowAction.java
-
-a. resourcetype, resourceid are formed from matching the requestUri to a regex pattern matcher [pattern=[vV]\d+.*?(?:(?:/(?<type>vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups)(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?(?:/resume)?)] .
-
-b. Checks whether there is a service subscription with service instance name as {instanceName} correspoding to the customer in aai https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances?depth=2&resultIndex=0&resultSize=1&service-instance-name={instanceName}. Returns 404 not found, if it doesnt exists then the id of that particular instance is taken and given as both the resourceid and serviceinstance id. If not present then a random value is generated, and is assigned same to both.
-
-c. Checks whether there is a service of the particular serviceInstanceId exists in aai. https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{serviceInstanceId} , returns not found if it doesnt exist. If service with corresponding instance name already exists , then flowsToExecute is got by quering the requestdbadapter with the earlier request id. If not present, then only orchestrationflows are got, and later from that the flowsToExecute are found out.
-
-d. Get the particular service from catalogdb . http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId} (GET). Be sure that the service with this particular modelNameVersionId exists in catalogdb, because based on the services (like whether pnf, or vnf, or networkcollection) present in that particular service, which all bbs to execute are decided.
-
-e. This being a service, "service" is added to the resource list. And is checked upon for other resources like vnf and network, eg:
-
- http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/vnfCustomizations (GET)
- http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/collectionResourceCustomizations (GET)
- http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/networkCustomizations (GET)
- And depending on the reources in the service, the resources found is updated like
- Found :Service - 1 Vnf - 0 Pnf - 0 VfModule - 0 VolumeGroup - 0 Network - 0 VirtualLink - 0 NetworkCollection - 0 Configuration - 0 InstanceGroup - 0
-
-f. Then the orchestration flows are get from the orchestration_flow_table depending on the cloudowner and request scope: http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner={CloudOwner}&serviceType=%2A (GET) Here if present, then the orchestration flows are returned or else with default cloud owner, we try again
-
-http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType?action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner=DEFAULT&serviceType=%2A (GET)
-Here in northBoundRequest is returned which has the parameter orchestrationFlowList, that contains the link that will return the orchestration flows.
-
-"orchestrationFlowList" : { "href" : "http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList"}
-
-Now we do a get on the orchestration flow link to get the set of orchestartion flows required
-http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList.
-Here a set of 20 orchestration flows are returned under the action of Service-Macro-Create, each with a sequence no assigned sequentially in the given order
-AssignServiceInstanceBB,
-
-CreateNetworkCollectionBB,
-
-AssignNetworkBB,
-
-AssignVnfBB,
-
-AssignVolumeGroupBB,
-
-AssignVfModuleBB,
-
-ConfigAssignVnfBB,
-
-AssignPnfBB,
-
-WaitForPnfReadyBB,
-
-ActivatePnfBB,
-
-CreateNetworkBB,
-
-ActivateNetworkBB,
-
-CreateVolumeGroupBB,
-
-ActivateVolumeGroupBB,
-
-CreateVfModuleBB,
-
-ActivateVfModuleBB,
-
-ConfigDeployVnfBB,
-
-ActivateVnfBB,
-
-ActivateNetworkCollectionBB,
-
-ActivateServiceInstanceBB.
-
-
-.. image:: ../images/flowchart.png
-
-
-g. Flows to execute is determined by iterating through all the orchestartion flows and matching it with the found resources. It is merely a contains matching. In this particular as service was the only resource : List of BuildingBlocks to execute:AssignServiceInstanceBB, ActivateServiceInstanceBB.
-
-h. processing data is added to the requestdbadapter. Here the data is post to the requestdb as two different building blocks http://so-request-db-adapter.onap:8083/requestProcessingData.
-
-i. The already stored request details in request db is ammended like "lastModifiedBy" : "CamundaBPMN" , and status to in_progress with a put request.
-
-
-# 2. sendSyncAck - This was used to give an acknowledgement , with status code as 200, and requestId and resourceId is sent as content.
-
-
-# 3. Prevalidate the workflow
-
-
-# 4. SelectBB - implemented in selectBBin WorkflowActionBBTasks
-This is used to select the building block from the flows to execute depending on the sequence order.
-
- a. Depending on the current sequence , the building block is selected from the flows to execute.
-
- b. Execution variable, that is passed between the different building blocks as the payload is ammended as:
-
- execution.setVariable("buildingBlock", buildingblockselected).
-
- c. current sequence is incremented by 1, and updated in execution variable.
-
- d. Depending on whether currentSequence is greater than flowsToExecute.size(), COMPLETED variable is either set to true or false.
-
-
-# 5. updateFlowStatistics - implemented in updateFlowStatistics in WorkflowActionBBTasks
-a. Depending on the current sequence no, the completed bb and next bb is got from the flows to execute. And these are mentioned in a statusMessage.
-b. Percentage progress is got from the total no of bbs
-c. These are ammended to the already present request in the request db
-
-# 6. Execute BB - calls the ExecuteBuildingBlock.bpmn
-
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-Hits ExecuteBuildingBlock.bpmn
-------------------------------
-
-.. image:: ../images/ExecuteBuildingBlock.png
-
-# 1. BBInputSetup - implemented in execute in BBInputSetup
-Here a generalbuildingblock is formed from executingbuildingblock after certain updations and validations.
-
- a. lookupKeyMap is formed from the input , and a map is formed with serviceInstanceId, networkID, vnfID, pnfID, vfmoduleID, volumegroupID, configurationID, instancegroupID as the keys.
-
- b. Depending on whether a la carte or macro , different flows are called. getGBBMacro is called in here.
-
- c. In getGBBMacro , a valid customer is got with service subscription.(getCustomerAndServiceSubscription)
-
- First a customer is got by get request on https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}
-
- After that ServiceSubscription is got by doing a get request
- https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}/service-subscriptions/service-subscription/service
-
- If, the above request doesnt give any , then ServiceSubscription is fetched by first creating uri keys
- https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{resourceId}?format=pathed.
- Then ServiceSubscription is got from the globalSubscriberId and the uri keys
-
-'Note': a valid customer and a corresponding ServiceSubscription must be present in the aai, for setting up the customer to gbuildingblock
-
- d. project and owningEntity is updated from the input
-
- e. service is got from the catalog db either by ModelVersionId or by ModelVersion and ModelInvariantId.
-
- f. ServiceInstance is created from the above parameters, and this ServiceInstance is used in the preparation of general building block.
-
- g. Depending on whether the current executing block name contains either of the network, or configuration, or network collection. A new instance of the corresponding type is created and is updated to the general building block (Happens in getGBBMacroNoUserParamsCreate)
-
- h. This general building block is set to the gBuildingBlockExecution and gBBInput parameter of execution.
-
-
-# 2. StatusPolicy - implemented in validateOrchestrationStatus in OrchestrationStatusValidator. Input being gBuildingBlockExecution
- a. orchestrationStatus is obtained after checking the resource type. We had updated the orchestrationStatus in the above step when a new service instance was created.
- b. OrchestrationStatusStateTransitionDirective is got by doing a get call to the catlog db with the url as findOneByResourceTypeAndOrchestrationStatusAndTargetAction
-http://so-catalog-db-adapter.onap:8082/orchestrationStatusStateTransitionDirective/search/findOneByResourceTypeAndOrchestrationStatusAndTargetAction?resourceType=SERVICE&orchestrationStatus=PRECREATED&targetAction=ASSIGN
- c. orchestrationStatusValidationResult parameter is set to execution variable from the OrchestrationStatusStateTransitionDirective.getFlowDirective() "flowDirective" : "CONTINUE"
-
-# 3. Prevalidate the gBuildingBlockExecution
-
-# 4. BB To Execute: Depending on which building block is to be executed, that particular bpmn is called .In this case, AssignServiceInstanceBB is called
-
--------------------------------------------------------------------------------------------------------------------------
-
-Hits AssignServiceInstanceBB.bpmn
----------------------------------
-
-.. image:: ../images/AssignServiceInstanceBB.png
-
-# 1. AAI create service subscription - implemented in createServiceSubscription of createAAITasks
-This method is used for creating and subscribing the service in A&AI
-
- a. Customer is got from the general building block that was updated above
-
- b. Here a serviceSubscriptionURI is formed by taking in the globalSubscriberId and the serviceType
-
- c. If a service subscription for the particular customer doesnt exist in AAI, then a new subscription is created by taking in the serviceSubscriptionURI
-
-GET performed on uri:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service?
-{"results":[{"service-subscription":1}]}
-
-# 2. AAI create service instance - implemented in createServiceInstance of createAAITasks
-This method is used for creating the service instance in A&AI
-
- a. Customer is got from the general building block that was updated above
-
- b. A serviceInstanceURI is formed by taking in the globalSubscriberId, the serviceType and the service instance id
-
- c. If the service instance in the particular path doesnt exist in AAI , then a new service instance is created by using the serviceInstanceURI
-
-GET to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84?
-response: {"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","Node Not Found:No Node of type service-instance found at: business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","ERR.5.4.6114"]}}}
-
-Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84
-with req body : {"service-instance-id":"2b955def-e536-40ee-84cb-3f06e3cc6d84","service-instance-name":"DEMO_123456","model-invariant-id":"944862ae-bb65-4429-8330-a6c9170d6672","model-version-id":"d88da85c-d9e8-4f73-b837-3a72a431622b","orchestration-status":"Inventoried"}
-
-# 3. AAI create project - implemented in createProject of createAAITasks
-This method is used for creation of the project A&AI. Here too it checks whether a project with a {projectName} exist in AAI . If not it creates one, and connects it to the service instance identified by the serviceInstanceId
-Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/projects/project/name%20of%20proj/relationship-list/relationship
-with req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
-
-# 4. AAI create owning entity - implemented in createOwningEntity of createAAITasks
-
- a. OwningEntityId and OwningEntityName is extracted from the OwningEntity given in the input json
-
- b. If both of them are null, then an exception is raised.
-
- c. If only OwningEntityId is null, then whether the OwningEntityName is present in AAI is checked. If present then OwningEntityId is set by quering the OwningEntity from AAI. And then connect it to the service instance. If not present in the aai then a random id is generated and assigned to OwningEntityId. Then Owning entity is first created and then connected to the service instance
-
- d. Depending on whether the owning entity is already present or not, either createOwningEntityandConnectServiceInstance is called, or connectOwningEntityandServiceInstanceis called.
-
-Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/owning-entities/owning-entity/owningEntityIdof%20owningEntity/relationship-list/relationship
-req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
-
-# 5. SDNC Create Assign Request - implemented in assignServiceInstance of SDNCAssignTasks
-
- a. Here first the requestContext, serviceInstance, customer are obtained from the general building block
-
- b. Then a payload for the assignServiceInstance of the sdnc is formed by passing in the above parameters to the assignServiceInstance in sdncSIResources.
-
- c. A new sdnc request is formed with the above thing as payload
-
- d. This sdnc request is assigned to the SDNCRequest parameter of the execution variable
-
-.. code-block:: bash
-
- {"input":{
- "request-information" : {
- "request-action" : "CreateServiceInstance",
- "source" : "MSO",
- "request-id" : "139636cd-4b69-4c3a-9e67-fed2c283baee"
-
- },
- "sdnc-request-header" : {
-
- "svc-request-id" : "9bfe8cb0-bb8b-4dca-949d-2f2b51011b54",
- "svc-action" : "assign"
-
- },
- "service-information" : {
-
- "onap-model-information" : {
- "model-name" : "GR-API-DEFAULT",
- "model-version" : "1.0",
- "model-uuid" : "d88da85c-d9e8-4f73-b837-3a72a431622b",
- "model-invariant-uuid" : "944862ae-bb65-4429-8330-a6c9170d6672"
-
- },
- "subscription-service-type" : "service",
- "service-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84",
- "global-customer-id" : {global_customerid},
- "service-instance-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84"
-
- },
- "service-request-input" : {
-
- "service-input-parameters" : {
- "param" : [ {
- "name" : "some name",
- "value" : "some value"
-
- } ]
-
- },
- "service-instance-name" : {instance_name}
- }
- }}
-
-# 6. It calls another bpmn file - SDNCHandler.bpmn
-
- a. Setup callback variables - Here mainly the correlator variable and the sdnc timeout variable is set
-
- b. callSDNC - Here post call to sdnc client is done with the above prepared payload. And then isSDNCCompleted is set to the execution variable
-
-Both the above tasks are implemented in SDNCRequestTasks.
-http://sdnc-oam.onap:8282/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation/
-
-# 7. AAI Update (svc instance)- implemented in th updateOrchestrationStatusAssignedService in AAIUpdateTasks
- BPMN access method to update the status of Service to Assigned in AAI.
- Here serviceInstance is obtained , then its orchestration status is changed to assigned and is updated in the AAI
-
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-Reaches back to ExecuteBuildingBlock.bpmn
-
-# 5. Post validate the generic building block
-
-# 6. Set Handling Code To Success - implemented in setHandlingStatusSuccess in ExecuteBuildingBlockRainyDay
-handling code is set to success for the execution variable
-
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-Reaches back to WorkflowActionBB.bpmn
-
-# 7. postProcessingExecuteBB
-If the building block excuted is ActivateVfModuleBB, then a postProcessingExecuteBBActivateVfModule needs to be executed
-
-Then again it is looped back to selectBB through a checkRetryStatus block.
-This block comes into play only if the handlingCode is retry, and the retry count is lesser than the maximum allowed no of retries, then the current sequence is again reduced by 1 , so that the same block is executed again.Request in the requestdb is updated with a setRetryStatusMessage, keeping an eye on the no of retries executed.
-
-
-And in this particular example ActivateServiceInstanceBB.bpmn is called next in the sequence.
-Here updateOrchestrationStatusActiveService is called, which is BPMN access method to update status of Service to Active in AAI. Here orchestrationStatus is set to active for the particular service instance and is updated in the AAI .
-
-# 8. updateRequestStatusToComplete is called if the "complete" flag is true
- a. Here first the request is got from the requestDbclient http://request-db-adapter:8083/infraActiveRequests/requestid
-
- b. Then a status message is formed as "Macro-" + resourceName + "-" + action + " request was executed correctly."
-
- This status message is updated in the request as well as is set to finalStatusMessage of the execution variable
-
- c. Other request parameters are updated
-
- request.setEndTime(endTime);
-
- request.setFlowStatus("Successfully completed all Building Blocks");
-
- request.setProgress(Long.valueOf(100));
-
- request.setRequestStatus("COMPLETE");
-
- request.setLastModifiedBy("CamundaBPMN");
-
- d. This new request parameters are updated by a put request to the requestDbclient
-
-
-
-
-Flow ends
-----------
-
-If there are other resources present along with the service : Eg :- Volumegroup.( These BBs wil be specifically called )
-
-1) AssignVolumeGroupBB :
-
- a. genericvnfid and volumegroupid is obtained from the execution block.
- b. volumegroup orchestrationstatus is set to assigned
- c. a volume group of the above details is created in aai
- d. connect volumegroup to this genericvnf
- e. cloud configuration is got, and then the volumegroup is linked to tenant
-
-
-
-2) createVolumeGroupBB :
-
- a. get the vf details according to Vf module id from sdnc.
- b. vfmodulequeriedfromsdnc is set to the executionvariable.
- c. createVolumeGroupRequest is formed with getCloudRegion, serviceinstance, genericVnf, volumegroup, sdncVfModuleQueryResponse.
- d. calls vnfadapter, which in turn calls openstackadaptertask.
- e. update heattask in the volumegroup and which is ammended in the aai.
- f. orchestrationstatus for the volume group is set to created.
-
-
-3) ActivateVolumeGroupBB :
-
- orchestrationstatus for the volume group is ammended to active.
-
+.. This work is licensed under a Creative Commons Attribution 4.0 License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2018 Huawei Technologies Co., Ltd.
+
+Building Block Understanding
+============================
+
+UNDERSTANDING BUILDING BLOCKS USING MACRO FLOW
+----------------------------------------------
+There are basically 2 flows - macro , a la carte.
+
+**In a la carte:**
+
+ We manually will initiate each step for a process.
+
+**In macro:**
+
+ The whole flow happens at a single click like if we want to create a service.
+ The flow will itself look whether there are vnfs, pnfs or networks in the
+ service and it will be created and activated in the flow also.Thus these
+ independent tasks like if vnf is present, then assign create and activate vnf
+ are all taken up as individual building blocks and are only called on need
+ basis.
+ Each and every request will reach to the api handler first.
+
+API HANDLER( ServiceInstances.java )
+------------------------------------
+
+
+
+# 1. Rest call reaching SO Api handler with the input json
+
+ According to the below path it is mapped to the createServiceInstance
+ function in ServiceInstances file.
+
+ .. code-block:: bash
+
+ curl -v -H "Content-Type: application/json" -X POST --data @serviceinstance.json -u mso_admin:password1$ http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances.
+
+# 2. Herein a unique requestid is generated corresponding to every request, and
+is checked whether that particular requestid exists in request db (Happens in
+createServiceInstance in ServiceInstances).
+
+ a. **http://request-db-adapter:8083/infraActiveRequests/requestid** (GET), which will return a 404 if not exists.
+
+ b. CreateInstance is set to the action variable. Here the request scope is
+ set to service from the inputjson - modelType.
+
+
+# 3. Running local validations on input json.
+
+# 4. create InfraActiveRequests, to store request details in request db adapter
+and as a payload to bpmn.
+
+ a) A new InfraActiveRequests object is created. And all the necessary
+ information from the input is set to it.
+
+ b) Retrieving productFamilyName from the input json to put into requests db. **http://aai/servicedesigncreation/services/service/{productfamilyid}** (GET), which will return a 404 if not exists in aai. If service exists, then that service's serviceDescritiption is set as productfamilyName.
+
+ c) **http://aai/cloudinfrastructure/cloudregions/cloudregion/cloudowner/{lcpCloudRegionId}/tenants/tenant/{tenantId}** (GET), checks for whether the particular cloud configuration exists in aai, if not exists returns 404. If we are able to get, then the tenant's name derived from aai is set as tenantName.
+
+ d) serviceInstanceName is derived from requestInfo.instanceName and is set.
+
+ e) Request json is also set as RequestBody of InfraActiveRequests.
+
+# 5. Checks fro whether duplicate name exists.
+
+ a. version v[integer] is converted to the particular integer and stored.
+
+ b. Checks whether instance name already exists in with a POST request in **http://request-db-adapter:8083/infraActiveRequests/checkInstanceNameDuplicate**, with the data { instanceIdmap = null, instanceName = {instanceName} , instanceservice = service } . It checks for the current progress and if in progress it throws the particular status.
+
+# 6. Gets the orchestration url from the recipe table.
+
+ a. Checks whether the service already exists in catalogdb **http://catalog-db-adapter:8082/service/{modelNameVersionId}** (GET).
+
+ b. Checks the service recipe table with the modelNameVersionId and the action to be performed **http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID={modelNameVersionId}&action=createInstance** . Returns a 404 if no recipe exists with the corresponding id.
+
+ c. As recipe corresponding to this doesn't exist, we try to get with a default value. This flow comes under generic resource flow so the default value is GR-API-DEFAULT. First we get service with this value **http://catalog-db-adapter:8082/service/search/findFirstByModelNameOrderByModelVersionDesc?modelName=GR-API-DEFAULT** (GET). It returns a service with modelUUID as d88da85c-d9e8-4f73-b837-3a72a431622b, and further can be used to get the recipe.
+
+ d. **http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID=d88da85c-d9e8-4f73-b837-3a72a431622b&action=createInstance** (GET), gives a recipe which has a parameter "orchestrationUri" as "/mso/async/services/WorkflowActionBB".
+
+# 7. Updates the infraActiveRequests with the current request.
+
+ a) **http://request-db-adapter:8083/infraActiveRequests/** (POST) with the data formed. And a 201 created response is received.
+
+# 8. Call the bpmn with a post call on orchestrationUri. The data to bpmn is
+prepared having parameters like
+
+ a) bpmnRequest - formed from input request.
+
+ b) vfModuleId, pnfCorrelationId, networkId, configurationId, vfModuleType,
+ serviceInstanceId , serviceType are updated if present in the input json
+ or else set to empty string.
+
+ c) apiVersion , requestId, aLaCarte = false (def), recipeTimeout = 180(def)
+ ,requestAction= createInstance are all updated accordingly.
+
+ d) requestUri - v7/serviceInstances ,which is formed from the request url.
+
+# 9. A sync response is obtained on reaching bpmn like
+
+ {"requestReferences":{"requestId":"c45702f7-3f08-4081-bc98-2f9f18b81607","instanceId":"cadca18f-9bff-44be-8910-ad29d342e91f","requestSelfLink":**"http://159.138.57.166:30277/orchestrationRequests/v7/c45702f7-3f08-4081-bc98-2f9f18b81607"**}}.
+
+
+# 10. Calls the WorkflowActionBB.bpmn
+
+BPMN
+----
+
+Hits WorkflowActionBB.bpmn
+--------------------------
+
+.. image:: ../images/workflow.png
+
+
+# 10.1. RetrieveBBExecutionList - implemented in selectExecutionList in
+WorkflowAction.java
+
+ a. resourcetype, resourceid are formed from matching the requestUri to a
+ regex pattern matcher
+
+ .. code-block:: bash
+
+ [pattern=[vV]\d+.*?(?:(?:/(?<type>vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups)(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?(?:/resume)?)] .
+
+ b. Checks whether there is a service subscription with service instance name as {instanceName} correspoding to the customer in aai
+
+ .. code-block:: bash
+
+ https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances?depth=2&resultIndex=0&resultSize=1&service-instance-name={instanceName}.
+
+ Returns 404 not found, if it doesnt exists then the id of that particular instance is taken and given as both the resourceid and serviceinstance id. If not present then a random value is generated, and is assigned same to both.
+
+ c. Checks whether there is a service of the particular serviceInstanceId exists in aai. **https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{serviceInstanceId}** , returns not found if it doesnt exist. If service with corresponding instance name already exists , then flowsToExecute is got by quering the requestdbadapter with the earlier request id. If not present, then only orchestrationflows are got, and later from that the flowsToExecute are found out.
+
+ d. Get the particular service from catalogdb . **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}** (GET). Be sure that the service with this particular modelNameVersionId exists in catalogdb, because based on the services (like whether pnf, or vnf, or networkcollection) present in that particular service, which all bbs to execute are decided.
+
+ e. This being a service, "service" is added to the resource list. And is checked upon for other resources like vnf and network, eg:
+
+ **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/vnfCustomizations** (GET)
+
+ **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/collectionResourceCustomizations** (GET)
+
+ **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/networkCustomizations** (GET)
+
+ And depending on the resources in the service, the resources found is updated like
+
+ Found :Service - 1 Vnf - 0 Pnf - 0 VfModule - 0 VolumeGroup - 0 Network - 0 VirtualLink - 0 NetworkCollection - 0 Configuration - 0 InstanceGroup - 0
+
+ f. Then the orchestration flows are get from the orchestration_flow_table depending on the cloudowner and request scope:
+
+ **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType?action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner={CloudOwner}&serviceType=%2A** (GET)
+
+ Here if present, then the orchestration flows are returned or else with default cloud owner, we try again
+
+ **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType?action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner=DEFAULT&serviceType=%2A** (GET)
+
+ Here in northBoundRequest is returned which has the parameter orchestrationFlowList, that contains the link that will return the orchestration flows.
+
+ "orchestrationFlowList" : { "href" : "**http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList**"}
+
+ Now we do a get on the orchestration flow link to get the set of orchestration flows required
+
+ **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList**.
+
+ Here a set of 20 orchestration flows are returned under the action of Service-Macro-Create, each with a sequence no assigned sequentially in the given order
+
+ * AssignServiceInstanceBB,
+ * CreateNetworkCollectionBB,
+ * AssignNetworkBB,
+ * AssignVnfBB,
+ * AssignVolumeGroupBB,
+ * AssignVfModuleBB,
+ * ConfigAssignVnfBB,
+ * AssignPnfBB,
+ * WaitForPnfReadyBB,
+ * ActivatePnfBB,
+ * CreateNetworkBB,
+ * ActivateNetworkBB,
+ * CreateVolumeGroupBB,
+ * ActivateVolumeGroupBB,
+ * CreateVfModuleBB,
+ * ActivateVfModuleBB,
+ * ConfigDeployVnfBB,
+ * ActivateVnfBB,
+ * ActivateNetworkCollectionBB,
+ * ActivateServiceInstanceBB.
+
+
+ .. image:: ../images/flowchart.png
+
+
+ g. Flows to execute is determined by iterating through all the orchestartion flows and matching it with the found resources. It is merely a contains matching. In this particular as service was the only resource : List of BuildingBlocks to execute:AssignServiceInstanceBB, ActivateServiceInstanceBB.
+
+ h. processing data is added to the requestdbadapter. Here the data is post to the requestdb as two different building blocks **http://so-request-db-adapter.onap:8083/requestProcessingData**.
+
+ i. The already stored request details in request db is ammended like "lastModifiedBy" : "CamundaBPMN" , and status to in_progress with a put request.
+
+
+# 10.2. sendSyncAck - This was used to give an acknowledgement , with status
+code as 200, and requestId and resourceId is sent as content.
+
+
+# 10.3. Prevalidate the workflow
+
+
+# 10.4. SelectBB - implemented in selectBBin WorkflowActionBBTasks
+
+ This is used to select the building block from the flows to execute
+ depending on the sequence order.
+
+ a. Depending on the current sequence , the building block is selected from
+ the flows to execute.
+
+ b. Execution variable, that is passed between the different building
+ blocks as the payload is amended as:
+ execution.setVariable("buildingBlock", buildingblockselected).
+
+ c. current sequence is incremented by 1, and updated in execution
+ variable.
+
+ d. Depending on whether currentSequence is greater than
+ flowsToExecute.size(), COMPLETED variable is either set to true
+ or false.
+
+# 10.5. updateFlowStatistics - implemented in updateFlowStatistics in
+WorkflowActionBBTasks
+
+ a. Depending on the current sequence no, the completed bb and next bb is
+ got from the flows to execute. And these are mentioned in a
+ statusMessage.
+
+ b. Percentage progress is got from the total no of bbs
+
+ c. These are ammended to the already present request in the request db
+
+
+# 10.6. Execute BB - calls the ExecuteBuildingBlock.bpmn
+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+Hits ExecuteBuildingBlock.bpmn
+------------------------------
+
+.. image:: ../images/ExecuteBuildingBlock.png
+
+# 10.6.1. BBInputSetup - implemented in execute in BBInputSetup
+
+ Here a generalbuildingblock is formed from executingbuildingblock after
+ certain updations and validations.
+
+ a. lookupKeyMap is formed from the input , and a map is formed with
+ serviceInstanceId, networkID, vnfID, pnfID, vfmoduleID, volumegroupID,
+ configurationID, instancegroupID as the keys.
+
+ b. Depending on whether a la carte or macro , different flows are called.
+ getGBBMacro is called in here.
+
+ c. In getGBBMacro , a valid customer is got with service subscription.
+ (getCustomerAndServiceSubscription)
+
+ First a customer is got by get request on **https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}**
+
+ After that ServiceSubscription is got by doing a get request
+
+ **https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}/service-subscriptions/service-subscription/service**
+
+ If, the above request doesnt give any , then ServiceSubscription is
+ fetched by first creating uri keys
+
+ **https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{resourceId}?format=pathed**.
+
+ Then ServiceSubscription is got from the globalSubscriberId and the
+ uri keys
+
+ .. note:: a valid customer and a corresponding ServiceSubscription must
+ be present in the aai, for setting up the customer to gbuildingblock
+
+ d. project and owningEntity is updated from the input
+
+ e. service is got from the catalog db either by ModelVersionId or by ModelVersion and ModelInvariantId.
+
+ f. ServiceInstance is created from the above parameters, and this ServiceInstance is used in the preparation of general building block.
+
+ g. Depending on whether the current executing block name contains either of the network, or configuration, or network collection. A new instance of the corresponding type is created and is updated to the general building block (Happens in getGBBMacroNoUserParamsCreate)
+
+ h. This general building block is set to the gBuildingBlockExecution and gBBInput parameter of execution.
+
+
+# 10.6.2. StatusPolicy - implemented in validateOrchestrationStatus in
+OrchestrationStatusValidator. Input being gBuildingBlockExecution
+
+ a. orchestrationStatus is obtained after checking the resource type. We
+ had updated the orchestrationStatus in the above step when a new
+ service instance was created.
+
+ b. OrchestrationStatusStateTransitionDirective is got by doing a get call
+ to the catlog db with the url as
+ findOneByResourceTypeAndOrchestrationStatusAndTargetAction
+
+ **http://so-catalog-db-adapter.onap:8082/orchestrationStatusStateTransitionDirective/search/findOneByResourceTypeAndOrchestrationStatusAndTargetAction?resourceType=SERVICE&orchestrationStatus=PRECREATED&targetAction=ASSIGN**
+
+ c. orchestrationStatusValidationResult parameter is set to
+ executionvariable from the
+ OrchestrationStatusStateTransitionDirective.getFlowDirective()
+ "flowDirective" : "CONTINUE"
+
+# 10.6.3. Prevalidate the gBuildingBlockExecution
+
+# 10.6.4. BB To Execute: Depending on which building block is to be executed,
+that particular bpmn is called .In this case, AssignServiceInstanceBB is called
+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+.. topic:: Hits AssignServiceInstanceBB.bpmn
+
+ .. image:: ../images/AssignServiceInstanceBB.png
+
+# 10.6.4.1. AAI create service subscription - implemented in
+createServiceSubscription of createAAITasks
+
+ This method is used for creating and subscribing the service in A&AI
+
+ a. Customer is got from the general building block that was updated above
+
+ b. Here a serviceSubscriptionURI is formed by taking in the
+ globalSubscriberId and the serviceType
+
+ c. If a service subscription for the particular customer doesnt exist in
+ AAI, then a new subscription is created by taking in the
+ serviceSubscriptionURI
+
+ GET performed on uri:**https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service?
+ {"results":[{"service-subscription":1}]}**
+
+# 10.6.4.2. AAI create service instance - implemented in createServiceInstance
+of createAAITasks
+
+ This method is used for creating the service instance in A&AI
+
+ a. Customer is got from the general building block that was updated above
+
+ b. A serviceInstanceURI is formed by taking in the globalSubscriberId, the
+ serviceType and the service instance id
+
+ c. If the service instance in the particular path doesnt exist in AAI ,
+ then a new service instance is created by using the serviceInstanceURI
+
+ .. code-block:: bash
+
+ GET to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84?
+
+ response: {"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","Node Not Found:No Node of type service-instance found at: business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","ERR.5.4.6114"]}}}
+
+ Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84
+
+ with req body : {"service-instance-id":"2b955def-e536-40ee-84cb-3f06e3cc6d84","service-instance-name":"DEMO_123456","model-invariant-id":"944862ae-bb65-4429-8330-a6c9170d6672","model-version-id":"d88da85c-d9e8-4f73-b837-3a72a431622b","orchestration-status":"Inventoried"}
+
+# 10.6.4.3. AAI create project - implemented in createProject of createAAITasks
+
+ This method is used for creation of the project A&AI.
+ Here too it checks whether a project with a {projectName} exist in AAI .
+ If not it creates one, and connects it to the service instance identified
+ by the serviceInstanceId
+
+ .. code-block:: bash
+
+ Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/projects/project/name%20of%20proj/relationship-list/relationship
+
+ with req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
+
+
+# 10.6.4.4. AAI create owning entity - implemented in createOwningEntity of
+createAAITasks
+
+ a. OwningEntityId and OwningEntityName is extracted from the OwningEntity
+ given in the input json
+
+ b. If both of them are null, then an exception is raised.
+
+ c. If only OwningEntityId is null, then whether the OwningEntityName is
+ present in AAI is checked. If present then OwningEntityId is set by
+ quering the OwningEntity from AAI. And then connect it to the service
+ instance. If not present in the aai then a random id is generated and
+ assigned to OwningEntityId. Then Owning entity is first created and
+ then connected to the service instance
+
+ d. Depending on whether the owning entity is already present or not,
+ either createOwningEntityandConnectServiceInstance is called, or
+ connectOwningEntityandServiceInstanceis called.
+
+ .. code-block:: bash
+
+ Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/owning-entities/owning-entity/owningEntityIdof%20owningEntity/relationship-list/relationship
+
+ req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
+
+
+# 10.6.4.5. SDNC Create Assign Request - implemented in assignServiceInstance
+of SDNCAssignTasks
+
+ a. Here first the requestContext, serviceInstance, customer are obtained
+ from the general building block
+
+ b. Then a payload for the assignServiceInstance of the sdnc is formed by
+ passing in the above parameters to the assignServiceInstance in
+ sdncSIResources.
+
+ c. A new sdnc request is formed with the above thing as payload
+
+ d. This sdnc request is assigned to the SDNCRequest parameter of the
+ execution variable
+
+ .. code-block:: bash
+
+ {"input":{
+ "request-information" : {
+ "request-action" : "CreateServiceInstance",
+ "source" : "MSO",
+ "request-id" : "139636cd-4b69-4c3a-9e67-fed2c283baee"
+
+ },
+ "sdnc-request-header" : {
+
+ "svc-request-id" : "9bfe8cb0-bb8b-4dca-949d-2f2b51011b54",
+ "svc-action" : "assign"
+
+ },
+ "service-information" : {
+
+ "onap-model-information" : {
+ "model-name" : "GR-API-DEFAULT",
+ "model-version" : "1.0",
+ "model-uuid" : "d88da85c-d9e8-4f73-b837-3a72a431622b",
+ "model-invariant-uuid" : "944862ae-bb65-4429-8330-a6c9170d6672"
+
+ },
+ "subscription-service-type" : "service",
+ "service-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84",
+ "global-customer-id" : {global_customerid},
+ "service-instance-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84"
+
+ },
+ "service-request-input" : {
+
+ "service-input-parameters" : {
+ "param" : [ {
+ "name" : "some name",
+ "value" : "some value"
+
+ } ]
+
+ },
+ "service-instance-name" : {instance_name}
+ }
+ }}
+
+# 10.6.4.6. It calls another bpmn file - SDNCHandler.bpmn
+
+ a. Setup callback variables - Here mainly the correlator variable and the
+ sdnc timeout variable is set
+
+ b. callSDNC - Here post call to sdnc client is done with the above
+ prepared payload. And then isSDNCCompleted is set to the execution
+ variable
+
+ Both the above tasks are implemented in SDNCRequestTasks.
+
+ **http://sdnc-oam.onap:8282/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation/**
+
+# 10.6.4.7. AAI Update (svc instance)- implemented in the
+updateOrchestrationStatusAssignedService in AAIUpdateTasks
+
+ BPMN access method to update the status of Service to Assigned in AAI.
+ Here serviceInstance is obtained , then its orchestration status is
+ changed to assigned and is updated in the AAI
+
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+ Reaches back to ExecuteBuildingBlock.bpmn
+
+# 10.6.5. Post validate the generic building block
+
+# 10.6.6. Set Handling Code To Success - implemented in
+setHandlingStatusSuccess in ExecuteBuildingBlockRainyDay handling code is set
+to success for the execution variable
+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+ Reaches back to WorkflowActionBB.bpmn
+
+# 10.7. postProcessingExecuteBB
+
+ If the building block excuted is ActivateVfModuleBB, then a
+ postProcessingExecuteBBActivateVfModule needs to be executed
+
+ Then again it is looped back to selectBB through a checkRetryStatus block.
+
+ This block comes into play only if the handlingCode is retry, and the retry
+ count is lesser than the maximum allowed no of retries, then the current
+ sequence is again reduced by 1 , so that the same block is executed again.
+ Request in the requestdb is updated with a setRetryStatusMessage,
+ keeping an eye on the no of retries executed.
+
+
+ And in this particular example ActivateServiceInstanceBB.
+ bpmn is called next in the sequence.
+
+ Here updateOrchestrationStatusActiveService is called, which is BPMN access
+ method to update status of Service to Active in AAI.
+ Here orchestrationStatus is set to active for the particular
+ service instance and is updated in the AAI .
+
+# 10.8. updateRequestStatusToComplete is called if the "complete" flag is true
+
+ a. Here first the request is got from the requestDbclient **http://request-db-adapter:8083/infraActiveRequests/requestid**
+
+ b. Then a status message is formed as "Macro-" + resourceName + "-"
+ + action + " request was executed correctly."
+
+ This status message is updated in the request as well as is set to
+ finalStatusMessage of the execution variable
+
+ c. Other request parameters are updated
+
+ request.setEndTime(endTime);
+
+ request.setFlowStatus("Successfully completed all Building Blocks");
+
+ request.setProgress(Long.valueOf(100));
+
+ request.setRequestStatus("COMPLETE");
+
+ request.setLastModifiedBy("CamundaBPMN");
+
+ d. This new request parameters are updated by a put request to the
+ requestDbclient
+
+
+
+
+Flow ends
+----------
+
+If there are other resources present along with the service : Eg
+:- Volumegroup.( These BBs wil be specifically called )
+
+1) AssignVolumeGroupBB :
+
+ a. genericvnfid and volumegroupid is obtained from the execution block.
+ b. volumegroup orchestrationstatus is set to assigned
+ c. a volume group of the above details is created in aai
+ d. connect volumegroup to this genericvnf
+ e. cloud configuration is got,
+ and then the volumegroup is linked to tenant
+
+2) createVolumeGroupBB :
+
+ a. get the vf details according to Vf module id from sdnc.
+ b. vfmodulequeriedfromsdnc is set to the executionvariable.
+ c. createVolumeGroupRequest is formed with getCloudRegion,
+ serviceinstance, genericVnf, volumegroup, sdncVfModuleQueryResponse.
+ d. calls vnfadapter, which in turn calls openstackadaptertask.
+ e. update heattask in the volumegroup and which is ammended in the aai.
+ f. orchestrationstatus for the volume group is set to created.
+
+3) ActivateVolumeGroupBB :
+
+ orchestrationstatus for the volume group is ammended to active.
+
+Rollback, Retry and abort
+------------------------------------
+
+When exception is thrown then **Error handling** event subprocess in BPMN
+**ExecuteBuildingBlock** is invoked.
+
+ .. image:: ../images/handling_error.png
+
+ **QueryRainyDayTable task** main responsibility is to determine with
+ **rainy_day_handler_macro** table the right policy to apply in order to
+ recover from error.
+
+ For each BB a policy is defined in **rainy_day_handler_macro** table
+ (retry, rollback, abort ...)
+
+ **HandlingCode** parameter is populated with BB **policy** value.
+
+
+
+# 1. In case of retry handling code
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Policy in **rainy_day_handler_macro** table for current BB failure is **Retry**
+
+.. image:: ../images/retry_Bdd2.png
+
+Once Error handling subprocess has set handlingCode to **retry** value,
+the main process retries to execute previous failing BB (green arrow).
+
+.. image:: ../images/retry.png
+
+If a new failure occurred a **new retry** is performed
+(green arrow in Error handling subprocess)
+
+.. image:: ../images/retry3.png
+
+
+Until **max retry count** is reached, this time **secondary policy**
+will be queried.
+
+.. image:: ../images/retry2.png
+
+**HandlingCode** is now set with **secondary policy** value from
+rainy_day_handler_macro table (rollback, abort...)
+
+.. image:: ../images/retry_Bdd.png
+
+
+# 2. In case of rollback handling code
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Policy in **rainy_day_handler_macro** table for current BB failure is set to
+**Rollback** (or RollbackToXXX)
+
+
+ .. image:: ../images/rollback_Bdd.png
+
+In case of Rollback the main process follows green arrows
+
+ .. image:: ../images/rollback.png
+
+ 1) **HandlingCode** set previously in Error handling subprocess to Rollback
+ (or RollbackToXXX) drives to **RollBack Execution Path** in main process
+
+ 2) **RollBack Execution Path** task has responsibility to prepare rollback
+ flow sequence.
+
+ BB FlowName are changed in the following way:
+
+ * AssignXXX => UnassignXXX
+ * CreateXXX => DeleteXXX
+ * ActivateXXX => DeactivateXXX
+ * AddXXX => DeleteXXX
+ * VNFSetXXX => VNFUnsetXXX
+ * VNFLockXXX => VNFUnLockXXX
+ * VNFStopXXX => VNFStartXXX
+ * VNFQuiesceXXX => VNFResumeXXX
+
+ 3) and 4. **Loop** on step **3** and step **4**, BB are executed one after one in order to **rollback** previous flow execution.
+
+ 5) RollBack completed.
+
+
+# 3. In case of Abort handling code
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Policy in **rainy_day_handler_macro** table for current BB failure is **Abort**
+
+.. image:: ../images/abort.png
+
+
+
+Suppress Rollback
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Request can disable rollback with **suppressRollback** parameter
+
+if **suppressRollback** is set to false value, **QueryRainyDayTable task**
+will directly return abort without querying policy in table
+**rainy_day_handler_macro**
+
+
+.. code-block:: bash
+
+ curl --location --request POST 'http://master2:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances' \
+ --header 'Accept: application/json' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic abcdef' \
+ --header 'X-ONAP-PartnerName: NBI' \
+ --data-raw '{
+ "requestDetails": {
+ "subscriberInfo": {
+ "globalSubscriberId": "ones"
+ },
+ "requestInfo": {
+ "suppressRollback": false,
+ "productFamilyId": "Useless_But_Mandatory",
diff --git a/docs/developer_info/ETSI_NFVO_Network_Service_LCM_Setup_Guide.rst b/docs/developer_info/ETSI_NFVO_Network_Service_LCM_Setup_Guide.rst
new file mode 100644
index 0000000000..db96d5a213
--- /dev/null
+++ b/docs/developer_info/ETSI_NFVO_Network_Service_LCM_Setup_Guide.rst
@@ -0,0 +1,263 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2021 Ericsson Software Technologies
+
+ETSI NFVO Network Service LCM Setup & Functionality
+===================================================
+This guide will go through the setup required and the use of the ETSI NFVO NS LCM Functionality: Create, Instantiate, Terminate and Delete a Network Service
+
+Ensure you have a healthy ONAP Deployment running. The following components will be required/used as part of this guide:
+
+- SO
+- SDC
+- AAI
+- DMAAP
+- Modeling
+- UUI
+
+Add Entries to ESR System Info List and ESR VNFM Lists
+------------------------------------------------------
+This first section of the guide will involve adding values to AAI under the following 3 paths:
+
+- /aai/v15/cloud-infrastructure/cloud-regions/cloud-region/<cloud-owner>/<cloud-region-id>/esr-system-info-list/esr-system-info/<yourVnfmId>
+- /aai/v15/external-system/esr-vnfm-list/esr-vnfm/<yourVnfmId>
+- /aai/v15/external-system/esr-vnfm-list/esr-vnfm/<yourVnfmId>/esr-system-info-list/esr-system-info/
+
+For the purposes of this guide, the VNFM Simulator will be used as the VNFM throughout. You will need to edit the below CURLs in order to match your specific VNFM's requirements, if using one other than the VNFM Simulator.
+
+
+**Step 1:**
+
+Exec into any pod within your ONAP deployment that is connected to the primary ONAP network. This will give you access to using the internal service hostnames.
+
+**Step 2:**
+
+Send the following CURL to add the AAI Cloud Infrastructure ESR System Info List Entry. Ensuring you alter the values to match your deployment's AAI Data:
+
+*AAI Cloud Infrastructure ESR System Info List Entry*
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/regionOne/esr-system-info-list/esr-system-info/vnfmSimulator -d '{"name": "vnfmSimulatorName", "system-type": "simulator", "vimId": "myCloud", "vendor": "EST", "version": "V1.0", "certificateUrl": "", "url": "http://so-vnfm-simulator.onap:9093/vnflcm/v1/", "user-name": "vnfm", "password": "password1$"}' -k
+
+**Step 3:**
+
+Next you will need to send the following 2 CURLs in order to add entries into the AAI External System ESR VNFM List:
+
+*AAI External System ESR VNFM List*
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/vnfmSimulator -d '{"vnfmId": "vnfmSimulator", "name": "vnfmSimulatorName", "type": "simulator", "vendor": "est"}'
+
+*AAI External System ESR VNFM System Info List*
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/vnfmSimulator/esr-system-info-list/esr-system-info/vnfmSimulatorId -d '{"esr-system-info-id": "vnfmSimulatorId", "type": "simulator", "user-name": "vnfm", "password": "password1$", "system-type": "simulator", "service-url": "http://so-vnfm-simulator.onap:9093/vnflcm/v1"}'
+
+**Step 4:**
+
+Take note of the "system-type" and "type" values you have added with these CURLs. This will be used at a later stage when creating your VF in SDC.
+
+
+Onboard a VNF package along with a Network Service CSAR into SDC
+----------------------------------------------------------------
+A video demonstration of this process "Onboarding ETSI Based NS" can be found here: SO NFVO NS Onboarding and LCM Demonstrations
+It is recommended that you view this video before/alongside this section of the guide.
+
+**Step 1:**
+
+Login to the ONAP Portal. (Link: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm (where "portal.api.simpledemo.onap.org" is set as the IP of your VM/host of your Portal component.)
+
+Login: cs0008
+Password: demo123456!
+
+**Step 2:**
+
+Select the SDC App. It is possible that your browser will block the scripts run by the Portal, you will need to enable them if it does.
+
+**Step 3:**
+
+Follow the onboarding guide below:
+
+Onboarding your VNF:
+
+1: Click the “ONBOARD” tab near the top of the window.
+
+2: Create a “VLM” if you have not created a "VLM" before.
+
+- From the “ONBOARD” page, click create VLM.
+- Enter name and description, then select create.
+- Click on the plus button beside Entitlement Pool.
+- Add Name and Manufacturing Reference Number, then click save.
+- Click on the plus button beside License Key Groups.
+- Add Name and select type, then click save.
+- Click on the plus button beside Feature Groups.
+- In the general tab, add name, Description and Part Number. Move to the Entitlements Pools tab, select the entitlement pool you just created and click the rightward arrow. Move to the License Key Group tab, select the license key group you just created and click the rightward arrow. Once these three things are done, click save.
+- Click on the plus button beside License Agreement.
+- Add Name and select License Term. Next move to the Feature Groups tab, select the Feature Group you just created and click the rightward arrow. Lastly click save.
+- On the overview page, select submit in the top right corner of the screen.
+- Enter a commit comment and click Commit & Submit.
+
+3: Create a Virtual Service Product (VSP)
+
+- Click the “ONBOARD” tab near the top of the window.
+- Click “CREATE NEW VSP” and fill in the required information. Make sure to select “Network Package” for the “ONBOARDING PROCEDURE” section. Then click “CREATE”.
+- Click where it shows “! Missing” underneath “License Agreement”. Simply select a “Licensing Version” and “License Agreement/Feature Group” from the drop downs.
+- Click the “Overview” tab on the left hand side. Then press “Select File” in the “SOFTWARE PRODUCT ATTACHMENTS” section and select your prepared VNF Package. If you are onboarding a supported zip, then click “PROCEED TO VALIDATION” once you can see your added files. You can safely ignore any warnings that come up at this step, but not any errors. (Note: The package validation does not support CSARs currently, they will still work however, providing they meet SDC requirements.)
+- Now click “Submit”.
+
+4: Then click “ONBOARD” in the top left. Hover your mouse over the small grey triangle that is just to the right of the “ONBOARD” tab and select “HOME”.
+
+5: Hover over the “IMPORT” square and select “Import VSP”. Find your VSP, click the drop-down arrow beside it and then press the “Import VSP” icon at the far right of the line that drops down.
+
+6: You will now be brought to the draft page of your VF. Follow the instructions below in order to certify it.
+
+- First, give your VF a name you will remember, as we will be using this in the following section, then click "Create" in the top-right hand corner.
+- You will need to edit the properties of the VF in order to add a property value, that will be required at a later point.
+- Go to the “Properties Assignment” tab on the left-hand side, then select your VF on the right-hand side.
+- Now go to the "Inputs" tab within the "Properties Assignment”.
+- Find the "nf_type" input and enter a value matching the value you entered for "system-type" and "type" in the previous ESR Entries section.
+- Click "Save" in the top-right of the "Properties Assignment” tab and then you can Certify your VF, by clicking "Certify" in the top-right of the VF Page.
+
+**Creating/Configuring your SDC Service**
+
+1: In the “HOME” tab of the SDC ONAP Portal, hover over the “ADD” square and select “ADD SERVICE”. Fill in the required fields, select the "Category" "Network Service" and press “Create” in the top right-hand corner.
+
+2: You will be brought to the draft page of your Service. Go to the “Composition” tab on the left-hand side and drag/drop the VF, that you just created, into this service (you can search for the VF by name in the top left).
+
+3: Now you will need to add the Network Service CSAR package to this service. You can do this by clicking in the blank whitespace of the composition, then on the right hand side of the page select the 2nd tab in order to add a deployment artifact. Click "ADD ARTIFACT" here, give an "Artifact Label" of "ns", any description value and ensure you choose a "Type" of "OTHER". Then click "DONE".
+
+4: Finally you can click "Certify" in the top right hand corner, followed by "Distribute". Your Service will now distributed across ONAP.
+
+Onboarding your Network Service to ETSI Catalog through UUI
+-----------------------------------------------------------
+This next small section (Onboarding your NS through UUI) can also been seen in the "Onboarding ETSI Based NS" video mentioned earlier.
+
+**Step 1:**
+
+Go to the following link, in order to access the UUI Portal: https://msb.api.simpledemo.onap.org:30283/iui/usecaseui/#/home (where "msb.api.simpledemo.onap.org" is set as the IP of your VM/host of your UUI component.)
+
+**Step 2:**
+
+Click "Package Management", you will be brought to the "NS" tab, you should see your Service name in the list. Simply click the "Operation button" on the right hand side of your Service in order to onboard it into the ETSI Catalog.
+
+**Step 3:**
+
+Wait for the confirmation that your Network Service has been Onboarded Successfully.
+
+
+
+Triggering the ETSI NFVO NS LCM Functionality
+---------------------------------------------
+
+The next section of this guide will go through the actual triggering of the ETSI NFVO NS LCM Functionalities in the following order: Create, Instantiate, Terminate and then Delete.
+
+This section of this guide can be seen in video format at the following link: https://wiki.onap.org/display/DW/SO+NFVO+NS+Onboarding+and+LCM+Demonstrations
+
+It is recommended that you view the "ETSI Based NS Orchestration Demo" video before/alongside this section of the guide.
+
+**Create NS**
+
+**Step 1:**
+
+First you will need to retrieve the NSD ID from the ETSI Catalog Database in order to populate the Create Network Service CURL. The ETSI Catalog Database will be found within the Modeling DB container.
+
+Log into the ETSI Catalog Database and retrieve the data from the "catalog_nspackage" table. The value under the column "NSPACKAGEID" will be the NSD ID required as part of the Create Network Service CURL.
+
+**Step 2:**
+
+Exec into any pod within your ONAP deployment that is connected to the primary ONAP network. This will give you access to using the internal service hostnames.
+
+**Step 3:**
+
+Send the following Create Network Service CURL Command, ensuring your deployment's Global Customer ID (from AAI) and your NSDID (from ETSI Catalog Database) replace the values within the <>:
+
+*Create NS Curl*
+
+.. code-block:: bash
+
+ curl -k -X POST -H "accept:application/json" -H "Content-Type:application/json" -H "HTTP_GLOBALCUSTOMERID: <GLOBALCUSTOMERID>" -d '{"nsdId": "<NSDID>", "nsName": "demo", "nsDescription": "demo"}' -v http://so-etsi-nfvo-ns-lcm.onap:9095/so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1/ns_instances -H "Authorization: Basic c28tZXRzaS1uZnZvLW5zLWxjbTpEdXJnMSREYWxhWG95ZA=="
+
+You should receive a synchronous response back with a 201 Create HTTP Response. This response will contain the NS Instance ID of the NS Instance we just created, take note of this as it will be needed in the following steps.
+
+After this step has been completed you should log into the Marie-Db-Galera-0 Pod on your ONAP deployment, then connect to the "NFVO" database. Retrieving all data from the "ns_inst" table will show that your initial NS has been created.
+
+**Instantiate NS**
+
+**Step 1:**
+
+Next you will need to create a JSON file on the pod, which you are exec'ed into, named "Payload.json" in the following example.
+
+*Payload.json*
+
+.. code-block:: json
+
+ {
+ "nsFlavourId": "default",
+ "locationConstraints": [{
+ "vnfProfileId": "b1bb0ce7-2222-4fa7-95ed-4840d70a1177"
+ }],
+ "additionalParamsForVnf": [{
+ "vnfProfileId": "b1bb0ce7-2222-4fa7-95ed-4840d70a1177",
+ "vnfInstanceName": "vgwVnf1",
+ "vnfInstanceDescription": "test",
+ "additionalParams": {
+ "vim_id": "<cloud-owner>_<cloud-region-id>_<tenant_id>"
+ }
+ }]
+ }
+
+
+In the above Payload.json, you must ensure that the "vnfProfileId" matches the VNF Descriptor ID found in the VNF CSAR which you onboarded as part of the VNF Onboarding section of this guide. The "vnfInstanceName" must match your VNF's name, and finally the "vim_id" must be replaced with your AAI Data values for your deployment's Cloud-Owner, Cloud-Region-Id and Tenant-Id respectively.
+
+**Step 2:**
+
+Next you will need to send the following CURL command in order to trigger the instantiation of the Network Service. Ensure that you add the NS Instance ID received in the Create NS response to the URL Path (replacing <NS_INSTANCE_ID>), and match the Global Customer ID as before:
+
+*Instantiate NS Curl*
+
+.. code-block:: bash
+
+ curl -k -X POST -H "Authorization: Basic c28tZXRzaS1uZnZvLW5zLWxjbTpEdXJnMSREYWxhWG95ZA==" -H "accept: application/json" -H "Content-Type:application/json" -H "HTTP_GLOBALCUSTOMERID: ADemoCustomerInXcloud" -d @Payload.json -v http://so-etsi-nfvo-ns-lcm.onap:9095/so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1/ns_instances/<NS_INSTANCE_ID>/instantiate
+
+This will trigger the Asynchronous Instantiate NS Functionality. You will receive a response confirming that the process has begun with a 202 Accepted HTTP Response Header. You can view the debug.log files on the following pods in order to view the progress:
+
+- SO-ETSI-NFVO-NS-LCM
+- SO-ETSI-SOL003-ADAPTER
+- SO-VNFM-SIMULATOR (If making use of the VNFM-Simulator, alternatively the logs of the VNFM you are using)
+
+Once the full instantiation has been completed, reconnect to the "NFVO" database, within the Marie-Db-Galera-0 pod on your ONAP deployment. Retrieving all data from the "ns_inst" table again, you should see that the "STATUS" field for your NS has changed to "INSTANTIATED".
+
+**Terminate NS**
+
+**Step 1:**
+
+Send the following CURL command in order to trigger the Termination of the Network Service. Ensure that you add the NS Instance ID received in the Create NS response to the URL Path (replacing <NS_INSTANCE_ID>):
+
+*Terminate NS Curl*
+
+.. code-block:: bash
+
+ curl -k -X POST -H "Authorization: Basic c28tZXRzaS1uZnZvLW5zLWxjbTpEdXJnMSREYWxhWG95ZA==" -H "accept: application/json" -H "Content-Type: application/json" -v http://so-etsi-nfvo-ns-lcm.onap:9095/so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1/ns_instances/<NS_INSTANCE_ID>/terminate
+
+Similar to the Instantiate functionality, this is an asynchronous call, so you will receive a response confirming that the process has begun with a 202 Accepted HTTP Response Header. As above, view the specified debug.log files in order to view the progress.
+
+Once the full termination has been completed, reconnect to the "NFVO" database, within the Marie-Db-Galera-0 pod on your ONAP deployment. Retrieving all data from the "ns_inst" table again, you should see that the "STATUS" field for your NS has changed back to "NOT_INSTANTIATED".
+
+**Delete NS**
+
+**Step 1:**
+
+Finally send the following CURL command in order to trigger the Deletion of the Network Service. Ensure that you add the NS Instance ID received in the Create NS response to the URL Path (replacing <NS_INSTANCE_ID>):
+
+*Delete NS Curl*
+
+.. code-block:: bash
+
+ curl -k -X DELETE -H "Authorization: Basic c28tZXRzaS1uZnZvLW5zLWxjbTpEdXJnMSREYWxhWG95ZA==" -H "accept: application/json" -H "Content-Type: application/json" -v http://so-etsi-nfvo-ns-lcm.onap:9095/so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1/ns_instances/<NS_INSTANCE_ID>
+
+Similar to the Create functionality, this is a synchronous call and as such you will receive a 204 No Content Http Response to your CURL command.
+
+Once the full deletion has been completed, reconnect to the "NFVO" database, within the Marie-Db-Galera-0 pod on your ONAP deployment. Retrieving all data from the "ns_inst" table again, you should no longer be able to see the NS Instance in the NS_INST table.
diff --git a/docs/developer_info/ETSI_VNF_LCM_Setup_Guide.rst b/docs/developer_info/ETSI_VNF_LCM_Setup_Guide.rst
new file mode 100644
index 0000000000..2a74ed0a80
--- /dev/null
+++ b/docs/developer_info/ETSI_VNF_LCM_Setup_Guide.rst
@@ -0,0 +1,595 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2021 Ericsson Software Technologies
+
+SO ETSI VNF LCM Setup & Functionality
+=================================================
+
+Introduction
+------------
+
+This guide will describe the steps required to execute the ETSI “Instantiate VNF” and “Terminate VNF” workflows using ONAP. The initial requirements you need for this guide are as follows:
+
+- A stable ONAP Deployment
+- ESR component enabled in ONAP installation.
+- SO-ETSI-SOL003-Adapter component enabled ONAP in installation.
+- A VNFM that is aligned to the Sol003 Interface (https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.03.01_60/gs_NFV-SOL003v020301p.pdf)
+- A Sol004 Aligned VNF package (https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/004/02.03.01_60/gs_nfv-sol004v020301p.pdf)
+
+
+Initial Configurations
+----------------------
+
+The following configurations need to be completed in order to execute the ETSI workflows and instantiate through the SO-ETSI-SOL003-Adapter.
+
+**Log into the MariaDB Database**
+
+Find your Mariadb pod:
+
+.. code-block:: bash
+
+ kubectl -n onap get pods | grep maria
+
+Exec into a Mariadb-Galera pod (replace <PODNAME> with the Mariadb pod name):
+
+.. code-block:: bash
+
+ kubectl -n onap -it exec <PODNAME> bash
+
+Log into the SQL database and connect to the "catalogdb" database. Follow the next steps in order to configure your ONAP's Mariadb database.
+
+**Enable the ETSI “Instantiate/Create” & “Terminate/Delete” building blocks.**
+
+Firstly, you will need to add the ETSI Create & Delete building blocks, this is done by inserting them into the “building_block_detail” table in the Mariadb’s “catalogdb” database.
+
+**Insert the ETSI Create Building Block:**
+
+.. code-block:: bash
+
+ insert into building_block_detail(building_block_name, resource_type, target_action) values (“EtsiVnfInstantiateBB”, “VNF”, “ACTIVATE”);
+
+**Insert ETSI Delete Building Block:**
+
+.. code-block:: bash
+
+ insert into building_block_detail(building_block_name, resource_type, target_action) values (“EtsiVnfDeleteBB”, “VNF”, “DEACTIVATE”);
+
+**View the “building_block_detail” table:**
+
+.. code-block:: bash
+
+ select * from building_block_detail;
+
+You should now have the entries in your “building_block_detail” table.
+
+
+
+Update the orchestration_flow_reference table
+---------------------------------------------
+
+Note: Standard VNF instantiation is unlikely to work once this step has been completed.
+
+The next step is to set which building blocks are triggered on a VNF instantiate request. We will also be setting the correct sequence for these building blocks.
+
+**View the VNF Create/Delete sequences from the “orchestration_flow_reference” table:**
+
+.. code-block:: bash
+
+ select * from orchestration_flow_reference where COMPOSITE_ACTION="VNF-Create";
+ select * from orchestration_flow_reference where COMPOSITE_ACTION="VNF-Delete";
+
+**Remove/Update current entries for “VNF-Create” & “VNF-Delete”:**
+
+Retrieve “ID” from “northbound_request_ref_lookup” table. Take note of the “ID” value for “VNF-Create” and “VNF-Delete”:
+
+.. code-block:: bash
+
+ select * from northbound_request_ref_lookup where REQUEST_SCOPE='Vnf' and IS_ALACARTE is true;
+
+Remove current VNF-Insert and insert ETSI VNF-Create, replace <ID> with the corresponding value retrieved from the “northbound_request_ref_lookup” table:
+
+.. code-block:: bash
+
+ delete from orchestration_flow_reference where COMPOSITE_ACTION = "VNF-Create";
+ insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",1,"AssignVnfBB",1,<ID>);
+ insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",2,"EtsiVnfInstantiateBB",1,<ID>);
+ insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",3,"ActivateVnfBB",1,<ID>);
+
+Remove current VNF-Delete and insert ETSI VNF-Delete, replace <ID> with the corresponding value retrieved from the “northbound_request_ref_lookup” table:
+
+.. code-block:: bash
+
+ delete from orchestration_flow_reference where COMPOSITE_ACTION = "VNF-Delete";
+ insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Delete",1,"EtsiVnfDeleteBB",1,<ID>);
+ insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Delete",2,"UnassignVnfBB",1,<ID>);
+
+
+You have now enabled the ETSI building blocks and configured the sequence of building blocks to execute.
+
+**Update the “orchestration_status_state_transition_directive” table**
+
+The last step that needs to take in the MariaDB, is to update the state transition table, in order to allow our ETSI Create building blocks to correctly change the operation status of a VNF. If the operation status is not allowed to change correctly, then our ETSI building block will be skipped and will not be executed.
+
+View the current “orchestration_status_state_transition_directive” setup.
+
+.. code-block:: bash
+
+ select * from orchestration_status_state_transition_directive where RESOURCE_TYPE='VNF' and ORCHESTRATION_STATUS='Created';
+
+Update the row that decides when a “VNF” with an orchestration status of “CREATED” has a target action of “ACTIVATE” to “CONTINUE” instead of “FAIL” using the following command:
+
+.. code-block:: bash
+
+ update orchestration_status_state_transition_directive set FLOW_DIRECTIVE='CONTINUE' where RESOURCE_TYPE='VNF' and ORCHESTRATION_STATUS='CREATED' and TARGET_ACTION='ACTIVATE' and FLOW_DIRECTIVE='FAIL';
+
+The transition directive is now set up correctly, allowing all of your ETSI building blocks to be executed correctly.
+
+
+Adding your VNFM to ONAP ESR
+----------------------------
+
+Now you will need to send a curl command to A&AI, in order to add the VNFM to ESR/A&AI.
+
+Please ensure you have ESR added to your ONAP installation before attempting this step. Next, you will need to populate the ESR VNFM List with information relating to the VNFM that you want to instantiate your VNFs through.
+
+**Adding your VNFM to ONAP ESR using CURL:**
+
+In order to use the curl command method, you will need to log into an ONAP pod, that is within your ONAP network. (This prevents us needing to go and get the AAI service IP and external port.)
+
+You can log into one of your pods with the following command (this example will use the BPMN-INFRA pod):
+
+.. code-block:: bash
+
+ kubectl -n onap get pods | grep bpmn
+
+Then take the full pod name and put it into this command instead of <PODNAME>:
+
+.. code-block:: bash
+
+ kubectl -n onap exec -it <PODNAME> sh
+
+Once Exec'ed into the pod you can run the following command which creates a VNFM, in ESR, with ID “ExampleVnfm”. (Edit this curl command to your needs before using it)
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfm -d '{"vnfmId": "ExampleVnfm", "name": "ExampleVnfmName", "type": "ExampleVnfmType", "vendor": "est"}'
+
+One important thing to note in this curl command is the type: "ExampleVnfmType". This will be used in a later step for specifying which VNFM you want to instantiate through, take note of this.
+
+Once you have entered the previous information you need to add the “service-url” to your “esr-system-info” section of this VNFM you just added. Please note, that the “service-url” in the following curl command was designed to work with the “so-vnfm-simulator”, you will need to change this to match your specific VNFM’s “service-url”.
+
+You will need to put this data into the "external-system" and "cloud-infrastructure" API paths listed below. This is done with the following curl commands:
+
+**AAI Cloud-Infrastructure**
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/<CLOUD_OWNER>/<CLOUD_REGION_ID>/esr-system-info-list/esr-system-info/ExampleVnfm -d '{"name": "ExampleVnfm", "system-type": "ExampleVnfmType", "vimId": "myCloud", "vendor": "EST", "version": "V1.0", "certificateUrl": "", "url": "http://so-vnfm-simulator.onap:9095/vnflcm/v1/", "user-name": "testUser", "password": ""}'
+
+Please note you will need to replace <CLOUD_OWNER> and <CLOUD_REGION_ID> with their respective values in your ONAP deployment.
+
+**AAI External-System**
+
+.. code-block:: bash
+
+ curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfm/esr-system-info-list/esr-system-info/ExampleEsrSystemInfo -d '{"esr-system-info-id": "ExampleEsrSystemInfo", "type": "ExampleVnfmType", "user-name": "user", "password": "password", "system-type": "VNFM", "service-url": "http://so-vnfm-simulator.onap:9095/vnflcm/v1"}'
+
+You have now entered your VNFM into the ESR/AAI components.
+
+Here are the equivalent GET commands for checking what is currently in your ESR/AAI list (change the IDs to match the IDs you used earlier):
+
+.. code-block:: bash
+
+ curl -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/
+
+.. code-block:: bash
+
+ curl -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfmId/esr-system-info-list/esr-system-info
+
+
+Upload VNF Image to VNFM
+------------------------
+
+Currently, there is no implementation of the package management interface in the SO-ETSI-SOL003-Adapter, this means that the VNF image needs to be onboarded to your VNFM before instantiation. The VNF image will then be selected by using the VNF descriptor, found in one of the artifacts within the SDC onboarding package, mentioned later in this guide ("descriptor.yaml").
+
+This is an important step, which unfortunately can be drastically different depending on the specific vendor's VNFM.
+
+
+Onboarding a Virtual Software Product (VSP) with an ETSI HEAT Template.
+-----------------------------------------------------------------------
+
+Onboard a VNF package along with a Network Service CSAR into SDC.
+A video demonstration of this process "Onboarding ETSI Based NS" can be found under SO NFVO NS Onboarding and LCM Demonstrations
+It is recommended that you view this video before/alongside this section of the guide.
+
+**Step 1:**
+
+Login to the ONAP Portal. (Link: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm (where "portal.api.simpledemo.onap.org" is set as the IP of your VM/host of your Portal component.)
+
+Login: cs0008
+Password: demo123456!
+
+**Step 2:**
+
+Select the SDC App. It is possible that your browser will block the scripts run by the Portal, you will need to enable them if it does.
+
+**Step 3:**
+
+Onboarding your VNF:
+1: Click the “ONBOARD” tab near the top of the window.
+2: Create a “VLM” if you have not created a "VLM" before.
+
+- From the “ONBOARD” page, click create VLM.
+- Enter name and description, then select create.
+- Click on the plus button beside Entitlement Pool.
+- Add Name and Manufacturing Reference Number, then click save.
+- Click on the plus button beside License Key Groups.
+- Add Name and select type, then click save.
+- Click on the plus button beside Feature Groups.
+- In the general tab, add name, Description and Part Number. Move to the Entitlements Pools tab, select the entitlement pool you just created and click the rightward arrow. Move to the License Key Group tab, select the license key group you just created and click the rightward arrow. Once these three things are done, click save.
+- Click on the plus button beside License Agreement.
+- Add Name and select License Term. Next move to the Feature Groups tab, select the Feature Group you just created and click the rightward arrow. Lastly click save.
+- On the overview page, select submit in the top right corner of the screen.
+- Enter a commit comment and click Commit & Submit.
+
+3: Create a Virtual Service Product (VSP)
+
+- Click the “ONBOARD” tab near the top of the window.
+- Click “CREATE NEW VSP” and fill in the required information. Make sure to select “Network Package” for the “ONBOARDING PROCEDURE” section. Then click “CREATE”.
+- Click where it shows “! Missing” underneath “License Agreement”. Simply select a “Licensing Version” and “License Agreement/Feature Group” from the drop downs.
+- Click the “Overview” tab on the left hand side. Then press “Select File” in the “SOFTWARE PRODUCT ATTACHMENTS” section and select your prepared VNF Package. If you are onboarding a supported zip, then click “PROCEED TO VALIDATION” once you can see your added files. You can safely ignore any warnings that come up at this step, but not any errors. (Note: The package validation does not support CSARs currently, they will still work however, providing they meet SDC requirements.)
+- Now click “Submit”.
+
+4: Then click “ONBOARD” in the top left. Hover your mouse over the small grey triangle that is just to the right of the “ONBOARD” tab and select “HOME”.
+
+5: Hover over the “IMPORT” square and select “Import VSP”. Find your VSP, click the drop-down arrow beside it and then press the “Import VSP” icon at the far right of the line that drops down.
+
+6: You will now be brought to the draft page of your VF. You can now Certify your VF, by clicking "Certify" in the top-right of the VF Page.
+
+Creating/Configuring your SDC Service:
+--------------------------------------
+
+**Step 1:**
+
+In the “HOME” tab of the SDC ONAP Portal, hover over the “ADD” square and select “ADD SERVICE”. Fill in the required fields, select the "Category" "Network Service" and press “Create” in the top right-hand corner.
+
+**Step 2:**
+
+You will be brought to the draft page of your Service. Go to the “Composition” tab on the left-hand side and drag/drop the VF, that you just created, into this service (you can search for the VF by name in the top left).
+
+**Step 3:**
+
+Now you will need to add the Network Service CSAR package to this service. You can do this by clicking in the blank whitespace of the composition, then on the right hand side of the page select the 2nd tab in order to add a deployment artifact. Click "ADD ARTIFACT" here, give an "Artifact Label" of "ns", any description value and ensure you choose a "Type" of "OTHER". Then click "DONE".
+
+**Step 4:**
+
+Finally you can click "Certify" in the top right hand corner, followed by "Distribute". Your Service will now distributed across ONAP.
+
+Preloading SDNC (Optional)
+--------------------------
+
+This next step is optional, and is only required if a user needs to add "addiional-params" or "virtual-link" information. You will need to preload SDNC with the required attributes for your VNF. You will need to access the SDNC OpenDaylight RestConf API Documentation in order to add these attributes.
+
+You will then be required to sign in once you access this site, the credentials are as follows, but may change in the future:
+
+Username: admin
+
+Password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+
+Next click on VNF-API.
+
+Then use the following endpoint to post the preload JSON, found below.
+
+Endpoint: restconf/operations/VNF-API:vnf-topology-operation
+
+The following section of code is an example of the JSON that needs to be uploaded to the SDNC OpenDaylight RestConf API Documentation site.
+
+Please note that you will need to set the attributes "generic-vnf-name" and "vnf-name" to the exact name that you will use when instantiating the VNF through VID. The attributes "generic-vnf-type" and "vnf-type" need to have the exact same name as the VSP that you imported to SDC, to create the VF.
+
+**Preload for SDNC:**
+
+.. code-block:: json
+
+ {
+ "input": {
+ "request-information": {
+ "notification-url": "openecomp.org",
+ "order-number": "1",
+ "order-version": "1",
+ "request-action": "PreloadVNFRequest",
+ "request-id": "robot21"
+ },
+ "sdnc-request-header": {
+ "svc-action": "reserve",
+ "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
+ "svc-request-id": "robot21"
+ },
+ "vnf-topology-information": {
+ "vnf-assignments": {
+ "availability-zones": [],
+ "vnf-networks": [],
+ "vnf-vms": []
+ },
+ "vnf-parameters": [{
+ "vnf-parameter-name": "additionalParams",
+ "vnf-parameter-value": "{\"key_1\": \"value_1\"}"
+ }, {
+ "vnf-parameter-name": "extVirtualLinks",
+ "vnf-parameter-value": "{}"
+ }],
+ "vnf-topology-identifier": {
+ "generic-vnf-name": "VnfInstantiateName",
+ "generic-vnf-type": "VspPackageName",
+ "service-type": "vCPE",
+ "vnf-name": "VnfInstantiateName",
+ "vnf-type": "VspPackageName"
+ }
+ }
+ }
+ }
+
+
+The datatype of "additionalParams" and "extVirtualLinks" can be found in the Sol003 Specifications.
+
+The data must be JSON and contain only escaped strings. Here are examples of both:
+
+**Example of additionalParameters parameter:**
+
+.. code-block:: bash
+
+ {\"enableRollback\": \"false\"}
+
+
+**Example of extVirtualLinks Parameter:**
+
+.. code-block:: bash
+
+ [{\"id\":\"3b94d0be-6e37-4a01-920f-512e96803fc9\",\"tenant\":{\"cloudOwner\":\"CloudOwner\",\"regionName\":\"RegionOne\",\"tenantId\":\"f3d66580-7eff-4da5-8d27-91f984ad0c0b\"},\"resourceId\":\"e6e1a04d-c599-4b09-bc16-688834d0ac50\",\"extCps\":[{\"cpdId\":\"a83f86e0-7e9b-4514-9198-2d9eba91bd8e\",\"cpConfig\":[{\"cpInstanceId\":\"f966673d-fb96-41d4-8e5c-659f1c8c6bcc\",\"linkPortId\":null,\"cpProtocolData\":null}]}],\"extLinkPorts\":null}]
+
+
+Using VID to send Instantiate Request
+-------------------------------------
+
+In order to access the VID (Virtual Infrastructure Deployment) component through the portal, you will need to login with the id “demo”. Once logged in to VID, first ensure that the GR-API is set. First we will need to instantiate the service, once this is done we can then instantiate the VNF. This will be when the ETSI Workflows are run.
+
+**Deploy SDC Service**
+
+You will need to select “Deploy an SDC Service” on the left-hand side of the GUI. You should see your distributed service in the list of services shown here. (Note: if you cannot see your services here then you will need to go back to SDC, to check the status of the distribution.)
+
+- Press "Deploy" on the left-hand side of the service you have distributed.
+- Fill out the required fields and press "Confirm".
+- Wait for the Service to be instantiated.
+- Press "Close" at bottom of pop-up window.
+
+Now you should be brought to the "View/Edit Service Instance" page, focused on the service you just instantiated.
+
+**Instantiate VNF:**
+
+- Press "Add node instance" and select your VNF.
+- Fill out the required fields and press "Confirm".
+- Leave this VID page open, as this step can take quite some time, depending on a number of factors.
+- Monitor the VNF instantiation through your VNFM GUI and back through the SO-ETSI-SOL003-Adapter logs and finally the BPMN logs.
+- Upon success, your VNF should be instantiated correctly.
+
+
+**Delete VNF:**
+
+- Travel back to the service instance that you instantiated your VNF through.
+- Simply select the red X on the right-hand side of the VNF instance.
+- The VNF should begin terminating now, it may take quite some time, depending on a number of factors.
+- Monitor the VNFM GUI and other logs until success.
+
+
+Monitoring Logs (BPMN, SO-ETSI-SOL003-ADAPTER and VNFM)
+-------------------------------------------------------
+
+There are 3 stages of logs to monitor throughout the process of instantiating your service, and sending your request through the SO-ETSI-SOL003-Adapter, to your VNFM.
+
+The initial service instantiation request will be recorded in the BPMN-INFRA pod’s logs. Logging into this pod will enable you to view them through the "debug.log" file.
+
+The VNF instantiation request will appear first in the BPMN-INFRA pod’s logs, then once the ETSI Building Block is being executed you will see entries going through the SO-ETSI-SOL003-Adapter pod’s logs. Followed finally by the VNFM itself receiving a request from the SO-ETSI-SOL003-Adapter. This should all be recorded throughout the “debug.logs” on each of the mentioned pods.
+
+The other areas to monitor would be your VNFM’s GUI (if applicable), your Openstack Tenant’s logs as well as it’s server list and the SO-Admin-Cockpit tool (in order to see the BPMN flow’s progress).
+
+Example Zip VNF Package
+-----------------------
+
+Please follow the structure laid out below for creating your onboarding package.
+
+**Structure:**
+
+5 files (2 .yaml, 1 .meta, 1 .json, 1 .env)
+
+- base.yaml
+- descriptor.yaml
+- base.env
+- MANIFEST.json
+- TOSCA.meta
+- Compressed in a Zip folder.
+- No directories. (Flat structure)
+
+**Files:**
+
+base.yaml - This file will be a very simple HEAT template, as it is just required in order to be able to instantiate the Service once its distributed.
+
+descriptor.yaml - This file will contain the VNFD (Virtual Network Function Descriptor). It must be structured to match what the SO-ETSI-SOL003-Adapter searches for.
+
+base.env - This file simply contains some environment variables for the base.yaml.
+
+MANIFEST.json - This file lists all of the other files contained within it's package.
+
+TOSCA.meta - This important file contains the path of the VNFD, which will be used by the SO-ETSI-SOL003-Adapter.
+
+
+Please find example versions of the files below:
+
+**base.yaml**
+
+.. code-block:: bash
+
+ heat_template_version: 2013-05-23
+ description: Simple template to deploy a single compute instance
+
+ parameters:
+ simple_name_0:
+ type: string
+ label: Key Name
+ description: Name of key-pair to be used for compute instance
+ simple_key:
+ type: string
+ label: Key Name
+ description: Name of key-pair to be used for compute instance
+ simple_image_name:
+ type: string
+ label: Image ID
+ description: Image to be used for compute instance
+ simple_flavor_name:
+ type: string
+ label: Instance Type
+ description: Type of instance (flavor) to be used
+ vnf_id:
+ type: string
+ label: VNF ID
+ description: The VNF ID is provided by ONAP
+ vf_module_id:
+ type: string
+ label: vFirewall module ID
+ description: The vFirewall Module ID is provided by ONAP
+ simple_netid:
+ type: string
+ label: Netid
+ description: netid
+ public_net_id:
+ type: string
+ label: Netid
+ description: public NetId
+ ves_ip:
+ type: string
+ label: Netid
+ description: public ves_ip
+ node_ip:
+ type: string
+ label: Netid
+ description: public ves_ip
+
+ resources:
+
+ simple_0_private_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: simple_netid }
+ fixed_ips:
+ - ip_address: { get_param: node_ip }
+
+ simple_0:
+ type: OS::Nova::Server
+ properties:
+ availability_zone: nova
+ key_name: { get_param: simple_key }
+ image: { get_param: simple_image_name }
+ flavor: { get_param: simple_flavor_name }
+ name: { get_param: simple_name_0 }
+ metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
+ networks:
+ - port: { get_resource: simple_0_private_port }
+ user_data_format: RAW
+ user_data:
+ str_replace:
+ params:
+ __ves_ip__: { get_param: ves_ip }
+ __vnfId__: { get_param: vnf_id }
+
+ template: |
+ #!/bin/bash
+
+ echo "the value we got for vndID was : __vnfId__" >> /tmp/vnfid.log
+
+ outputs:
+ oam_management_v4_address:
+ description: The IP address of the oam_management_v4_address
+ value: { get_param: node_ip }
+
+
+**descriptor.yaml**
+
+.. code-block:: bash
+
+ tosca_definitions_version: tosca_simple_yaml_1_1
+
+ imports:
+ - etsi_nfv_sol001_vnfd_0_10_0_type.yaml
+
+ node_types:
+ Wiki.Demo.VnfmImageId:
+ derived_from: tosca.nodes.nfv.VNF
+ properties:
+ descriptor_id:
+ type: string
+ constraints: [ valid_values: [ VnfmImageId ] ]
+ default: VnfmImageId
+
+
+The "descriptor.yaml" is the most important file within the package, as it provides the ID/Name of the VNF package for the VNFM to use when instantiating. It must follow the structure above, or the SO-ETSI-SOL003-Adapter will not be able to locate the VNFD.
+
+Don't forget to replace "VnfmImageId" with the ID of your VNF package.
+
+**base.env**
+
+.. code-block:: bash
+
+ parameters:
+ simple_image_name: UBUNTU16
+ simple_flavor_name: m1.small
+ simple_name_0: SIMPLEUBU
+ simple_key: demo-key
+ vnf_id: VESMED
+ vf_module_id: vfModuleId
+ simple_netid: onap_vip
+ public_net_id: nova_floating
+ ves_ip: 172.55.10.10
+ node_ip: 172.55.10.10
+
+
+**MANIFEST.json**
+
+.. code-block:: json
+
+ {
+ "name": "MMEPackage",
+ "description": "Test",
+ "version": "0.0",
+ "data": [{
+ "isBase": true,
+ "file": "base.yaml",
+ "type": "HEAT",
+ "data": [{
+ "file": "base.env",
+ "type": "HEAT_ENV"
+ }]
+ },
+ {
+ "file": "descriptor.yaml",
+ "type": "OTHER"
+ },
+ {
+ "file": "TOSCA.meta",
+ "type": "OTHER"
+ }]
+ }
+
+
+**TOSCA.meta**
+
+.. code-block:: bash
+
+ TOSCA-Meta-File-Version: 1.0
+ CSAR-Version: 1.1
+ Created-by: Demo
+ Entry-Definitions: Artifacts/Deployment/OTHER/descriptor.yaml
+
+
+The MANIFEST.json and TOSCA.meta are extremely important, if either are incorrectly formatted it will either fail to onboard or fail to distribute when you get to that step.
+
+Ensure that the file names all match and your indentation/quotes are all correct, as it will save you a lot of time.
+
+
diff --git a/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst b/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst
new file mode 100644
index 0000000000..ed729664a8
--- /dev/null
+++ b/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst
@@ -0,0 +1,149 @@
+
+SO Admin Cockpit User Guide
+===========================
+
+Introduction
+------------
+
+The SO-Admin-Cockpit component allows a user to have a detailed monitoring view of the Camunda BPMN workflows that have run, or are running, in SO. It provides a frontend UI that allows users to easily go through a workflow’s different calls and drill up/down through the call activities within the workflow. It also provides a search page for filtering specific results. It allows you to filter by start/end time/date, instance id, request id, service name or by the status of a workflow. The component is extremely useful for debugging and testing workflows of any kind, as it delivers an understandable and simple UI which is much easier to follow than large, cumbersome debug log files. Additionally the UI provides a statistics page, based on your current search parameters, that provides the percentages of complete, failed, in progress, pending and unlocked workflows.
+
+(Previous to the Honolulu release of ONAP SO-Admin-Cockpit was named SO-Monitoring, an additional change in the controller is required to change the Host name to SO-Admin-Cockpit, as it remains as SO-Monitoring currently)
+
+Using SO-Admin-Cockpit
+----------------------
+
+In order to make use of SO-Admin-Cockpit currently, you will need to onboard the application in the ONAP portal or access the SO-Admin-Cockpit UI directly. This can be done using the host name “so-admin-cockpit", and the port number, which by default is “30224”. First you need to make sure you can access the ONAP portal, this is done by adding the following to your "hosts" file:
+
+.. code-block:: bash
+
+ <onapVmIp> portal.api.simpledemo.onap.org
+
+Replacing <onapVmIp> with the IP of your device hosting your Portal pod within ONAP. Add this to a blank line in your hosts file, usually found in “C:\Windows\System32\drivers\etc” on Windows. Ensure you open the host file as an administrator in order to edit it.
+
+Alternatively you can access SO-Admin-Cockpit directly by simply adding the following line to your "hosts" file:
+
+.. code-block:: bash
+
+ <soAdminCockpitVmIp> so-monitoring
+
+Where <soAdminCockpitVmIp> is replaced with the IP of the device hosting your SO-Admin-Cockpit pod.
+Then accessing the following link through your browser:
+
+.. code-block:: bash
+
+ https://so-monitoring:30224/
+
+Steps to add SO-Admin-Cockpit to the Portal
+-------------------------------------------
+
+In Pre-Casablanca releases you will need to expose the so-monitoring service using a Loadbalancer in order to access it, this is simple until there is a NodePort assigned to SO-Monitoring. Use this command to expose the service:
+
+.. code-block:: bash
+
+ kubectl expose services so-monitoring --type=LoadBalancer --port 9091 --target-port=9091 --name=so-monitoring-external -n onap
+
+Log into your ONAP Portal as the super user
+
+- Login: demo
+- Password: demo123456!
+
+Click “Application Onboarding”, then “Add App” in the top right.
+Fill out the required Application Details (Name, URL, REST API URL, Username, Password) as shown here:
+
+- Application Name: SO-Admin-Cockpit
+- URL: https://so-monitoring:30224
+- Rest API URL: https://so-monitoring:30224
+- Username: demo
+- Password: <PASSWORD>
+- Namespace: SO-Admin-Cockpit
+
+Please note, the <PASSWORD> can be retrieved by logging into the SO-Admin-Cockpit pod and retrieving the environment variables using the following command:
+
+.. code-block:: bash
+
+ env | grep SO_COCKPIT
+
+Now simply go to the “Application Catalog” tab on the left of the page, then tick your Monitoring app to enable it. (Whatever you set Application Name as should show up here.) Click the “Home” tab and you should be able to access the Admin Cockpit now.
+
+Searching/Viewing BPMN Workflows
+--------------------------------
+
+.. image:: ../images/soAdminCockpitUi.png
+
+In order to find the workflow that you are attempting to monitor you will need at least one of the following values of the service instance: Service Instance ID, Request ID, Service Name or the time/date range in which the workflow started/ended. You can use the filter drop-down boxes to the left of the parameter boxes, i.e. “EQUAL”, “NOT EQUAL” and “LIKE”. Also, you can filter by the status of a workflow, with the status drop-down box, to further filter your results. Simply enter any of these pieces of information into the search page, ensure the start and end date range includes when the workflow would have run and press the search button. Once your results list has been returned you can click on a result to see the workflow in the graphical BPMN viewer.
+
+.. image:: ../images/soAdminCockpitUi2.png
+
+From here you can inspect the different calls and variables throughout the workflow, by using the "Activity Instances" and "Variable Instances" tabs. Clicking on one of the sub process call, within the diagram, to open them in the graphical BPMN viewer (The boxes with a + at the bottom of them are call activities to sub processes. This is how you drill down through a workflow, you can also safely traverse back “up” through the flows with your browser’s back button. The cyan highlighting shows the flow of the path taken by the workflow, and this will go down through each of the sub processes as well.
+
+.. image:: ../images/soAdminCockpitUi3.png
+
+In the BPMN viewer, manipulation of the returned illustrated flow is possible by using the following methods. On the left side of the viewer window there are three symbols for Zooming in/out and fitting the flow to the full window. Along with these controls, the user can left-click and drag to move the flow within the canvas to the user desired position.
+
+SO-Monitoring Service Statistics
+--------------------------------
+
+.. image:: ../images/soAdminCockpitStatistics.png
+
+You can see a summary of the status of all of the workflows from one of your search results by clicking on the "Service Statistics" tab, found just above your list of results. Here you can find a percentile breakdown of each workflow's, in the list of results you received, statuses.
+
+Troubleshooting SO-Admin-Cockpit
+--------------------------------
+
+The log files for SO-Admin-Cockpit can be found within the SO-Admin-Cockpit pod. They will be located in the “/app/logs/so-admin-cockpit" directory. You will find a debug, error, metric and audit log file here. They each contain differing information, except the debug log file which will contain all of the logging information. Alternatively you can get the logs from the SO-Admin-Cockpit pod itself when using Kubernetes. Using the following command:
+
+.. code-block:: bash
+
+ kubectl -n <namespace> logs <soAdminCockpitPodName>
+
+Replacing <namespace> with your environments namespace and <soAdminCockpitPodName> with the full name of your SO-Admin-Cockpit pod. This command will give you some detailed information from the execution of the pod.
+
+CORS (Cross-Origin Resource Sharing) Error
+----------
+
+Pre-Dublin SO-Monitoring Components may experience CORS issues.
+
+To check for this error open up the console of the browser you are using. In Mozilla Firefox do this by pressing CTRL + SHIFT + C and then selecting the console. In Google Chrome this is done by CTRL + SHIFT + I and then selecting the console. If an exception relating to CORS is displayed, then this issue must be addressed.
+
+This can be dealt with in two ways. Either using an extension or by disabling CORS in the browser.
+
+- If using Firefox then the CORS Everywhere extension should be used. While if using Chrome the Allow-Control-Allow-Origin should be used.
+- To disable the CORS in Chrome, follow this thread (https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome).
+
+Internal Service Error occurred for operation : GET please check backend service log. status code: 500
+-------------------------------------------------------------------------------------------------------
+
+.. image:: ../images/soAdminCockpitGetError.png
+
+This can be checked by following the below steps:
+
+- Open the developers mode in your browser
+- Click on Console
+- Check to see if an error occurs similar to the following:
+
+.. code-block:: bash
+
+ Error : No serializer found for class org.onap.so.bpmn.core.RollbackData and no properties discovered to create BeanSerializer
+
+This issue could be associated with any one of the objects being used in the BPMN flows, when it's declared as a java object but attempted to be serialized without marking/declaring it as serializable. So the issue must be fixed at the Object level, by ensuring any objects used by the particular BPMN Flow are made serializable.
+
+SO Admin Cockpit App creates a Blank Tab
+----------------------------------------
+
+If when selecting SO Admin Cockpit from the portal a blank tab labeled “SO Admin Cockpit" is returned, then the issue may relate the URL you are using in portal by default.
+
+A fix for this issue is to change “https” to “http” and change the port from “30224” to “30215”, within the browser URL.
+
+For example, using this URL:
+
+.. code-block:: bash
+
+ http://portal.api.simpledemo.onap.org:30215/ONAPPORTAL/applicationsHome
+
+Instead of the default URL:
+
+.. code-block:: bash
+
+ https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/applicationsHome
+
+
diff --git a/docs/images/abort.png b/docs/images/abort.png
new file mode 100644
index 0000000000..dcbb51ddbe
--- /dev/null
+++ b/docs/images/abort.png
Binary files differ
diff --git a/docs/images/handling_error.png b/docs/images/handling_error.png
new file mode 100644
index 0000000000..58708ab2ca
--- /dev/null
+++ b/docs/images/handling_error.png
Binary files differ
diff --git a/docs/images/rainy_day_handler_macro_table.png b/docs/images/rainy_day_handler_macro_table.png
new file mode 100644
index 0000000000..1f127f93d9
--- /dev/null
+++ b/docs/images/rainy_day_handler_macro_table.png
Binary files differ
diff --git a/docs/images/retry.png b/docs/images/retry.png
new file mode 100644
index 0000000000..9bd60831e2
--- /dev/null
+++ b/docs/images/retry.png
Binary files differ
diff --git a/docs/images/retry2.png b/docs/images/retry2.png
new file mode 100644
index 0000000000..1635f4561f
--- /dev/null
+++ b/docs/images/retry2.png
Binary files differ
diff --git a/docs/images/retry3.png b/docs/images/retry3.png
new file mode 100644
index 0000000000..7fbb9131d6
--- /dev/null
+++ b/docs/images/retry3.png
Binary files differ
diff --git a/docs/images/retry_Bdd.png b/docs/images/retry_Bdd.png
new file mode 100644
index 0000000000..ee52e768ea
--- /dev/null
+++ b/docs/images/retry_Bdd.png
Binary files differ
diff --git a/docs/images/retry_Bdd2.png b/docs/images/retry_Bdd2.png
new file mode 100644
index 0000000000..33ee2cba13
--- /dev/null
+++ b/docs/images/retry_Bdd2.png
Binary files differ
diff --git a/docs/images/rollback.png b/docs/images/rollback.png
new file mode 100644
index 0000000000..82cb9346e2
--- /dev/null
+++ b/docs/images/rollback.png
Binary files differ
diff --git a/docs/images/rollback_Bdd.png b/docs/images/rollback_Bdd.png
new file mode 100644
index 0000000000..a8fd8fe59b
--- /dev/null
+++ b/docs/images/rollback_Bdd.png
Binary files differ
diff --git a/docs/images/soAdminCockpitGetError.png b/docs/images/soAdminCockpitGetError.png
new file mode 100644
index 0000000000..32325bde47
--- /dev/null
+++ b/docs/images/soAdminCockpitGetError.png
Binary files differ
diff --git a/docs/images/soAdminCockpitStatistics.png b/docs/images/soAdminCockpitStatistics.png
new file mode 100644
index 0000000000..bb0a4d3316
--- /dev/null
+++ b/docs/images/soAdminCockpitStatistics.png
Binary files differ
diff --git a/docs/images/soAdminCockpitUi.png b/docs/images/soAdminCockpitUi.png
new file mode 100644
index 0000000000..1e1781b3f6
--- /dev/null
+++ b/docs/images/soAdminCockpitUi.png
Binary files differ
diff --git a/docs/images/soAdminCockpitUi2.png b/docs/images/soAdminCockpitUi2.png
new file mode 100644
index 0000000000..88ef083034
--- /dev/null
+++ b/docs/images/soAdminCockpitUi2.png
Binary files differ
diff --git a/docs/images/soAdminCockpitUi3.png b/docs/images/soAdminCockpitUi3.png
new file mode 100644
index 0000000000..bb2d0563c5
--- /dev/null
+++ b/docs/images/soAdminCockpitUi3.png
Binary files differ
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index de12fc439c..90fd8aaf68 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -14,6 +14,131 @@ The SO provides the highest level of service orchestration in the ONAP architect
Release Notes
=============
+Version: 8.0
+==============
+
+:Release Date: 2021-04-19
+
+SO Release Image Versions
+--------------------------
+ - so-bpmn-infra
+
+ :Version: 1.8.2
+
+ - so-catalog-db-adapter
+
+ :Version: 1.8.2
+
+ - so-admin-cockpit
+
+ :Version: 1.8.2
+
+ - so-nssmf-adapter
+
+ :Version: 1.8.3
+
+ - so-openstack-adapter
+
+ :Version: 1.8.2
+
+ - so-request-db-adapter
+
+ :Version: 1.8.2
+
+ - so-sdc-controller
+
+ :Version: 1.8.2
+
+ - so-sdnc-adapter
+
+ :Version: 1.8.2
+
+ - so-sol003-adapter
+
+ :Version: 1.8.2
+
+ - so-api-handler-infra
+
+ :Version: 1.8.2
+
+ - so-etsi-nfvo-ns-lcm
+
+ :Version: 1.8.2
+
+ - so-oof-adapter
+
+ :Version: 1.8.3
+
+ - so-cnf-adapter
+
+ :Version: 1.8.3
+
+Release Purpose
+----------------
+SO Honolulu Release.
+The key delivereable for this release is refactoring SO for better internal architecture.
+
+
+**Epics**
+
+* `SO-3473 <https://jira.onap.org/browse/SO-3473>`_ - Refactor SO to enhance the usability
+* `SO-3381 <https://jira.onap.org/browse/SO-3381>`_ - SO Impacts for E2E Network Slicing in Honolulu
+* `SO-3206 <https://jira.onap.org/browse/SO-3206>`_ - Support for NS LCM and Workflows Management
+* `SO-3493 <https://jira.onap.org/browse/SO-3493>`_ - Java 11 and Python 3 upgrades
+
+**Stories**
+
+The full list of implemented tasks is available on `JIRA Honolulu STORY <https://jira.onap.org/issues/?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20story%20AND%20fixVersion%20%3D%20%22honolulu%20Release%22>`_
+Listed below are key functional jira stories handled in the Honolulu release:
+
+
+**Tasks**
+
+The full list of implemented tasks is available on `JIRA Honolulu TASKS <https://jira.onap.org/issues/?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20Task%20AND%20fixVersion%20%3D%20%22honolulu%20Release%22>`_
+
+**Bug Fixes**
+
+The full list of fixed bugs is available on `JIRA Honolulu BUGS
+<https://jira.onap.org/issues/?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20%3D%20%22honolulu%20Release%22>`_
+
+
+
+Security Notes
+--------------
+
+*Fixed Security Issues*
+
+*Known Security Issues*
+
+*Known Vulnerabilities in Used Modules*
+
+Quick Links:
+
+- `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`__
+- `Passing Badge information for SDC <https://bestpractices.coreinfrastructure.org/en/projects/1702>`__
+
+**Known Issues**
+* `SO-3628 <https://jira.onap.org/browse/SO-3628>`_ - SO cannot send CDS request due to grpc schema problem.
+* `SO-3626 <https://jira.onap.org/browse/SO-3626>`_ - SO does not requests CDS for skipPostInstantiation flag set to False.
+* `SO-3237 <https://jira.onap.org/browse/SO-3237>`_ - Exposed HTTP port.
+
+
+**Upgrade Notes**
+
+ N/A
+
+**Deprecation Notes**
+
+ SO modules Ve-Vnfm-adapter and appc-orchestrator are deprectaed for the Honolulu release.
+
+**Other**
+
+ N/A
+***************************************************************************************
+
+
+
+
Version: 1.7.10
==============
diff --git a/graph-inventory/fluent-builder-maven-plugin/pom.xml b/graph-inventory/fluent-builder-maven-plugin/pom.xml
index 6b3fd0f8bd..bcc04efb31 100644
--- a/graph-inventory/fluent-builder-maven-plugin/pom.xml
+++ b/graph-inventory/fluent-builder-maven-plugin/pom.xml
@@ -68,9 +68,9 @@
<version>2.2.1</version>
</dependency>
<dependency>
- <groupId>io.swagger</groupId>
+ <groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
- <version>1.0.50</version>
+ <version>2.0.24</version>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
index 21bc2a697a..9ec214fc6d 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
@@ -23,6 +23,7 @@ package org.onap.so.db.request.data.repository;
import java.util.List;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@@ -44,4 +45,7 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr
RequestProcessingData[] findByGroupingIdAndNameAndTag(@Param("GROUPING_ID") String groupingId,
@Param("NAME") String name, @Param("TAG") String tag);
+
+ RequestProcessingData[] findBySoRequestIdAndNameAndTagOrderByCreatedDesc(@Param("SO_REQUEST_ID") String soRequestId,
+ @Param("NAME") String name, @Param("TAG") String tag);
}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
index 9b42eacfc2..806d347582 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
@@ -127,6 +127,9 @@ public class RequestsDbClient {
private static final String findByGroupingIdAndNameAndTag =
"/requestProcessingData/search/findByGroupingIdAndNameAndTag";
+ private static final String findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc =
+ "/requestProcessingData/search/findBySoRequestIdAndNameAndTagOrderByCreatedDesc";
+
@Autowired
protected RestTemplate restTemplate;
@@ -403,6 +406,15 @@ public class RequestsDbClient {
RequestProcessingData.class);
}
+ public List<RequestProcessingData> getRequestProcessingDataBySoRequestIdAndNameAndTagOrderByCreateTimeDesc(
+ String soRequestId, String name, String tag) {
+
+ return getMultipleResponse(getUri(UriBuilder
+ .fromUri(endpoint + findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc)
+ .queryParam(SO_REQUEST_ID, soRequestId).queryParam(NAME, name).queryParam(TAG, tag).build().toString()),
+ new ParameterizedTypeReference<List<RequestProcessingData>>() {});
+ }
+
public void persistProcessingData(String flowExecutionPath, String requestId) {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
index c3617b62c7..36d3c98413 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
@@ -27,6 +27,7 @@ import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@@ -74,7 +75,7 @@ public class CloudIdentity {
@Column(name = "PROJECT_DOMAIN_NAME")
private String projectDomainName;
- @JsonProperty("admin_project_domain_name ")
+ @JsonProperty("admin_project_domain_name")
@BusinessKey
@Column(name = "ADMIN_PROJECT_DOMAIN_NAME", nullable = false)
private String adminProjectDomainName = "Default";
@@ -94,7 +95,7 @@ public class CloudIdentity {
@Column(name = "MEMBER_ROLE")
private String memberRole;
- @JsonProperty("tenant_metadata")
+ @JsonProperty("tenant_meta_data")
@BusinessKey
@Column(name = "TENANT_METADATA")
private Boolean tenantMetadata;
@@ -136,6 +137,11 @@ public class CloudIdentity {
this.updated = new Date();
}
+ @PreUpdate
+ protected void onUpdate() {
+ this.updated = new Date();
+ }
+
public String getId() {
return id;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
index 64c4b62b11..f7cb9fe3c4 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
@@ -31,6 +31,7 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@@ -143,6 +144,11 @@ public class CloudSite {
this.updated = new Date();
}
+ @PreUpdate
+ protected void onUpdate() {
+ this.updated = new Date();
+ }
+
public CloudSite(CloudSite site) {
this.cloudVersion = site.getCloudVersion();
this.clli = site.getClli();
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
index 2dea0bb752..0cfb253fd9 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
@@ -223,7 +223,7 @@ public class PnfResourceCustomization implements Serializable {
this.blueprintVersion = blueprintVersion;
}
- public boolean isSkipPostInstConf() {
+ public boolean getSkipPostInstConf() {
return skipPostInstConf;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
index 3cca869663..b4c75ba776 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
@@ -460,7 +460,7 @@ public class Service implements Serializable {
this.blueprintVersion = blueprintVersion;
}
- public Boolean isSkipPostInstConf() {
+ public Boolean getSkipPostInstConf() {
return skipPostInstConf;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
index f745bb8609..605fdef63b 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
@@ -243,7 +243,7 @@ public class VfModuleCustomization implements Serializable {
this.cvnfcCustomization = cvnfcCustomization;
}
- public Boolean isSkipPostInstConf() {
+ public Boolean getSkipPostInstConf() {
return skipPostInstConf;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
index 740e51a269..174c5a21eb 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
@@ -327,7 +327,7 @@ public class VnfResourceCustomization implements Serializable {
this.blueprintVersion = blueprintVersion;
}
- public Boolean isSkipPostInstConf() {
+ public Boolean getSkipPostInstConf() {
return skipPostInstConf;
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java
index d0c621ddd0..5477e3e563 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java
@@ -50,7 +50,7 @@ public class PnfCustomizationRepositoryTest extends BaseTest {
assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
- assertTrue("skip post instantiation configuration", pnfResourceCustomization.isSkipPostInstConf());
+ assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf());
PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
assertNotNull(pnfResource);
diff --git a/pom.xml b/pom.xml
index 407d692eb5..a665440d04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -849,17 +849,17 @@
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-slf4j</artifactId>
- <version>1.6.9-SNAPSHOT</version>
+ <version>1.6.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-filter-base</artifactId>
- <version>1.6.9-SNAPSHOT</version>
+ <version>1.6.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-filter-spring</artifactId>
- <version>1.6.9-SNAPSHOT</version>
+ <version>1.6.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
@@ -1007,17 +1007,6 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
- <version>${cxf.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.spec.javax.rmi</groupId>
- <artifactId>jboss-rmi-api_1.0_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-service-description-openapi-v3</artifactId>
<version>${cxf.version}</version>
<exclusions>
@@ -1065,11 +1054,6 @@
<version>${aaf.version}</version>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- <version>1.6.2</version>
- </dependency>
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>